info.networkName = networkName();
info.networkId = networkId();
info.identity = identity();
+ info.codecForServer = codecForServer();
info.codecForEncoding = codecForEncoding();
info.codecForDecoding = codecForDecoding();
info.serverList = serverList();
info.useAutoReconnect = useAutoReconnect();
info.autoReconnectInterval = autoReconnectInterval();
info.autoReconnectRetries = autoReconnectRetries();
+ info.unlimitedReconnectRetries = unlimitedReconnectRetries();
info.rejoinChannels = rejoinChannels();
return info;
}
connect(ircuser, SIGNAL(nickSet(QString)), this, SLOT(ircUserNickChanged(QString)));
connect(ircuser, SIGNAL(initDone()), this, SLOT(ircUserInitDone()));
+ connect(ircuser, SIGNAL(destroyed()), this, SLOT(ircUserDestroyed()));
_ircUsers[nick] = ircuser;
emit ircUserAdded(hostmask);
emit ircUserAdded(ircuser);
return newIrcUser(decodeServerString(hostmask));
}
+void Network::ircUserDestroyed() {
+ IrcUser *ircUser = static_cast<IrcUser *>(sender());
+ if(!ircUser)
+ return;
+
+ QHash<QString, IrcUser *>::iterator ircUserIter = _ircUsers.begin();
+ while(ircUserIter != _ircUsers.end()) {
+ if(ircUser == *ircUserIter) {
+ ircUserIter = _ircUsers.erase(ircUserIter);
+ break;
+ }
+ ircUserIter++;
+ }
+}
+
void Network::removeIrcUser(IrcUser *ircuser) {
QString nick = _ircUsers.key(ircuser);
if(nick.isNull())
ircuser->deleteLater();
}
+void Network::removeIrcUser(const QString &nick) {
+ IrcUser *ircuser;
+ if((ircuser = ircUser(nick)) != 0)
+ removeIrcUser(ircuser);
+}
+
void Network::removeChansAndUsers() {
QList<IrcUser *> users = ircUsers();
foreach(IrcUser *user, users) {
}
}
-void Network::removeIrcUser(const QString &nick) {
- IrcUser *ircuser;
- if((ircuser = ircUser(nick)) != 0)
- removeIrcUser(ircuser);
-}
-
IrcUser *Network::ircUser(QString nickname) const {
nickname = nickname.toLower();
if(_ircUsers.contains(nickname))
}
}
-void Network::initSetChannels(const QStringList &channels) {
+void Network::initSetIrcChannels(const QStringList &channels) {
+ // FIXME This does not work correctly, "received data for unknown User" triggers
+ // So we disable this for now
+ return;
+
if(!_ircChannels.empty())
return;
foreach(QString channel, channels)
if(proxy()->proxyMode() == SignalProxy::Client) emit connectRequested(); // on the client this triggers calling this slot on the core
else {
if(connectionState() != Disconnected) {
- qWarning() << "Requesting connect while not being disconnected!";
+ qWarning() << "Requesting connect while already being connected!";
return;
}
emit connectRequested(networkId()); // and this is for CoreSession :)
return in;
}
-
-
-
-
-
+QDebug operator<<(QDebug dbg, const NetworkInfo &i) {
+ dbg.nospace() << "(id = " << i.networkId << " name = " << i.networkName << " identity = " << i.identity
+ << " codecForServer = " << i.codecForServer << " codecForEncoding = " << i.codecForEncoding << " codecForDecoding = " << i.codecForDecoding
+ << " serverList = " << i.serverList << " useRandomServer = " << i.useRandomServer << " perform = " << i.perform
+ << " useAutoIdentify = " << i.useAutoIdentify << " autoIdentifyService = " << i.autoIdentifyService << " autoIdentifyPassword = " << i.autoIdentifyPassword
+ << " useAutoReconnect = " << i.useAutoReconnect << " autoReconnectInterval = " << i.autoReconnectInterval
+ << " autoReconnectRetries = " << i.autoReconnectRetries << " unlimitedReconnectRetries = " << i.unlimitedReconnectRetries
+ << " rejoinChannels = " << i.rejoinChannels << ")";
+ return dbg.space();
+}