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

Comparing ircd-hybrid/trunk/src/user.c (file contents):
Revision 7570 by michael, Tue May 24 16:29:23 2016 UTC vs.
Revision 7599 by michael, Mon Jun 13 18:56:33 2016 UTC

# Line 213 | Line 213 | introduce_client(struct Client *source_p
213    dlink_node *node = NULL;
214    char ubuf[IRCD_BUFSIZE] = "";
215  
216 <  if (MyConnect(source_p))
217 <    send_umode(source_p, source_p, 0, ubuf);
218 <  else
219 <    send_umode(NULL, source_p, 0, ubuf);
220 <
216 >  send_umode(source_p, MyConnect(source_p), 0, ubuf);
217    watch_check_hash(source_p, RPL_LOGON);
218  
219    if (ubuf[0] == '\0')
# Line 660 | Line 656 | valid_nickname(const char *nickname, con
656    return p - nickname <= NICKLEN;
657   }
658  
659 < /* send_umode()
660 < * send the MODE string for user (user) to connection client_p
661 < * -avalon
662 < *
663 < * inputs       - client_p
668 < *              - source_p
669 < *              - int old
670 < *              - suplied umode_buf
671 < * output       - NONE
659 > /*! \brief Builds a mode change string to buffer pointed by \a buf
660 > * \param client_p  Pointer to client
661 > * \param send      Whether to send a MODE message to client_p
662 > * \param old       Old user mode to compare against when building new mode buffer
663 > * \param buf       Pointer to buffer to build string in
664   */
665   void
666 < send_umode(struct Client *client_p, struct Client *source_p,
667 <           unsigned int old, char *umode_buf)
666 > send_umode(struct Client *client_p, unsigned int send,
667 >           unsigned int old, char *buf)
668   {
669 <  char *m = umode_buf;
669 >  char *m = buf;
670    int what = 0;
671  
672    /*
# Line 683 | Line 675 | send_umode(struct Client *client_p, stru
675     */
676    for (const struct user_modes *tab = umode_tab; tab->c; ++tab)
677    {
678 <    if ((tab->flag & old) && !HasUMode(source_p, tab->flag))
678 >    if ((tab->flag & old) && !HasUMode(client_p, tab->flag))
679      {
680        if (what == MODE_DEL)
681          *m++ = tab->c;
# Line 694 | Line 686 | send_umode(struct Client *client_p, stru
686          *m++ = tab->c;
687        }
688      }
689 <    else if (!(tab->flag & old) && HasUMode(source_p, tab->flag))
689 >    else if (!(tab->flag & old) && HasUMode(client_p, tab->flag))
690      {
691        if (what == MODE_ADD)
692          *m++ = tab->c;
# Line 709 | Line 701 | send_umode(struct Client *client_p, stru
701  
702    *m = '\0';
703  
704 <  if (*umode_buf && client_p)
704 >  if (send && *buf)
705      sendto_one(client_p, ":%s!%s@%s MODE %s :%s",
706                 client_p->name, client_p->username,
707 <               client_p->host, client_p->name, umode_buf);
707 >               client_p->host, client_p->name, buf);
708   }
709  
710   /* send_umode_out()
# Line 726 | Line 718 | send_umode_out(struct Client *source_p,
718   {
719    char buf[IRCD_BUFSIZE] = "";
720  
721 <  send_umode(MyClient(source_p) ? source_p : NULL, source_p, old, buf);
721 >  send_umode(source_p, MyClient(source_p), old, buf);
722  
723    if (buf[0])
724      sendto_server(source_p, 0, 0, ":%s MODE %s :%s",

Diff Legend

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