summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-05-05 12:42:20 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-05-05 12:42:20 +0000
commitf938b078f8e283f52a4be36da584ee001030a247 (patch)
tree38bde4cfb369dcc9edc16a5008997e278d766ee5 /src
parent31900d8083615e8d3af2317410360fdaa75eba56 (diff)
Fixes to:
+s and +p channels wouldn't be synched correctly +s and +p never show in whois even when you're a member of them +s and +p never show in list even if you're a member of them git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1308 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/commands.cpp8
-rw-r--r--src/inspircd.cpp2
-rw-r--r--src/message.cpp5
3 files changed, 9 insertions, 6 deletions
diff --git a/src/commands.cpp b/src/commands.cpp
index 6cda474ac..97ce3420c 100644
--- a/src/commands.cpp
+++ b/src/commands.cpp
@@ -862,9 +862,10 @@ void handle_whois(char **parameters, int pcnt, userrec *user)
{
WriteServ(user->fd,"378 %s %s :is connecting from *@%s",user->nick, dest->nick, dest->host);
}
- if (strcmp(chlist(dest),""))
+ char* cl = chlist(dest,user);
+ if (strcmp(cl,""))
{
- WriteServ(user->fd,"319 %s %s :%s",user->nick, dest->nick, chlist(dest));
+ WriteServ(user->fd,"319 %s %s :%s",user->nick, dest->nick, cl);
}
WriteServ(user->fd,"312 %s %s %s :%s",user->nick, dest->nick, dest->server, GetServerDescription(dest->server).c_str());
if (strcmp(dest->awaymsg,""))
@@ -1087,7 +1088,8 @@ void handle_list(char **parameters, int pcnt, userrec *user)
WriteServ(user->fd,"321 %s Channel :Users Name",user->nick);
for (chan_hash::const_iterator i = chanlist.begin(); i != chanlist.end(); i++)
{
- if ((!i->second->c_private) && (!i->second->secret))
+ // if the channel is not private/secret, OR the user is on the channel anyway
+ if (((!i->second->c_private) && (!i->second->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);
}
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index 937354837..ecfb5539e 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -3534,7 +3534,7 @@ void DoSync(serverrec* serv, char* tcp_host)
serv->SendPacket(data,tcp_host);
}
}
- char* chl = chlist(u->second);
+ char* chl = chlist(u->second,u->second);
if (strcmp(chl,""))
{
snprintf(data,MAXBUF,"J %s %s",u->second->nick,chl);
diff --git a/src/message.cpp b/src/message.cpp
index c90793090..59e961d9a 100644
--- a/src/message.cpp
+++ b/src/message.cpp
@@ -463,7 +463,7 @@ void TidyBan(char *ban)
char lst[MAXBUF];
-char* chlist(userrec *user)
+char* chlist(userrec *user,userrec* source)
{
char cmp[MAXBUF];
log(DEBUG,"chlist: %s",user->nick);
@@ -482,7 +482,8 @@ char* chlist(userrec *user)
strlcat(cmp," ",MAXBUF);
if (!strstr(lst,cmp))
{
- if ((!user->chans[i].channel->c_private) && (!user->chans[i].channel->secret))
+ // if the channel is NOT private/secret, OR the source user is on the channel
+ if (((!user->chans[i].channel->c_private) && (!user->chans[i].channel->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);