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-7.2/modules/m_set.c (file contents):
Revision 646 by michael, Wed Jun 7 12:42:00 2006 UTC vs.
Revision 896 by michael, Sat Nov 3 08:54:09 2007 UTC

# Line 49 | Line 49 | static void mo_set(struct Client *, stru
49  
50   struct Message set_msgtab = {
51    "SET", 0, 0, 0, 0, MFLG_SLOW, 0,
52 <  {m_unregistered, m_not_oper, m_error, m_ignore, mo_set, m_ignore}
52 >  {m_unregistered, m_not_oper, m_error, m_ignore, mo_set, m_ignore}
53   };
54  
55   #ifndef STATIC_MODULES
# Line 138 | Line 138 | list_quote_commands(struct Client *sourc
138   {
139    int i;
140    int j = 0;
141 <  const char *names[4];
141 >  const char *names[4] = { "", "", "", "" };
142  
143    sendto_one(source_p, ":%s NOTICE %s :Available QUOTE SET commands:",
144               me.name, source_p->name);
145  
146  names[0] = names[1] = names[2] = names[3] = "";
147
146    for (i = 0; set_cmd_table[i].handler; i++)
147    {
148      names[j++] = set_cmd_table[i].name;
# Line 160 | Line 158 | list_quote_commands(struct Client *sourc
158      }
159  
160    }
161 +
162    if (j)
163      sendto_one(source_p, ":%s NOTICE %s :%s %s %s %s",
164                 me.name, source_p->name,
# Line 171 | Line 170 | list_quote_commands(struct Client *sourc
170   static void
171   quote_autoconn(struct Client *source_p, const char *arg, int newval)
172   {
173 <  set_autoconn(source_p, arg, newval);
173 >  struct AccessItem *aconf;
174 >
175 >  if (arg != NULL)
176 >  {
177 >    struct ConfItem *conf = find_exact_name_conf(SERVER_TYPE, arg, NULL, NULL);
178 >
179 >    if (conf != NULL)
180 >    {
181 >      aconf = map_to_conf(conf);
182 >      if (newval)
183 >        SetConfAllowAutoConn(aconf);
184 >      else
185 >        ClearConfAllowAutoConn(aconf);
186 >
187 >      sendto_realops_flags(UMODE_ALL, L_ALL,
188 >                           "%s has changed AUTOCONN for %s to %i",
189 >                           source_p->name, arg, newval);
190 >      sendto_one(source_p,
191 >                 ":%s NOTICE %s :AUTOCONN for %s is now set to %i",
192 >                 me.name, source_p->name, arg, newval);
193 >    }
194 >    else
195 >    {
196 >      sendto_one(source_p, ":%s NOTICE %s :Can't find %s",
197 >                 me.name, source_p->name, arg);
198 >    }
199 >  }
200 >  else
201 >  {
202 >    sendto_one(source_p, ":%s NOTICE %s :Please specify a server name!",
203 >               me.name, source_p->name);
204 >  }
205   }
206  
207   /* SET AUTOCONNALL */
# Line 259 | Line 289 | quote_idletime(struct Client *source_p,
289  
290   /* SET LOG */
291   static void
292 < quote_log( struct Client *source_p, int newval )
292 > quote_log(struct Client *source_p, int newval)
293   {
294    const char *log_level_as_string;
295  
# Line 292 | Line 322 | quote_log( struct Client *source_p, int
322  
323   /* SET MAX */
324   static void
325 < quote_max (struct Client *source_p, int newval)
325 > quote_max(struct Client *source_p, int newval)
326   {
327    if (newval > 0)
328    {
# Line 328 | Line 358 | quote_max (struct Client *source_p, int
358  
359   /* SET MSGLOCALE */
360   static void
361 < quote_msglocale( struct Client *source_p, char *locale )
361 > quote_msglocale(struct Client *source_p, char *locale)
362   {
363    if (locale != NULL)
364    {
# Line 344 | Line 374 | quote_msglocale( struct Client *source_p
374  
375   /* SET SPAMNUM */
376   static void
377 < quote_spamnum( struct Client *source_p, int newval )
377 > quote_spamnum(struct Client *source_p, int newval)
378   {
379    if (newval >= 0)
380    {
# Line 363 | Line 393 | quote_spamnum( struct Client *source_p,
393    }
394    else
395      sendto_one(source_p, ":%s NOTICE %s :SPAMNUM is currently %i",
396 <                me.name,
397 <                source_p->name, GlobalSetOptions.spam_num);
396 >               me.name,
397 >               source_p->name, GlobalSetOptions.spam_num);
398   }
399  
400   /* SET SPAMTIME */
401   static void
402 < quote_spamtime( struct Client *source_p, int newval )
402 > quote_spamtime(struct Client *source_p, int newval)
403   {
404    if (newval > 0)
405    {
# Line 410 | Line 440 | quote_splitmode(struct Client *source_p,
440    {
441      int newval;
442  
443 <    for (newval = 0; splitmode_values[newval]; newval++)
414 <    {
443 >    for (newval = 0; splitmode_values[newval]; ++newval)
444        if (irccmp(splitmode_values[newval], charval) == 0)
445          break;
417    }
446  
447      /* OFF */
448      if (newval == 0)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines