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

Comparing ircd-hybrid/trunk/modules/m_svsmode.c (file contents):
Revision 3135 by michael, Mon Mar 10 21:11:25 2014 UTC vs.
Revision 3479 by michael, Sun May 4 16:49:06 2014 UTC

# Line 28 | Line 28
28   #include "stdinc.h"
29   #include "client.h"
30   #include "ircd.h"
31 < #include "s_serv.h"
31 > #include "server.h"
32   #include "send.h"
33   #include "channel_mode.h"
34   #include "parse.h"
35   #include "modules.h"
36   #include "irc_string.h"
37 < #include "s_user.h"
37 > #include "user.h"
38   #include "conf.h"
39  
40  
41 < /*! \brief SVSMODE command handler (called by services)
41 > /*! \brief SVSMODE command handler
42   *
43 – * \param client_p Pointer to allocated Client struct with physical connection
44 – *                 to this server, i.e. with an open socket connected.
43   * \param source_p Pointer to allocated Client struct from which the message
44   *                 originally comes from.  This can be a local or remote client.
45   * \param parc     Integer holding the number of supplied arguments.
# Line 55 | Line 53
53   *      - parv[4] = optional argument (services id)
54   */
55   static int
56 < ms_svsmode(struct Client *client_p, struct Client *source_p,
59 <           int parc, char *parv[])
56 > ms_svsmode(struct Client *source_p, int parc, char *parv[])
57   {
58    struct Client *target_p = NULL;
59    int what = MODE_ADD;
60    unsigned int flag = 0, setmodes = 0;
61 <  const char *m = NULL, *modes = NULL, *extarg = NULL;
61 >  const char *modes = NULL, *extarg = NULL;
62    time_t ts = 0;
63  
64    if (!HasFlag(source_p, FLAGS_SERVICE))
# Line 79 | Line 76 | ms_svsmode(struct Client *client_p, stru
76      extarg = (parc > 3) ? parv[3] : NULL;
77    }
78  
79 <  if ((target_p = find_person(client_p, parv[1])) == NULL)
79 >  if ((target_p = find_person(source_p, parv[1])) == NULL)
80      return 0;
81  
82    if (ts && (ts != target_p->tsinfo))
# Line 87 | Line 84 | ms_svsmode(struct Client *client_p, stru
84  
85    setmodes = target_p->umodes;
86  
87 <  for (m = modes; *m; ++m)
87 >  for (const char *m = modes; *m; ++m)
88    {
89      switch (*m)
90      {
# Line 112 | Line 109 | ms_svsmode(struct Client *client_p, stru
109          if (what == MODE_DEL && HasUMode(target_p, UMODE_OPER))
110          {
111            ClearOper(target_p);
112 <          Count.oper--;
112 >          --Count.oper;
113  
114            if (MyConnect(target_p))
115            {
# Line 162 | Line 159 | ms_svsmode(struct Client *client_p, stru
159    }
160  
161    if (extarg)
162 <    sendto_server(client_p, NOCAPS, NOCAPS, ":%s SVSMODE %s %lu %s %s",
163 <                  ID(source_p),
164 <                  ID(target_p), (unsigned long)target_p->tsinfo, modes, extarg);
162 >    sendto_server(source_p, NOCAPS, NOCAPS, ":%s SVSMODE %s %lu %s %s",
163 >                  source_p->id,
164 >                  target_p->id, (unsigned long)target_p->tsinfo, modes, extarg);
165    else
166 <    sendto_server(client_p, NOCAPS, NOCAPS, ":%s SVSMODE %s %lu %s",
167 <                  ID(source_p),
168 <                  ID(target_p), (unsigned long)target_p->tsinfo, modes);
166 >    sendto_server(source_p, NOCAPS, NOCAPS, ":%s SVSMODE %s %lu %s",
167 >                  source_p->id,
168 >                  target_p->id, (unsigned long)target_p->tsinfo, modes);
169  
170    if (MyConnect(target_p) && (setmodes != target_p->umodes))
171    {
172 <    char modebuf[IRCD_BUFSIZE];
172 >    char modebuf[IRCD_BUFSIZE] = "";
173  
174      send_umode(target_p, target_p, setmodes, 0xffffffff, modebuf);
175    }

Diff Legend

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