diff options
-rw-r--r-- | src/modules/m_watch.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
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<userrec*>::iterator n = new_online->second.begin(); n != new_online->second.end(); n++) + for (std::deque<userrec*>::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<userrec*>::iterator n = new_offline->second.begin(); n != new_offline->second.end(); n++) + for (std::deque<userrec*>::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()); } } } |