X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fclient%2Fclient.cpp;h=e936be5d89a27c6020a1900519dc87ec188b65c7;hp=a8cc7f93c78cdfa9c8e8e6473edbdbea23c12f2d;hb=733eedc159bd22a9f5e307e2db3d075eedc3b7a9;hpb=a2bf6dec2ea5a72d15a3310f8a7abc11988228c4 diff --git a/src/client/client.cpp b/src/client/client.cpp index a8cc7f93..e936be5d 100644 --- a/src/client/client.cpp +++ b/src/client/client.cpp @@ -26,6 +26,7 @@ #include "buffersyncer.h" #include "bufferviewmanager.h" #include "clientbacklogmanager.h" +#include "clientirclisthelper.h" #include "global.h" #include "identity.h" #include "ircchannel.h" @@ -71,11 +72,14 @@ Client::Client(QObject *parent) _bufferSyncer(0), _backlogManager(new ClientBacklogManager(this)), _bufferViewManager(0), + _ircListHelper(new ClientIrcListHelper(this)), _messageModel(0), _connectedToCore(false), _syncedToCore(false) { _monitorBuffer = new Buffer(BufferInfo(), this); + _signalProxy->synchronize(_ircListHelper); + connect(_backlogManager, SIGNAL(backlog(BufferId, const QVariantList &)), this, SLOT(receiveBacklog(BufferId, const QVariantList &))); } @@ -242,7 +246,8 @@ void Client::coreNetworkCreated(NetworkId id) { } void Client::coreNetworkRemoved(NetworkId id) { - if(!_networks.contains(id)) return; + if(!_networks.contains(id)) + return; Network *net = _networks.take(id); emit networkRemoved(net->networkId()); net->deleteLater(); @@ -497,7 +502,7 @@ void Client::recvMessage(const Message &message) { ? net->networkName() + ":" : QString(); QString sender = networkName + msg.bufferInfo().bufferName() + ":" + msg.sender(); - Message mmsg = Message(msg.timestamp(), msg.bufferInfo(), msg.type(), msg.text(), sender, msg.flags()); + Message mmsg = Message(msg.timestamp(), msg.bufferInfo(), msg.type(), msg.contents(), sender, msg.flags()); monitorBuffer()->appendMsg(mmsg); } emit messageReceived(msg); @@ -582,13 +587,15 @@ void Client::checkForHighlight(Message &msg) { if(notificationSettings.highlightNick() == NotificationSettings::CurrentNick) { nickList << net->myNick(); } else if(notificationSettings.highlightNick() == NotificationSettings::AllNicks) { - nickList = identity(net->identity())->nicks(); + const Identity *myIdentity = identity(net->identity()); + if(myIdentity) + nickList = myIdentity->nicks(); } foreach(QString nickname, nickList) { QRegExp nickRegExp("^(.*\\W)?" + QRegExp::escape(nickname) + "(\\W.*)?$"); if((msg.type() & (Message::Plain | Message::Notice | Message::Action)) && !(msg.flags() & Message::Self) - && nickRegExp.exactMatch(msg.text())) { + && nickRegExp.exactMatch(msg.contents())) { msg.setFlags(msg.flags() | Message::Highlight); return; } @@ -608,7 +615,7 @@ void Client::checkForHighlight(Message &msg) { } if((msg.type() & (Message::Plain | Message::Notice | Message::Action)) && !(msg.flags() & Message::Self) - && userRegExp.exactMatch(msg.text())) { + && userRegExp.exactMatch(msg.contents())) { msg.setFlags(msg.flags() | Message::Highlight); return; } @@ -637,10 +644,11 @@ void Client::removeBuffer(BufferId id) { } void Client::bufferRemoved(BufferId bufferId) { - // first remove the buffer from has. this prohibits further lastSeenUpdates + // first remove the buffer from hash. this prohibits further lastSeenUpdates Buffer *buff = 0; if(_buffers.contains(bufferId)) { buff = _buffers.take(bufferId); + layoutQueue.removeAll(buff); disconnect(buff, 0, this, 0); }