summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cmd_list.cpp2
-rw-r--r--src/helperfuncs.cpp6
-rw-r--r--src/mode.cpp2
-rw-r--r--src/modules/m_spanningtree.cpp2
4 files changed, 7 insertions, 5 deletions
diff --git a/src/cmd_list.cpp b/src/cmd_list.cpp
index 8d7756683..262738fb3 100644
--- a/src/cmd_list.cpp
+++ b/src/cmd_list.cpp
@@ -48,7 +48,7 @@ void cmd_list::Handle (char **parameters, int pcnt, userrec *user)
// if the channel is not private/secret, OR the user is on the channel anyway
if (((!(i->second->binarymodes & CM_PRIVATE)) && (!(i->second->binarymodes & CM_SECRET))) || (has_channel(user,i->second)))
{
- WriteServ(user->fd,"322 %s %s %d :[+%s] %s",user->nick,i->second->name,usercount_i(i->second),chanmodes(i->second),i->second->topic);
+ WriteServ(user->fd,"322 %s %s %d :[+%s] %s",user->nick,i->second->name,usercount_i(i->second),chanmodes(i->second,has_channel(user,i->second)),i->second->topic);
}
}
WriteServ(user->fd,"323 %s :End of channel list.",user->nick);
diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp
index d76c708b2..922d2b7f6 100644
--- a/src/helperfuncs.cpp
+++ b/src/helperfuncs.cpp
@@ -1000,7 +1000,7 @@ void purge_empty_chans(userrec* u)
}
-char* chanmodes(chanrec *chan)
+char* chanmodes(chanrec *chan, bool showkey)
{
static char scratch[MAXBUF];
static char sparam[MAXBUF];
@@ -1032,7 +1032,9 @@ char* chanmodes(chanrec *chan)
if (chan->binarymodes & CM_PRIVATE)
*offset++ = 'p';
if (*chan->key)
- snprintf(sparam,MAXBUF," %s",chan->key);
+ {
+ snprintf(sparam,MAXBUF," %s",showkey ? chan->key : "<key>");
+ }
if (chan->limit)
{
char foo[24];
diff --git a/src/mode.cpp b/src/mode.cpp
index 4f7339bac..507e90bca 100644
--- a/src/mode.cpp
+++ b/src/mode.cpp
@@ -1436,7 +1436,7 @@ void cmd_mode::Handle (char **parameters, int pcnt, userrec *user)
if (pcnt == 1)
{
/* just /modes #channel */
- WriteServ(user->fd,"324 %s %s +%s",user->nick, Ptr->name, chanmodes(Ptr));
+ WriteServ(user->fd,"324 %s %s +%s",user->nick, Ptr->name, chanmodes(Ptr,has_channel(user,Ptr)));
WriteServ(user->fd,"329 %s %s %d", user->nick, Ptr->name, Ptr->created);
return;
}
diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp
index cdd4a1996..b081b1d4b 100644
--- a/src/modules/m_spanningtree.cpp
+++ b/src/modules/m_spanningtree.cpp
@@ -1179,7 +1179,7 @@ class TreeSocket : public InspSocket
for (chan_hash::iterator c = chanlist.begin(); c != chanlist.end(); c++)
{
SendFJoins(Current, c->second);
- snprintf(data,MAXBUF,":%s FMODE %s +%s",Srv->GetServerName().c_str(),c->second->name,chanmodes(c->second));
+ snprintf(data,MAXBUF,":%s FMODE %s +%s",Srv->GetServerName().c_str(),c->second->name,chanmodes(c->second,true));
this->WriteLine(data);
if (*c->second->topic)
{