+
+// override this to inject display of network and channel
+QVariant ChatMonitorFilter::data(const QModelIndex &index, int role) const {
+ if(index.column() != ChatLineModel::SenderColumn) return MessageFilter::data(index, role);
+ if(role == ChatLineModel::DisplayRole) {
+ BufferId bufid = data(index, ChatLineModel::BufferIdRole).value<BufferId>();
+ if(bufid.isValid()) {
+ Buffer *buf = Client::buffer(bufid);
+ if(!buf) {
+ qDebug() << "invalid buffer!";
+ return QVariant();
+ }
+ const Network *net = Client::networkModel()->networkByIndex(Client::networkModel()->bufferIndex(bufid));
+ if(!net) {
+ qDebug() << "invalid net!";
+ return QVariant();
+ }
+ QString result = QString("<%1:%2:%3").arg(net->networkName())
+ .arg(buf->bufferInfo().bufferName())
+ .arg(MessageFilter::data(index, role).toString().mid(1));
+ return result;
+ }
+
+ }
+ return MessageFilter::data(index, role);
+
+}