summaryrefslogtreecommitdiff
path: root/src/channels.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-03-21 15:54:15 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-03-21 15:54:15 +0000
commit9855300460b2e695b44646897811cc3f28428fa0 (patch)
treeb4f7c90b973d731257c2a9b2606706d2d2c417dd /src/channels.cpp
parent6cfed50a536c385f3589852ae85b9b220da4b309 (diff)
Add support for OnNamesListItem, discussed with w00t a few days ago. This makes NAMESX etc a LOT cleaner and safer.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9140 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/channels.cpp')
-rw-r--r--src/channels.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/channels.cpp b/src/channels.cpp
index c90a8f4e5..a0c9a0304 100644
--- a/src/channels.cpp
+++ b/src/channels.cpp
@@ -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;