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

Comparing ircd-hybrid/trunk/src/s_user.c (file contents):
Revision 1976 by michael, Wed May 8 19:33:06 2013 UTC vs.
Revision 2022 by michael, Sun May 12 18:07:07 2013 UTC

# Line 53 | Line 53
53   #include "watch.h"
54  
55  
56 struct Callback *entering_umode_cb = NULL;
57 struct Callback *umode_cb = NULL;
58
56   static char umode_buffer[IRCD_BUFSIZE];
57  
58   static void user_welcome(struct Client *);
# Line 80 | Line 77 | static dlink_list support_list = { NULL,
77   MessageFile *isupportFile;
78  
79   /* memory is cheap. map 0-255 to equivalent mode */
80 < unsigned int user_modes[256] =
80 > const unsigned int user_modes[256] =
81   {
82    /* 0x00 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0x0F */
83    /* 0x10 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0x1F */
# Line 798 | Line 795 | report_and_set_user_flags(struct Client
795    }
796   }
797  
801 /* change_simple_umode()
802 *
803 * this callback can be hooked to allow special handling of
804 * certain usermodes
805 */
806 static void *
807 change_simple_umode(va_list args)
808 {
809  struct Client *client_p;
810  struct Client *source_p;
811  int what;
812  unsigned int flag;
813
814  client_p = va_arg(args, struct Client *);
815  source_p = va_arg(args, struct Client *);
816  what = va_arg(args, int);
817  flag = va_arg(args, unsigned int);
818
819  if (what == MODE_ADD)
820    AddUMode(source_p, flag);
821  else
822    DelUMode(source_p, flag);
823
824  return NULL;
825 }
826
798   /* set_user_mode()
799   *
800   * added 15/10/91 By Darren Reed.
# Line 872 | Line 843 | set_user_mode(struct Client *client_p, s
843      return;
844    }
845  
875  execute_callback(entering_umode_cb, client_p, source_p);
876
846    /* find flags already set for user */
847    setflags = source_p->umodes;
848  
# Line 925 | Line 894 | set_user_mode(struct Client *client_p, s
894  
895            break;
896  
897 <        /* we may not get these,
898 <         * but they shouldnt be in default
897 >        /*
898 >         * We may not get these, but they shouldnt be in default
899           */
900          case 'r':
901          case ' ' :
# Line 940 | Line 909 | set_user_mode(struct Client *client_p, s
909            {
910              if (MyConnect(source_p) && !HasUMode(source_p, UMODE_OPER) &&
911                  (ConfigFileEntry.oper_only_umodes & flag))
943            {
912                badflag = 1;
945            }
913              else
914 <              execute_callback(umode_cb, client_p, source_p, what, flag);
914 >            {
915 >              if (what == MODE_ADD)
916 >                AddUMode(source_p, flag);
917 >              else
918 >                DelUMode(source_p, flag);
919 >            }
920            }
921            else
922            {
# Line 1275 | Line 1247 | init_uid(void)
1247     * -Dianora
1248     */
1249    memcpy(new_uid + IRC_MAXSID, "AAAAA@", IRC_MAXUID);
1278
1279  entering_umode_cb = register_callback("entering_umode", NULL);
1280  umode_cb = register_callback("changing_umode", change_simple_umode);
1250   }
1251  
1252   /*

Diff Legend

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