users who are away are now greyed out in the nickview
[quassel.git] / src / client / client.cpp
index ecfc109..c63632d 100644 (file)
@@ -29,7 +29,6 @@
 #include "network.h"
 #include "networkmodel.h"
 #include "buffermodel.h"
-#include "nickmodel.h"
 #include "quasselui.h"
 #include "signalproxy.h"
 #include "util.h"
@@ -61,10 +60,10 @@ Client::Client(QObject *parent)
     mainUi(0),
     _networkModel(0),
     _bufferModel(0),
-    _nickModel(0),
     _connectedToCore(false),
     _syncedToCore(false)
 {
+  _monitorBuffer = new Buffer(BufferInfo(), this);
 }
 
 Client::~Client() {
@@ -78,7 +77,6 @@ void Client::init() {
           _networkModel, SLOT(bufferUpdated(BufferInfo)));
 
   _bufferModel = new BufferModel(_networkModel);
-  _nickModel = new NickModel(_networkModel);
 
   SignalProxy *p = signalProxy();
   p->attachSignal(this, SIGNAL(sendSessionData(const QString &, const QVariant &)),
@@ -105,13 +103,13 @@ void Client::init() {
   p->attachSignal(this, SIGNAL(requestRemoveIdentity(IdentityId)), SIGNAL(removeIdentity(IdentityId)));
   p->attachSlot(SIGNAL(identityCreated(const Identity &)), this, SLOT(coreIdentityCreated(const Identity &)));
   p->attachSlot(SIGNAL(identityRemoved(IdentityId)), this, SLOT(coreIdentityRemoved(IdentityId)));
-
+/*
   p->attachSignal(this, SIGNAL(requestCreateNetwork(const NetworkInfo &)), SIGNAL(createNetwork(const NetworkInfo &)));
   p->attachSignal(this, SIGNAL(requestUpdateNetwork(const NetworkInfo &)), SIGNAL(updateNetwork(const NetworkInfo &)));
   p->attachSignal(this, SIGNAL(requestRemoveNetwork(NetworkId)), SIGNAL(removeNetwork(NetworkId)));
   p->attachSlot(SIGNAL(networkCreated(const NetworkInfo &)), this, SLOT(coreNetworkCreated(const NetworkInfo &)));
   p->attachSlot(SIGNAL(networkRemoved(NetworkId)), this, SLOT(coreNetworkRemoved(NetworkId)));
-
+*/
   connect(p, SIGNAL(disconnected()), this, SLOT(disconnectFromCore()));
 
   //connect(mainUi, SIGNAL(connectToCore(const QVariantMap &)), this, SLOT(connectToCore(const QVariantMap &)));
@@ -165,6 +163,10 @@ Buffer *Client::buffer(BufferInfo id) {
   return buff;
 }
 
+Buffer *Client::monitorBuffer() {
+  return instance()->_monitorBuffer;
+}
+
 
 NetworkModel *Client::networkModel() {
   return instance()->_networkModel;
@@ -174,11 +176,6 @@ BufferModel *Client::bufferModel() {
   return instance()->_bufferModel;
 }
 
-NickModel *Client::nickModel() {
-  return instance()->_nickModel;
-}
-
-
 SignalProxy *Client::signalProxy() {
   return instance()->_signalProxy;
 }
@@ -419,6 +416,13 @@ void Client::recvMessage(const Message &msg) {
   Buffer *b = buffer(msg.buffer());
   b->appendMsg(msg);
   networkModel()->updateBufferActivity(msg);
+
+  if(msg.type() == Message::Plain || msg.type() == Message::Notice || msg.type() == Message::Action) {
+    QString sender = msg.buffer().network() + ":" + msg.buffer().buffer() + ":" + msg.sender();
+    Message mmsg = Message(msg.timestamp(), msg.buffer(), msg.type(), msg.text(), sender, msg.flags());
+    monitorBuffer()->appendMsg(mmsg);
+  }
+
 }
 
 void Client::recvStatusMsg(QString /*net*/, QString /*msg*/) {