Case-insensitive channel names for IRC. Fixed leaving admin players.
This commit is contained in:
@@ -114,6 +114,12 @@ void LobbyChat::playerLeft(QString playerName)
|
|||||||
QList<QTreeWidgetItem *> tmpList(myLobby->treeWidget_NickList->findItems(playerName, Qt::MatchExactly));
|
QList<QTreeWidgetItem *> tmpList(myLobby->treeWidget_NickList->findItems(playerName, Qt::MatchExactly));
|
||||||
if (!tmpList.empty())
|
if (!tmpList.empty())
|
||||||
myLobby->treeWidget_NickList->takeTopLevelItem(myLobby->treeWidget_NickList->indexOfTopLevelItem(tmpList.front()));
|
myLobby->treeWidget_NickList->takeTopLevelItem(myLobby->treeWidget_NickList->indexOfTopLevelItem(tmpList.front()));
|
||||||
|
else
|
||||||
|
{
|
||||||
|
tmpList = myLobby->treeWidget_NickList->findItems("@" + playerName, Qt::MatchExactly);
|
||||||
|
if (!tmpList.empty())
|
||||||
|
myLobby->treeWidget_NickList->takeTopLevelItem(myLobby->treeWidget_NickList->indexOfTopLevelItem(tmpList.front()));
|
||||||
|
}
|
||||||
|
|
||||||
myLobby->treeWidget_NickList->sortItems(0, Qt::AscendingOrder);
|
myLobby->treeWidget_NickList->sortItems(0, Qt::AscendingOrder);
|
||||||
|
|
||||||
|
|||||||
@@ -24,11 +24,20 @@
|
|||||||
#include <libircclient.h>
|
#include <libircclient.h>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <cctype>
|
#include <cctype>
|
||||||
|
#include <cstring>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
#define IRC_WAIT_TERMINATION_MSEC 500
|
#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
|
struct IrcContext
|
||||||
{
|
{
|
||||||
IrcContext(IrcThread &t) : ircThread(t), session(NULL), serverPort(0), useIPv6(false) {}
|
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);
|
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.
|
// Signal the message (if any) to GUI.
|
||||||
if (*params[1] != 0)
|
if (*params[1] != 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user