_networkModel = new NetworkModel(this);
connect(this, SIGNAL(bufferUpdated(BufferInfo)),
_networkModel, SLOT(bufferUpdated(BufferInfo)));
+ connect(this, SIGNAL(networkRemoved(NetworkId)),
+ _networkModel, SLOT(networkRemoved(NetworkId)));
_bufferModel = new BufferModel(_networkModel);
SignalProxy *p = signalProxy();
- p->attachSlot(SIGNAL(displayMsg(const Message &)), this, SLOT(recvMessage(Message &)));
+ p->attachSlot(SIGNAL(displayMsg(const Message &)), this, SLOT(recvMessage(const Message &)));
p->attachSlot(SIGNAL(displayStatusMsg(QString, QString)), this, SLOT(recvStatusMsg(QString, QString)));
p->attachSlot(SIGNAL(backlogData(BufferInfo, const QVariantList &, bool)), this, SLOT(recvBacklogData(BufferInfo, const QVariantList &, bool)));
}
}
-void Client::recvMessage(Message &msg) {
+void Client::recvMessage(const Message &message) {
+ Message msg = message;
Buffer *b;
if(msg.type() == Message::Error) {
const Network *net = network(msg.bufferInfo().networkId());
if(net && !net->myNick().isEmpty()) {
QRegExp nickRegExp("^(.*\\W)?" + QRegExp::escape(net->myNick()) + "(\\W.*)?$");
- if((msg.type() == Message::Plain || msg.type() == Message::Notice || msg.type() == Message::Action) && nickRegExp.exactMatch(msg.text()))
+ if((msg.type() & (Message::Plain | Message::Notice | Message::Action)) && nickRegExp.exactMatch(msg.text()))
msg.setFlags(msg.flags() | Message::Highlight);
}
}