/[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 486 by michael, Fri Feb 3 15:50:47 2006 UTC revision 487 by michael, Wed Mar 1 10:54:20 2006 UTC
# Line 53  struct entity Line 53  struct entity
53  static struct entity targets[IRCD_BUFSIZE];  static struct entity targets[IRCD_BUFSIZE];
54  static int ntargets, join_0;  static int ntargets, join_0;
55    
56  static int build_target_list(struct Client *, struct Client *, char *, char *);  static int build_target_list(struct Client *, char *, char *);
57  static int is_target(struct Channel *);  static int is_target(struct Channel *);
58    
59  static void m_join(struct Client *, struct Client *, int, char **);  static void m_join(struct Client *, struct Client *, int, char **);
# Line 104  m_join(struct Client *client_p, struct C Line 104  m_join(struct Client *client_p, struct C
104    char *key = NULL;    char *key = NULL;
105    int i, a;    int i, a;
106    unsigned int flags = 0;    unsigned int flags = 0;
   int successful_join_count = 0; /* Number of channels successfully joined */  
107    
108    if (*parv[1] == '\0')    if (*parv[1] == '\0')
109    {    {
# Line 113  m_join(struct Client *client_p, struct C Line 112  m_join(struct Client *client_p, struct C
112      return;      return;
113    }    }
114    
115    build_target_list(client_p, source_p, parv[1], ((parc > 2) ? parv[2] : NULL));    assert(client_p == source_p);
116    
117      build_target_list(source_p, parv[1], parv[2]);
118    
119    if ((a = (join_0 >= 0) ? join_0 : 0))    if ((a = (join_0 >= 0) ? join_0 : 0))
120      do_join_0(client_p, source_p);      do_join_0(client_p, source_p);
# Line 139  m_join(struct Client *client_p, struct C Line 140  m_join(struct Client *client_p, struct C
140        continue;        continue;
141      }      }
142    
     ++successful_join_count;  
   
143      /* add the user to the channel */      /* add the user to the channel */
144      add_user_to_channel(chptr, source_p, flags, YES);      add_user_to_channel(chptr, source_p, flags, YES);
145    
# Line 205  m_join(struct Client *client_p, struct C Line 204  m_join(struct Client *client_p, struct C
204    
205      channel_member_names(source_p, chptr, 1);      channel_member_names(source_p, chptr, 1);
206    
207      if (successful_join_count != 0)      source_p->localClient->last_join_time = CurrentTime;
       source_p->localClient->last_join_time = CurrentTime;  
208    }    }
209  }  }
210    
# Line 446  do_join_0(struct Client *client_p, struc Line 444  do_join_0(struct Client *client_p, struc
444   *   *
445   */   */
446  static int  static int
447  build_target_list(struct Client *client_p, struct Client *source_p,  build_target_list(struct Client *source_p, char *channels, char *keys)
                   char *channels, char *keys)  
448  {  {
449    int error_reported, flags = 0;    int error_reported = 0, flags = 0;
450    char *p, *p2, *chan, *key = keys;    char *p = NULL, *p2 = NULL, *chan, *key = keys;
451    struct Channel *chptr = NULL;    struct Channel *chptr = NULL;
452    
453    ntargets = error_reported = 0;    ntargets = 0;
454    join_0 = -1;    join_0 = -1;
455    
456      key = key ? strtoken(&p2, keys, ",") : NULL;
457    
458    for (chan = strtoken(&p, channels, ","); chan;    for (chan = strtoken(&p, channels, ","); chan;
459         key  = (key) ? strtoken(&p2, keys, ",") : NULL,         key  = key ? strtoken(&p2, NULL, ",") : NULL,
460         chan = strtoken(&p, NULL, ","))         chan = strtoken(&p, NULL, ","))
461    {    {
462      if (!check_channel_name(chan))      if (!check_channel_name(chan))

Legend:
Removed from v.486  
changed lines
  Added in v.487

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