/[svn]/ircd-hybrid-7.2/modules/core/m_join.c
ViewVC logotype

Diff of /ircd-hybrid-7.2/modules/core/m_join.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 893 by michael, Wed Oct 31 18:09:24 2007 UTC revision 894 by michael, Fri Nov 2 10:55:01 2007 UTC
# Line 28  Line 28 
28  #include "channel.h"  #include "channel.h"
29  #include "channel_mode.h"  #include "channel_mode.h"
30  #include "client.h"  #include "client.h"
 #include "common.h"   /* bleah */  
31  #include "hash.h"  #include "hash.h"
32  #include "irc_string.h"  #include "irc_string.h"
33  #include "sprintf_irc.h"  #include "sprintf_irc.h"
# Line 43  Line 42 
42  #include "modules.h"  #include "modules.h"
43    
44    
45  static void m_join(struct Client *, struct Client *, int, char **);  static void m_join(struct Client *, struct Client *, int, char *[]);
46  static void ms_join(struct Client *, struct Client *, int, char **);  static void ms_join(struct Client *, struct Client *, int, char *[]);
47  static void do_join_0(struct Client *client_p, struct Client *source_p);  static void do_join_0(struct Client *, struct Client *);
48    
49  static void set_final_mode(struct Mode *, struct Mode *);  static void set_final_mode(struct Mode *, struct Mode *);
50  static void remove_our_modes(struct Channel *, struct Client *);  static void remove_our_modes(struct Channel *, struct Client *);
# Line 58  static char *mbuf; Line 57  static char *mbuf;
57    
58  struct Message join_msgtab = {  struct Message join_msgtab = {
59    "JOIN", 0, 0, 2, 0, MFLG_SLOW, 0,    "JOIN", 0, 0, 2, 0, MFLG_SLOW, 0,
60    {m_unregistered, m_join, ms_join, m_ignore, m_join, m_ignore}    { m_unregistered, m_join, ms_join, m_ignore, m_join, m_ignore }
61  };  };
62    
63  #ifndef STATIC_MODULES  #ifndef STATIC_MODULES
# Line 201  m_join(struct Client *client_p, struct C Line 200  m_join(struct Client *client_p, struct C
200        }        }
201    
202        /*        /*
203           * can_join checks for +i key, bans.
204           */
205          if ((i = can_join(source_p, chptr, key)))
206          {
207            sendto_one(source_p, form_str(i), me.name,
208                       source_p->name, chptr->chname);
209            continue;
210          }
211    
212          /*
213         * This should never be the case unless there is some sort of         * This should never be the case unless there is some sort of
214         * persistant channels.         * persistant channels.
215         */         */
# Line 226  m_join(struct Client *client_p, struct C Line 235  m_join(struct Client *client_p, struct C
235      if (!IsOper(source_p))      if (!IsOper(source_p))
236        check_spambot_warning(source_p, chptr->chname);        check_spambot_warning(source_p, chptr->chname);
237    
238      /*      add_user_to_channel(chptr, source_p, flags, 1);
      * can_join checks for +i key, bans.  
      */  
     if ((i = can_join(source_p, chptr, key)))  
     {  
       sendto_one(source_p, form_str(i), me.name,  
                  source_p->name, chptr->chname);  
       continue;  
     }  
   
     add_user_to_channel(chptr, source_p, flags, YES);  
239    
240      /*      /*
241       *  Set timestamp if appropriate, and propagate       *  Set timestamp if appropriate, and propagate
# Line 258  m_join(struct Client *client_p, struct C Line 257  m_join(struct Client *client_p, struct C
257        /*        /*
258         * notify all other users on the new channel         * notify all other users on the new channel
259         */         */
260        sendto_channel_local(ALL_MEMBERS, NO, chptr, ":%s!%s@%s JOIN :%s",        sendto_channel_local(ALL_MEMBERS, 0, chptr, ":%s!%s@%s JOIN :%s",
261                             source_p->name, source_p->username,                             source_p->name, source_p->username,
262                             source_p->host, chptr->chname);                             source_p->host, chptr->chname);
263        sendto_channel_local(ALL_MEMBERS, NO, chptr, ":%s MODE %s +nt",        sendto_channel_local(ALL_MEMBERS, 0, chptr, ":%s MODE %s +nt",
264                             me.name, chptr->chname);                             me.name, chptr->chname);
265      }      }
266      else      else
# Line 275  m_join(struct Client *client_p, struct C Line 274  m_join(struct Client *client_p, struct C
274                      me.name, (unsigned long)chptr->channelts,                      me.name, (unsigned long)chptr->channelts,
275                      chptr->chname, source_p->name);                      chptr->chname, source_p->name);
276    
277        sendto_channel_local(ALL_MEMBERS, NO, chptr, ":%s!%s@%s JOIN :%s",        sendto_channel_local(ALL_MEMBERS, 0, chptr, ":%s!%s@%s JOIN :%s",
278                             source_p->name, source_p->username,                             source_p->name, source_p->username,
279                             source_p->host, chptr->chname);                             source_p->host, chptr->chname);
280      }      }
# Line 371  ms_join(struct Client *client_p, struct Line 370  ms_join(struct Client *client_p, struct
370    {    {
371      if (!newts && !isnew && oldts)      if (!newts && !isnew && oldts)
372      {      {
373        sendto_channel_local(ALL_MEMBERS, NO, chptr,        sendto_channel_local(ALL_MEMBERS, 0, chptr,
374                             ":%s NOTICE %s :*** Notice -- TS for %s changed from %lu to 0",                             ":%s NOTICE %s :*** Notice -- TS for %s changed from %lu to 0",
375                             me.name, chptr->chname, chptr->chname, (unsigned long)oldts);                             me.name, chptr->chname, chptr->chname, (unsigned long)oldts);
376        sendto_realops_flags(UMODE_ALL, L_ALL,        sendto_realops_flags(UMODE_ALL, L_ALL,
# Line 388  ms_join(struct Client *client_p, struct Line 387  ms_join(struct Client *client_p, struct
387      ;      ;
388    else if (newts < oldts)    else if (newts < oldts)
389    {    {
390      keep_our_modes = NO;      keep_our_modes = 0;
391      chptr->channelts = newts;      chptr->channelts = newts;
392    }    }
393    else    else
394      keep_new_modes = NO;      keep_new_modes = 0;
395    
396    if (!keep_new_modes)    if (!keep_new_modes)
397      mode = *oldmode;      mode = *oldmode;
# Line 423  ms_join(struct Client *client_p, struct Line 422  ms_join(struct Client *client_p, struct
422                             me.name : source_p->name, chptr->chname);                             me.name : source_p->name, chptr->chname);
423      }      }
424    
425      sendto_channel_local(ALL_MEMBERS, NO, chptr,      sendto_channel_local(ALL_MEMBERS, 0, chptr,
426                           ":%s NOTICE %s :*** Notice -- TS for %s changed from %lu to %lu",                           ":%s NOTICE %s :*** Notice -- TS for %s changed from %lu to %lu",
427                            me.name, chptr->chname, chptr->chname,                            me.name, chptr->chname, chptr->chname,
428                           (unsigned long)oldts, (unsigned long)newts);                           (unsigned long)oldts, (unsigned long)newts);
# Line 442  ms_join(struct Client *client_p, struct Line 441  ms_join(struct Client *client_p, struct
441    
442    if (!IsMember(source_p, chptr))    if (!IsMember(source_p, chptr))
443    {    {
444      add_user_to_channel(chptr, source_p, 0, YES);      add_user_to_channel(chptr, source_p, 0, 1);
445      sendto_channel_local(ALL_MEMBERS, NO, chptr, ":%s!%s@%s JOIN :%s",      sendto_channel_local(ALL_MEMBERS, 0, chptr, ":%s!%s@%s JOIN :%s",
446                           source_p->name, source_p->username,                           source_p->name, source_p->username,
447                           source_p->host, chptr->chname);                           source_p->host, chptr->chname);
448    }    }
# Line 483  do_join_0(struct Client *client_p, struc Line 482  do_join_0(struct Client *client_p, struc
482                    ":%s PART %s", ID(source_p), chptr->chname);                    ":%s PART %s", ID(source_p), chptr->chname);
483      sendto_server(client_p, chptr, NOCAPS, CAP_TS6,      sendto_server(client_p, chptr, NOCAPS, CAP_TS6,
484                    ":%s PART %s", source_p->name, chptr->chname);                    ":%s PART %s", source_p->name, chptr->chname);
485      sendto_channel_local(ALL_MEMBERS, NO, chptr, ":%s!%s@%s PART %s",      sendto_channel_local(ALL_MEMBERS, 0, chptr, ":%s!%s@%s PART %s",
486                           source_p->name, source_p->username,                           source_p->name, source_p->username,
487                           source_p->host, chptr->chname);                           source_p->host, chptr->chname);
488    
# Line 664  remove_a_mode(struct Channel *chptr, str Line 663  remove_a_mode(struct Channel *chptr, str
663        }        }
664    
665        *mbuf = '\0';        *mbuf = '\0';
666        sendto_channel_local(ALL_MEMBERS, NO, chptr,        sendto_channel_local(ALL_MEMBERS, 0, chptr,
667                             ":%s MODE %s %s%s",                             ":%s MODE %s %s%s",
668                             (IsHidden(source_p) ||                             (IsHidden(source_p) ||
669                             ConfigServerHide.hide_servers) ?                             ConfigServerHide.hide_servers) ?
# Line 688  remove_a_mode(struct Channel *chptr, str Line 687  remove_a_mode(struct Channel *chptr, str
687        strlcat(sendbuf, " ", sizeof(sendbuf));        strlcat(sendbuf, " ", sizeof(sendbuf));
688        strlcat(sendbuf, lpara[lcount], sizeof(sendbuf));        strlcat(sendbuf, lpara[lcount], sizeof(sendbuf));
689      }      }
690      sendto_channel_local(ALL_MEMBERS, NO, chptr,      sendto_channel_local(ALL_MEMBERS, 0, chptr,
691                           ":%s MODE %s %s%s",                           ":%s MODE %s %s%s",
692                           (IsHidden(source_p) || ConfigServerHide.hide_servers) ?                           (IsHidden(source_p) || ConfigServerHide.hide_servers) ?
693                           me.name : source_p->name,                           me.name : source_p->name,

Legend:
Removed from v.893  
changed lines
  Added in v.894

svnadmin@ircd-hybrid.org
ViewVC Help
Powered by ViewVC 1.1.28