QHash<QString, IrcUser *>::iterator ircUserIter = _ircUsers.begin();
while(ircUserIter != _ircUsers.end()) {
if(ircUser == *ircUserIter) {
+ emit deletedIrcUserRemoved(ircUserIter.key());
ircUserIter = _ircUsers.erase(ircUserIter);
break;
}
}
}
+void Network::removeDeletedIrcUser(const QString &username) {
+ // DO NOT CALL THIS SLOT EVER!!!
+
+ // this slots purpose is only to remove deleted users that haven't been synced yet.
+ // Reason:
+ // as a user parting a channel results in it's deletion if it is no longer in any known channel
+ // this action can only be communicated if the slaves are allready in sync.
+ // so if such a deleted user isn't synced in slave mode, we kill and remove it.
+
+ Q_ASSERT(proxy());
+
+ if(!_ircUsers.contains(username))
+ return;
+
+ IrcUser *ircUser = _ircUsers[username];
+
+ if(ircUser->isInitialized())
+ return;
+
+ _ircUsers.remove(username);
+ emit ircUserRemoved(username);
+ emit ircUserRemoved(ircUser);
+}
+
void Network::removeIrcUser(IrcUser *ircuser) {
QString nick = _ircUsers.key(ircuser);
if(nick.isNull())
inline void addIrcUser(const QString &hostmask) { newIrcUser(hostmask); }
inline void addIrcChannel(const QString &channel) { newIrcChannel(channel); }
+ void removeDeletedIrcUser(const QString &username);
void removeIrcUser(const QString &nick);
void removeIrcChannel(const QString &channel);
void ircChannelAdded(const QString &channelname);
void ircChannelAdded(IrcChannel *);
+ void deletedIrcUserRemoved(const QString &username);
void ircUserRemoved(const QString &nick);
void ircChannelRemoved(const QString &channel);