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

Comparing:
ircd-hybrid-8/modules/m_userhost.c (file contents), Revision 1243 by michael, Fri Sep 30 10:47:53 2011 UTC vs.
ircd-hybrid/trunk/modules/m_userhost.c (file contents), Revision 1832 by michael, Fri Apr 19 19:16:09 2013 UTC

# Line 29 | Line 29
29   #include "s_serv.h"
30   #include "send.h"
31   #include "irc_string.h"
32 – #include "sprintf_irc.h"
32   #include "parse.h"
33   #include "modules.h"
34  
# Line 51 | Line 50 | m_userhost(struct Client *client_p, stru
50    int cur_len;
51    int rl;
52  
53 <  cur_len = snprintf(buf, sizeof(buf), form_str(RPL_USERHOST), me.name, source_p->name, "");
53 >  cur_len = snprintf(buf, sizeof(buf), RPL_USERHOST, me.name, source_p->name, "");
54    t = buf + cur_len;
55  
56    for (nick = strtoken(&p, parv[1], " "); nick && i++ < 5;
# Line 67 | Line 66 | m_userhost(struct Client *client_p, stru
66         */
67        if (MyClient(target_p) && (target_p == source_p))
68        {
69 <        rl = ircsprintf(response, "%s%s=%c%s@%s ",
70 <                        target_p->name,
71 <                        HasUMode(target_p, UMODE_OPER) ? "*" : "",
72 <                        (target_p->away) ? '-' : '+',
73 <                        target_p->username,
74 <                        target_p->sockhost);
69 >        rl = sprintf(response, "%s%s=%c%s@%s ",
70 >                     target_p->name,
71 >                     HasUMode(target_p, UMODE_OPER) ? "*" : "",
72 >                     (target_p->away[0]) ? '-' : '+',
73 >                     target_p->username,
74 >                     target_p->sockhost);
75        }
76        else
77        {
78 <        rl = ircsprintf(response, "%s%s=%c%s@%s ",
79 <                        target_p->name,
80 <                        HasUMode(target_p, UMODE_OPER) ? "*" : "",
81 <                        (target_p->away) ? '-' : '+',
82 <                        target_p->username,
83 <                        target_p->host);
78 >        rl = sprintf(response, "%s%s=%c%s@%s ",
79 >                     target_p->name, (HasUMode(target_p, UMODE_OPER) &&
80 >                                      (!HasUMode(target_p, UMODE_HIDDEN) ||
81 >                                        HasUMode(source_p, UMODE_OPER))) ? "*" : "",
82 >                     (target_p->away[0]) ? '-' : '+',
83 >                     target_p->username,
84 >                     target_p->host);
85        }
86  
87        if ((rl + cur_len) < (IRCD_BUFSIZE - 10))
88        {
89 <        ircsprintf(t, "%s", response);
89 >        sprintf(t, "%s", response);
90          t += rl;
91          cur_len += rl;
92        }
# Line 99 | Line 99 | m_userhost(struct Client *client_p, stru
99   }
100  
101   static struct Message userhost_msgtab = {
102 <  "USERHOST", 0, 0, 1, 1, MFLG_SLOW, 0,
102 >  "USERHOST", 0, 0, 2, 1, MFLG_SLOW, 0,
103    {m_unregistered, m_userhost, m_userhost, m_ignore, m_userhost, m_ignore}
104   };
105  

Diff Legend

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