X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fircchannel.cpp;h=412ad2ad08d481624dbaec54b1128580a9438aba;hp=28d6c6ed46f9d0294607f4d068dc23fc71efc4b8;hb=a30b5992589c96fcb1eca1af36465a955d2cf6ff;hpb=1956aab57bf98ce072ed86f34785e5d7abba35a0 diff --git a/src/common/ircchannel.cpp b/src/common/ircchannel.cpp index 28d6c6ed..412ad2ad 100644 --- a/src/common/ircchannel.cpp +++ b/src/common/ircchannel.cpp @@ -21,6 +21,7 @@ #include "ircchannel.h" #include "networkinfo.h" +//#include "nicktreemodel.h" #include "signalproxy.h" #include "ircuser.h" @@ -40,6 +41,10 @@ IrcChannel::IrcChannel(const QString &channelname, NetworkInfo *networkinfo) setObjectName(QString::number(networkInfo->networkId()) + "/" + channelname); } +IrcChannel::~IrcChannel() { + +} + // ==================== // PUBLIC: // ==================== @@ -107,6 +112,7 @@ void IrcChannel::join(IrcUser *ircuser) { if(!_userModes.contains(ircuser) && ircuser) { _userModes[ircuser] = QString(); ircuser->joinChannel(name()); + connect(ircuser, SIGNAL(nickSet(QString)), this, SLOT(ircUserNickSet(QString))); connect(ircuser, SIGNAL(destroyed()), this, SLOT(ircUserDestroyed())); // if you wonder why there is no counterpart to ircUserJoined: // the joines are propagted by the ircuser. the signal ircUserJoined is only for convenience @@ -137,6 +143,7 @@ void IrcChannel::setUserModes(IrcUser *ircuser, const QString &modes) { if(isKnownUser(ircuser)) { _userModes[ircuser] = modes; emit userModesSet(ircuser->nick(), modes); + emit userModesSet(ircuser, modes); } } @@ -152,6 +159,7 @@ void IrcChannel::addUserMode(IrcUser *ircuser, const QString &mode) { if(!_userModes[ircuser].contains(mode)) { _userModes[ircuser] += mode; emit userModeAdded(ircuser->nick(), mode); + emit userModeAdded(ircuser, mode); } } @@ -160,15 +168,15 @@ void IrcChannel::addUserMode(const QString &nick, const QString &mode) { addUserMode(networkInfo->ircUser(nick), mode); } - // REMOVE USER MODE -void IrcChannel::removeUserMode(IrcUser *ircuser, const QString &mode) { +void IrcChannel::removeUserMode(IrcUser *ircuser, const QString &mode) { qDebug() << "remove mode:" << ircuser->nick() << mode; if(!isKnownUser(ircuser) || !isValidChannelUserMode(mode)) return; if(_userModes[ircuser].contains(mode)) { _userModes[ircuser].remove(mode); emit userModeRemoved(ircuser->nick(), mode); + emit userModeRemoved(ircuser, mode); } } @@ -202,6 +210,12 @@ void IrcChannel::ircUserDestroyed() { _userModes.remove(ircUser); } +void IrcChannel::ircUserNickSet(QString nick) { + IrcUser *ircUser = qobject_cast(sender()); + Q_ASSERT(ircUser); + emit ircUserNickSet(ircUser, nick); +} + void IrcChannel::setInitialized() { _initialized = true; emit initDone();