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-8/modules/m_svsmode.c (file contents):
Revision 1159 by michael, Wed Aug 10 21:08:18 2011 UTC vs.
Revision 1274 by michael, Mon Jan 30 23:41:59 2012 UTC

# Line 22 | Line 22
22  
23   /*! \file m_svsmode.c
24   * \brief Includes required functions for processing the SVSMODE command.
25 < * \version $Id: m_admin.c 1144 2011-07-26 19:33:54Z michael $
25 > * \version $Id$
26   */
27  
28   #include "stdinc.h"
29 – #include "handlers.h"
29   #include "client.h"
30   #include "ircd.h"
31   #include "numeric.h"
33 – #include "s_conf.h"
32   #include "s_serv.h"
33   #include "send.h"
34   #include "channel_mode.h"
37 – #include "msg.h"
35   #include "parse.h"
36   #include "modules.h"
37   #include "irc_string.h"
38   #include "s_user.h"
39 <
40 < static void ms_svsmode(struct Client *, struct Client *, int, char *[]);
44 <
45 < struct Message svsmode_msgtab = {
46 <  "SVSMODE", 0, 0, 0, 0, MFLG_SLOW | MFLG_UNREG, 0,
47 <  {m_ignore, m_ignore, ms_svsmode, m_ignore, m_ignore, m_ignore}
48 < };
49 <
50 < const char *_version = "$Revision: 1144 $";
51 <
52 < void
53 < _modinit(void)
54 < {
55 <  mod_add_cmd(&svsmode_msgtab);
56 < }
57 <
58 < void
59 < _moddeinit(void)
60 < {
61 <  mod_del_cmd(&svsmode_msgtab);
62 < }
39 > #include "s_conf.h"
40 > #include "hook.h"
41  
42  
43 < /*! \brief SVSMODE command handler (called by servers or services)
43 > /*! \brief SVSMODE command handler (called by services)
44   *
45   * \param client_p Pointer to allocated Client struct with physical connection
46   *                 to this server, i.e. with an open socket connected.
# Line 76 | Line 54 | _moddeinit(void)
54   *      - parv[1] = nickname
55   *      - parv[2] = TS (or mode, depending on svs version)
56   *      - parv[3] = mode (or services id if old svs version)
57 < *      - parv[4] = optional arguement (services id)
57 > *      - parv[4] = optional argument (services id)
58   */
59   static void
60   ms_svsmode(struct Client *client_p, struct Client *source_p,
# Line 88 | Line 66 | ms_svsmode(struct Client *client_p, stru
66    char *m = NULL, *modes = NULL, *extarg = NULL;
67    time_t ts = 0;
68  
69 <  if (!IsService(source_p) || (parc < 3))
69 >  if (!HasFlag(source_p, FLAGS_SERVICE))
70      return;
71  
72    if ((parc >= 4) && ((*parv[3] == '+') || (*parv[3] == '-')))
# Line 121 | Line 99 | ms_svsmode(struct Client *client_p, stru
99        case '-':
100          what = MODE_DEL;
101          break;
102 +
103 +      case 'd':
104 +        if (extarg && IsDigit(*extarg))
105 +          target_p->servicestamp = strtoul(extarg, NULL, 0);
106 +        break;
107 +
108        case 'o':
109 <        if (what == MODE_DEL && IsOper(target_p))
109 >        if (what == MODE_DEL && HasUMode(target_p, UMODE_OPER))
110          {
111            ClearOper(target_p);
112            Count.oper--;
# Line 132 | Line 116 | ms_svsmode(struct Client *client_p, stru
116              dlink_node *dm = NULL;
117  
118              detach_conf(target_p, OPER_TYPE);
119 <            ClearOperFlags(target_p);
119 >            ClrOFlag(target_p);
120              DelUMode(target_p, ConfigFileEntry.oper_only_umodes);
121  
122             if ((dm = dlinkFindDelete(&oper_list, target_p)) != NULL)
# Line 142 | Line 126 | ms_svsmode(struct Client *client_p, stru
126  
127          break;
128  
129 +      case 'i':
130 +        if (what == MODE_ADD && !HasUMode(target_p, UMODE_INVISIBLE))
131 +        {
132 +          AddUMode(target_p, UMODE_INVISIBLE);
133 +          ++Count.invisi;
134 +        }
135 +
136 +        if (what == MODE_DEL && HasUMode(target_p, UMODE_INVISIBLE))
137 +        {
138 +          DelUMode(target_p, UMODE_INVISIBLE);
139 +          --Count.invisi;
140 +        }
141 +
142 +        break;
143 +
144        case ' ':
145        case '\n':
146        case '\r':
147        case '\t':
148          break;
150 –      case 'd':
151 –        if (extarg && IsDigit(*extarg))
152 –          target_p->servicestamp = strtoul(extarg, NULL, 0);
153 –        break;
149        default:
150          if ((flag = user_modes[(unsigned char)*m]))
151            execute_callback(umode_cb, client_p, target_p, what, flag);
# Line 177 | Line 172 | ms_svsmode(struct Client *client_p, stru
172                    target_p->name, (unsigned long)target_p->tsinfo, modes);
173    }
174  
175 <  if (MyClient(target_p) && (setflags != target_p->umodes))
175 >  if (MyConnect(target_p) && (setflags != target_p->umodes))
176    {
177      char modebuf[IRCD_BUFSIZE];
178  
179      send_umode(target_p, target_p, setflags, 0xffffffff, modebuf);
180    }
181   }
182 +
183 + static struct Message svsmode_msgtab = {
184 +  "SVSMODE", 0, 0, 3, MAXPARA, MFLG_SLOW | MFLG_UNREG, 0,
185 +  {m_ignore, m_ignore, ms_svsmode, m_ignore, m_ignore, m_ignore}
186 + };
187 +
188 + static void
189 + module_init(void)
190 + {
191 +  mod_add_cmd(&svsmode_msgtab);
192 + }
193 +
194 + static void
195 + module_exit(void)
196 + {
197 +  mod_del_cmd(&svsmode_msgtab);
198 + }
199 +
200 + struct module module_entry = {
201 +  .node    = { NULL, NULL, NULL },
202 +  .name    = NULL,
203 +  .version = "$Revision$",
204 +  .handle  = NULL,
205 +  .modinit = module_init,
206 +  .modexit = module_exit,
207 +  .flags   = 0
208 + };

Comparing ircd-hybrid-8/modules/m_svsmode.c (property svn:keywords):
Revision 1159 by michael, Wed Aug 10 21:08:18 2011 UTC vs.
Revision 1274 by michael, Mon Jan 30 23:41:59 2012 UTC

# Line 0 | Line 1
1 + Id Revision

Diff Legend

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