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

Comparing ircd-hybrid/trunk/modules/m_set.c (file contents):
Revision 6318 by michael, Wed Aug 5 16:04:43 2015 UTC vs.
Revision 6375 by michael, Fri Aug 21 10:34:16 2015 UTC

# Line 191 | Line 191 | quote_spamtime(struct Client *source_p,
191                        GlobalSetOptions.spam_time);
192   }
193  
194 /* this table is what splitmode may be set to */
195 static const char *splitmode_values[] =
196 {
197  "OFF",
198  "ON",
199  "AUTO",
200  NULL
201 };
202
203 /* this table is what splitmode may be */
204 static const char *splitmode_status[] =
205 {
206  "OFF",
207  "AUTO (OFF)",
208  "ON",
209  "AUTO (ON)",
210  NULL
211 };
212
213 /* SET SPLITMODE */
214 static void
215 quote_splitmode(struct Client *source_p, const char *charval, int val)
216 {
217  if (charval)
218  {
219    int newval;
220
221    for (newval = 0; splitmode_values[newval]; ++newval)
222      if (!irccmp(splitmode_values[newval], charval))
223        break;
224
225    /* OFF */
226    if (newval == 0)
227    {
228      sendto_realops_flags(UMODE_SERVNOTICE, L_ALL, SEND_NOTICE,
229                           "%s is disabling splitmode",
230                           get_oper_name(source_p));
231
232      splitmode = 0;
233      splitchecking = 0;
234
235      event_delete(&splitmode_event);
236    }
237    /* ON */
238    else if (newval == 1)
239    {
240      sendto_realops_flags(UMODE_SERVNOTICE, L_ALL, SEND_NOTICE,
241                           "%s is enabling and activating splitmode",
242                           get_oper_name(source_p));
243
244      splitmode = 1;
245      splitchecking = 0;
246
247      /* we might be deactivating an automatic splitmode, so pull the event */
248      event_delete(&splitmode_event);
249    }
250    /* AUTO */
251    else if (newval == 2)
252    {
253      sendto_realops_flags(UMODE_SERVNOTICE, L_ALL, SEND_NOTICE,
254                           "%s is enabling automatic splitmode",
255                           get_oper_name(source_p));
256
257      splitchecking = 1;
258      check_splitmode(NULL);
259    }
260  }
261  else
262    /* if we add splitchecking to splitmode*2 we get a unique table to
263     * pull values back out of, splitmode can be four states - but you can
264     * only set to three, which means we cant use the same table --fl_
265     */
266    sendto_one_notice(source_p, &me, ":SPLITMODE is currently %s",
267                      splitmode_status[(splitchecking + (splitmode * 2))]);
268 }
269
270 /* SET SPLITNUM */
271 static void
272 quote_splitnum(struct Client *source_p, const char *arg, int newval)
273 {
274  if (newval >= 0)
275  {
276    sendto_realops_flags(UMODE_SERVNOTICE, L_ALL, SEND_NOTICE,
277                         "%s has changed SPLITNUM to %i",
278                         get_oper_name(source_p), newval);
279    split_servers = newval;
280
281    if (splitchecking)
282      check_splitmode(NULL);
283  }
284  else
285    sendto_one_notice(source_p, &me, ":SPLITNUM is currently %i",
286                      split_servers);
287 }
288
289 /* SET SPLITUSERS */
290 static void
291 quote_splitusers(struct Client *source_p, const char *arg, int newval)
292 {
293  if (newval >= 0)
294  {
295    sendto_realops_flags(UMODE_SERVNOTICE, L_ALL, SEND_NOTICE,
296                         "%s has changed SPLITUSERS to %i",
297                         get_oper_name(source_p), newval);
298    split_users = newval;
299
300    if (splitchecking)
301      check_splitmode(NULL);
302  }
303  else
304    sendto_one_notice(source_p, &me, ":SPLITUSERS is currently %i",
305                      split_users);
306 }
307
194   /* SET JFLOODTIME */
195   static void
196   quote_jfloodtime(struct Client *source_p, const char *arg, int newval)
# Line 366 | Line 252 | static const struct SetStruct set_cmd_ta
252    { "MAX",              quote_max,              0,      1 },
253    { "SPAMNUM",          quote_spamnum,          0,      1 },
254    { "SPAMTIME",         quote_spamtime,         0,      1 },
369  { "SPLITMODE",        quote_splitmode,        1,      0 },
370  { "SPLITNUM",         quote_splitnum,         0,      1 },
371  { "SPLITUSERS",       quote_splitusers,       0,      1 },
255    { "JFLOODTIME",       quote_jfloodtime,       0,      1 },
256    { "JFLOODCOUNT",      quote_jfloodcount,      0,      1 },
257    /* -------------------------------------------------------- */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines