diff options
| author | 2005-12-13 17:18:27 +0000 | |
|---|---|---|
| committer | 2005-12-13 17:18:27 +0000 | |
| commit | 106d2fc72534d5f3ed3a4cfd776371482565e7a5 (patch) | |
| tree | 9c4adbb2c9e266dc716875f5fae8b9e89aa1ea03 /src/message.cpp | |
| parent | Forward declared ForceChan (diff) | |
Modified chlist() and whois to allow output of multi line channel membership list (!)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2373 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/message.cpp')
| -rw-r--r-- | src/message.cpp | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/src/message.cpp b/src/message.cpp index 79ea41f19..f55df0ee3 100644 --- a/src/message.cpp +++ b/src/message.cpp @@ -427,11 +427,11 @@ void TidyBan(char *ban) char lst[MAXBUF]; -char* chlist(userrec *user,userrec* source) +std::string chlist(userrec *user,userrec* source) { - char cmp[MAXBUF]; + std::string cmp = ""; + std::string lst = ""; log(DEBUG,"chlist: %s",user->nick); - strcpy(lst,""); if (!user) { return lst; @@ -442,27 +442,18 @@ char* chlist(userrec *user,userrec* source) { if (user->chans[i].channel->name) { - strlcpy(cmp,user->chans[i].channel->name,MAXBUF); - strlcat(cmp," ",MAXBUF); - if (!strstr(lst,cmp)) + cmp = std::string(user->chans[i].channel->name) + " "; + if (!strstr(lst.c_str(),cmp.c_str())) { // if the channel is NOT private/secret, OR the source user is on the channel if (((!(user->chans[i].channel->binarymodes & CM_PRIVATE)) && (!(user->chans[i].channel->binarymodes & CM_SECRET))) || (has_channel(source,user->chans[i].channel))) { - strlcat(lst,cmode(user,user->chans[i].channel),MAXBUF); - strlcat(lst,user->chans[i].channel->name,MAXBUF); - strlcat(lst," ",MAXBUF); + lst = lst + std::string(cmode(user,user->chans[i].channel)) + std::string(user->chans[i].channel->name) + " "; } } } } } - if (strlen(lst)) - { - lst[strlen(lst)-1] = '\0'; // chop trailing space - } return lst; } - - |
