+ const Network *previousNet = Client::network(_networkId);
+ if(previousNet) {
+ disconnect(previousNet, 0, this, 0);
+ if(previousNet->me())
+ disconnect(previousNet->me(), 0, this, 0);
+ }
+
+ if(network) {
+ _networkId = network->networkId();
+ connect(network, SIGNAL(identitySet(IdentityId)), this, SLOT(setIdentity(IdentityId)));
+ if(network->me()) {
+ connect(network->me(), SIGNAL(nickSet(QString)), this, SLOT(updateNickSelector()));
+ connect(network->me(), SIGNAL(userModesSet(QString)), this, SLOT(updateNickSelector()));
+ connect(network->me(), SIGNAL(userModesAdded(QString)), this, SLOT(updateNickSelector()));
+ connect(network->me(), SIGNAL(userModesRemoved(QString)), this, SLOT(updateNickSelector()));
+ }
+ }
+ setIdentity(network->identity());