From 639a462ea42ee360c9aeeb96bd82ed90e978f204 Mon Sep 17 00:00:00 2001 From: special Date: Tue, 11 Sep 2007 02:55:44 +0000 Subject: Fixed the order of signon/signoff messages in m_watch (bug #410) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8023 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_watch.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/modules/m_watch.cpp b/src/modules/m_watch.cpp index 12dda102b..caad37049 100644 --- a/src/modules/m_watch.cpp +++ b/src/modules/m_watch.cpp @@ -416,33 +416,33 @@ class Modulewatch : public Module virtual void OnUserPostNick(userrec* user, const std::string &oldnick) { - watchentries::iterator new_online = whos_watching_me->find(user->nick); watchentries::iterator new_offline = whos_watching_me->find(assign(oldnick)); + watchentries::iterator new_online = whos_watching_me->find(user->nick); - if (new_online != whos_watching_me->end()) + if (new_offline != whos_watching_me->end()) { - for (std::deque::iterator n = new_online->second.begin(); n != new_online->second.end(); n++) + for (std::deque::iterator n = new_offline->second.begin(); n != new_offline->second.end(); n++) { watchlist* wl; if ((*n)->GetExt("watchlist", wl)) { - (*wl)[user->nick] = std::string(user->ident).append(" ").append(user->dhost).append(" ").append(ConvToStr(user->age)); if (!user->Visibility || user->Visibility->VisibleTo(user)) - (*n)->WriteServ("600 %s %s %s :arrived online", (*n)->nick, user->nick, (*wl)[user->nick].c_str()); + (*n)->WriteServ("601 %s %s %s %s %lu :went offline", (*n)->nick, oldnick.c_str(), user->ident, user->dhost, user->age); + (*wl)[oldnick.c_str()] = ""; } } } - if (new_offline != whos_watching_me->end()) + if (new_online != whos_watching_me->end()) { - for (std::deque::iterator n = new_offline->second.begin(); n != new_offline->second.end(); n++) + for (std::deque::iterator n = new_online->second.begin(); n != new_online->second.end(); n++) { watchlist* wl; if ((*n)->GetExt("watchlist", wl)) { + (*wl)[user->nick] = std::string(user->ident).append(" ").append(user->dhost).append(" ").append(ConvToStr(user->age)); if (!user->Visibility || user->Visibility->VisibleTo(user)) - (*n)->WriteServ("601 %s %s %s %s %lu :went offline", (*n)->nick, oldnick.c_str(), user->ident, user->dhost, user->age); - (*wl)[oldnick.c_str()] = ""; + (*n)->WriteServ("600 %s %s %s :arrived online", (*n)->nick, user->nick, (*wl)[user->nick].c_str()); } } } -- cgit v1.2.3