Case-insensitive channel names for IRC. Fixed leaving admin players.

This commit is contained in:
lotodore
2007-10-25 19:50:43 +00:00
parent dc74186b5a
commit f3556bff57
2 changed files with 16 additions and 1 deletions
+10 -1
View File
@@ -24,11 +24,20 @@
#include <libircclient.h>
#include <sstream>
#include <cctype>
#include <cstring>
using namespace std;
#define IRC_WAIT_TERMINATION_MSEC 500
// Not using boost::algorithm here because of STL issues.
#ifdef _MSC_VER
#define STRCASECMP _stricmp
#else
#define STRCASECMP strcasecmp
#endif
struct IrcContext
{
IrcContext(IrcThread &t) : ircThread(t), session(NULL), serverPort(0), useIPv6(false) {}
@@ -154,7 +163,7 @@ irc_event_channel(irc_session_t *session, const char * /*irc_event*/, const char
{
IrcContext *context = (IrcContext *) irc_get_ctx(session);
if (count >= 2 && context->channel == params[0]) // check whether this message is for our channel
if (count >= 2 && STRCASECMP(context->channel.c_str(),params[0]) == 0) // check whether this message is for our channel
{
// Signal the message (if any) to GUI.
if (*params[1] != 0)