X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fngircd%2Firc-channel.c;h=a37fca96adabd7243b6302f7b6327d6aa6f428f1;hb=1d08d51e2eaff14b71f20d3f0898d5a86582b7e5;hp=a02f85c7373d8b0be145e78673b3ff9cce9f5e2a;hpb=cb76d96efb78ca7bdb884ce3327680614ed31940;p=ngircd-alex.git diff --git a/src/ngircd/irc-channel.c b/src/ngircd/irc-channel.c index a02f85c7..a37fca96 100644 --- a/src/ngircd/irc-channel.c +++ b/src/ngircd/irc-channel.c @@ -14,7 +14,7 @@ #include "portab.h" -static char UNUSED id[] = "$Id: irc-channel.c,v 1.26 2004/03/11 22:16:31 alex Exp $"; +static char UNUSED id[] = "$Id: irc-channel.c,v 1.28 2005/03/02 16:35:11 alex Exp $"; #include "imp.h" #include @@ -86,7 +86,7 @@ IRC_JOIN( CLIENT *Client, REQUEST *Req ) } } - /* Lokaler Client? */ + /* Local client? */ if( Client_Type( Client ) == CLIENT_USER ) { /* Test if the user has reached his maximum channel count */ @@ -159,6 +159,16 @@ IRC_JOIN( CLIENT *Client, REQUEST *Req ) } } } + else + { + /* Remote server: we don't need to know whether the + * client is invited or not, but we have to make sure + * that the "one shot" entries (generated by INVITE + * commands) in this list become deleted when a user + * joins a channel this way. */ + chan = Channel_Search( channame ); + if( chan != NULL ) (VOID)Lists_CheckInvited( target, chan ); + } /* Channel joinen (und ggf. anlegen) */ if( ! Channel_Join( target, channame )) @@ -339,15 +349,19 @@ IRC_LIST( CLIENT *Client, REQUEST *Req ) while( pattern ) { - /* alle Channel durchgehen */ + /* Loop through all the channels */ chan = Channel_First( ); while( chan ) { - /* Passt die Suchmaske auf diesen Channel? */ + /* Check search pattern */ if( Match( pattern, Channel_Name( chan ))) { - /* Treffer! */ - if( ! IRC_WriteStrClient( from, RPL_LIST_MSG, from, Channel_Name( chan ), Channel_MemberCount( chan ), Channel_Topic( chan ))) return DISCONNECTED; + /* Gotcha! */ + if( ! strchr( Channel_Modes( chan ), 's' ) || + Channel_IsMemberOf( chan, from )) + { + if( ! IRC_WriteStrClient( from, RPL_LIST_MSG, from, Channel_Name( chan ), Channel_MemberCount( chan ), Channel_Topic( chan ))) return DISCONNECTED; + } } chan = Channel_Next( chan ); }