-void CoreSession::updateBufferInfo(UserId uid, const BufferInfo &bufinfo) {
- if(uid == user()) emit bufferInfoUpdated(bufinfo);
-}
-
-// FIXME remove
-void CoreSession::connectToNetwork(QString netname, const QVariant &previousState) {
- Network *net = 0;
- foreach(Network *n, _networks.values()) {
- if(n->networkName() == netname) {
- net = n; break;
- }
- }
- if(!net) {
- qWarning() << "Connect to unknown network requested, ignoring!";
- return;
- }
- connectToNetwork(net->networkId(), previousState);
-}
-
-void CoreSession::connectToNetwork(NetworkId id, const QVariant &previousState) {
- Network *net = network(id);
- if(!net) {
- qWarning() << "Connect to unknown network requested! net:" << id << "user:" << user();
- return;
- }
-
- NetworkConnection *conn = networkConnection(id);
- if(!conn) {
- conn = new NetworkConnection(net, this, previousState);
- _connections[id] = conn;
- attachNetworkConnection(conn);
- }
- conn->connectToIrc();
-}
-
-void CoreSession::attachNetworkConnection(NetworkConnection *conn) {
- connect(conn, SIGNAL(connected(NetworkId)), this, SLOT(networkConnected(NetworkId)));
- connect(conn, SIGNAL(disconnected(NetworkId)), this, SLOT(networkDisconnected(NetworkId)));
-
- // I guess we don't need these anymore, client-side can just connect the network's signals directly
- //signalProxy()->attachSignal(conn, SIGNAL(connected(NetworkId)), SIGNAL(networkConnected(NetworkId)));
- //signalProxy()->attachSignal(conn, SIGNAL(disconnected(NetworkId)), SIGNAL(networkDisconnected(NetworkId)));
-
- connect(conn, SIGNAL(displayMsg(Message::Type, BufferInfo::Type, QString, QString, QString, quint8)),
- this, SLOT(recvMessageFromServer(Message::Type, BufferInfo::Type, QString, QString, QString, quint8)));
- connect(conn, SIGNAL(displayStatusMsg(QString)), this, SLOT(recvStatusMsgFromServer(QString)));
-
-}
-
-void CoreSession::disconnectFromNetwork(NetworkId id) {
- if(!_connections.contains(id)) return;
- _connections[id]->disconnectFromIrc();
-}
-
-void CoreSession::networkStateRequested() {
-}
-
-void CoreSession::addClient(QObject *dev) { // this is QObject* so we can use it in signal connections
- QIODevice *device = qobject_cast<QIODevice *>(dev);