]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/channels.cpp
convert to new api
[user/henk/code/inspircd.git] / src / channels.cpp
index 793bfb4291761f22e048e6885e5719eccf887571..a0c9a030486d9e5fd04e6af9c341f6cd640e5605 100644 (file)
@@ -267,7 +267,7 @@ Channel* Channel::JoinUser(InspIRCd* Instance, User *user, const char* cn, bool
                if (!IS_LOCAL(user))
                {
                        if (!TS)
-                               Instance->Log(DEBUG,"*** BUG *** Channel::JoinUser called for REMOTE user '%s' on channel '%s' but no TS given!", user->nick, cn);
+                               Instance->Logs->Log("CHANNEL",DEBUG,"*** BUG *** Channel::JoinUser called for REMOTE user '%s' on channel '%s' but no TS given!", user->nick, cn);
                }
                else
                {
@@ -881,9 +881,15 @@ void Channel::UserList(User *user, CUList *ulist)
                if (i->first->Visibility && !i->first->Visibility->VisibleTo(user))
                        continue;
 
-               size_t ptrlen = snprintf(ptr, MAXBUF, "%s%s ", this->GetPrefixChar(i->first), i->second.c_str());
-               /* OnUserList can change this - reset it back to normal */
-               i->second = i->first->nick;
+               std::string prefixlist = this->GetPrefixChar(i->first);
+               std::string nick = i->first->nick;
+               FOREACH_MOD(I_OnNamesListItem, OnNamesListItem(user, i->first, this, prefixlist, nick));
+
+               /* Nick was nuked, a module wants us to skip it */
+               if (nick.empty())
+                       continue;
+               
+               size_t ptrlen = snprintf(ptr, MAXBUF, "%s%s ", prefixlist.c_str(), nick.c_str());
 
                curlen += ptrlen;
                ptr += ptrlen;