ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/src/channel.c
(Generate patch)

Comparing ircd-hybrid/trunk/src/channel.c (file contents):
Revision 3144 by michael, Wed Mar 12 20:02:20 2014 UTC vs.
Revision 3215 by michael, Tue Mar 25 19:23:15 2014 UTC

# Line 50 | Line 50 | static mp_pool_t *member_pool = NULL;
50   static mp_pool_t *channel_pool = NULL;
51  
52   static char buf[IRCD_BUFSIZE];
53 static char modebuf[MODEBUFLEN];
54 static char parabuf[MODEBUFLEN];
53  
54  
55   /*! \brief Initializes the channel blockheap, adds known channel CAPAB
# Line 149 | Line 147 | remove_user_from_channel(struct Membersh
147   */
148   static void
149   send_members(struct Client *client_p, struct Channel *chptr,
150 <             char *lmodebuf, char *lparabuf)
150 >             char *modebuf, char *parabuf)
151   {
152    const dlink_node *ptr = NULL;
153    int tlen;              /* length of text to append */
154    char *t, *start;       /* temp char pointer */
155  
156    start = t = buf + snprintf(buf, sizeof(buf), ":%s SJOIN %lu %s %s %s:",
157 <                             ID_or_name(&me, client_p),
158 <                             (unsigned long)chptr->channelts,
161 <                             chptr->chname, lmodebuf, lparabuf);
157 >                             me.id, (unsigned long)chptr->channelts,
158 >                             chptr->chname, modebuf, parabuf);
159  
160    DLINK_FOREACH(ptr, chptr->members.head)
161    {
162      const struct Membership *ms = ptr->data;
163  
164 <    tlen = strlen(ID(ms->client_p)) + 1;  /* nick + space */
164 >    tlen = strlen(ms->client_p->id) + 1;  /* nick + space */
165  
166      if (ms->flags & CHFL_CHANOP)
167        tlen++;
# Line 192 | Line 189 | send_members(struct Client *client_p, st
189      if (ms->flags & CHFL_VOICE)
190        *t++ = '+';
191  
192 <    strcpy(t, ID(ms->client_p));
192 >    strcpy(t, ms->client_p->id);
193  
194      t += strlen(t);
195      *t++ = ' ';
# Line 216 | Line 213 | send_mode_list(struct Client *client_p,
213                 const dlink_list *top, char flag)
214   {
215    const dlink_node *lp = NULL;
216 <  char pbuf[IRCD_BUFSIZE];
216 >  char pbuf[IRCD_BUFSIZE] = "";
217    int tlen, mlen, cur_len, count = 0;
218    char *pp = pbuf;
219  
220 <  if (top == NULL || top->length == 0)
220 >  if (top->length == 0)
221      return;
222  
223    mlen = snprintf(buf, sizeof(buf), ":%s BMASK %lu %s %c :", me.id,
# Line 265 | Line 262 | send_mode_list(struct Client *client_p,
262   void
263   send_channel_modes(struct Client *client_p, struct Channel *chptr)
264   {
265 <  *modebuf = *parabuf = '\0';
265 >  char modebuf[MODEBUFLEN] = "";
266 >  char parabuf[MODEBUFLEN] = "";
267 >
268    channel_modes(chptr, client_p, modebuf, parabuf);
269    send_members(client_p, chptr, modebuf, parabuf);
270  
# Line 410 | Line 409 | channel_member_names(struct Client *sour
409                       int show_eon)
410   {
411    const dlink_node *ptr = NULL;
412 <  char lbuf[IRCD_BUFSIZE + 1];
412 >  char lbuf[IRCD_BUFSIZE + 1] = "";
413    char *t = NULL, *start = NULL;
414    int tlen = 0;
415    int is_member = IsMember(source_p, chptr);
# Line 468 | Line 467 | channel_member_names(struct Client *sour
467                       ms->client_p->host);
468      }
469  
470 <    if (tlen != 0)
470 >    if (tlen)
471      {
472        *(t - 1) = '\0';
473        sendto_one(source_p, "%s", lbuf);
# Line 658 | Line 657 | can_join(struct Client *source_p, struct
657   int
658   has_member_flags(const struct Membership *ms, const unsigned int flags)
659   {
660 <  if (ms != NULL)
662 <    return ms->flags & flags;
663 <  return 0;
660 >  return ms && (ms->flags & flags);
661   }
662  
663   struct Membership *
# Line 834 | Line 831 | check_spambot_warning(struct Client *sou
831        }
832      }
833  
834 <    if (name != NULL)
834 >    if (name)
835        source_p->localClient->last_join_time = CurrentTime;
836      else
837        source_p->localClient->last_leave_time = CurrentTime;

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)