/[svn]/ircd-hybrid-7.2/src/channel_mode.c
ViewVC logotype

Diff of /ircd-hybrid-7.2/src/channel_mode.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 34 by lusky, Sun Oct 2 21:05:51 2005 UTC revision 356 by adx, Mon Jan 2 22:05:15 2006 UTC
# Line 97  static struct ChModeChange mode_changes[ Line 97  static struct ChModeChange mode_changes[
97  static int mode_count;  static int mode_count;
98  static int mode_limit;          /* number of modes set other than simple */  static int mode_limit;          /* number of modes set other than simple */
99  static int simple_modes_mask;   /* bit mask of simple modes already set */  static int simple_modes_mask;   /* bit mask of simple modes already set */
100    #ifdef HALFOPS
101    static int channel_capabs[] = { CAP_EX, CAP_IE, CAP_TS6, CAP_HOPS };
102    #else
103  static int channel_capabs[] = { CAP_EX, CAP_IE, CAP_TS6 };  static int channel_capabs[] = { CAP_EX, CAP_IE, CAP_TS6 };
104    #endif
105  static struct ChCapCombo chcap_combos[NCHCAP_COMBOS];  static struct ChCapCombo chcap_combos[NCHCAP_COMBOS];
106  extern BlockHeap *ban_heap;  extern BlockHeap *ban_heap;
107    
# Line 882  chm_op(struct Client *client_p, struct C Line 886  chm_op(struct Client *client_p, struct C
886    char *opnick;    char *opnick;
887    struct Client *targ_p;    struct Client *targ_p;
888    struct Membership *member;    struct Membership *member;
889      int caps = 0;
890    
891    if (alev < CHACCESS_CHANOP)    if (alev < CHACCESS_CHANOP)
892    {    {
# Line 919  chm_op(struct Client *client_p, struct C Line 924  chm_op(struct Client *client_p, struct C
924    if (dir == MODE_ADD &&  has_member_flags(member, CHFL_CHANOP))    if (dir == MODE_ADD &&  has_member_flags(member, CHFL_CHANOP))
925      return;      return;
926    if (dir == MODE_DEL && !has_member_flags(member, CHFL_CHANOP))    if (dir == MODE_DEL && !has_member_flags(member, CHFL_CHANOP))
927      {
928    #ifdef HALFOPS
929        if (has_member_flags(member, CHFL_HALFOP))
930          chm_hop(client_p, source_p, chptr, parc, parn, parv, errors, alev,
931                  dir, c, d, chname);
932    #endif
933      return;      return;
934      }
935    
936    #ifdef HALFOPS
937      if (dir == MODE_ADD && has_member_flags(member, CHFL_HALFOP))
938      {
939        /* promoting from % to @ is visible only to CAP_HOPS servers */
940        mode_changes[mode_count].letter = 'h';
941        mode_changes[mode_count].dir = MODE_DEL;
942        mode_changes[mode_count].caps = caps = CAP_HOPS;
943        mode_changes[mode_count].nocaps = 0;
944        mode_changes[mode_count].mems = ALL_MEMBERS;
945        mode_changes[mode_count].id = NULL;
946        mode_changes[mode_count].arg = targ_p->name;
947        mode_changes[mode_count++].client = targ_p;
948      }
949    #endif
950    
951    mode_changes[mode_count].letter = 'o';    mode_changes[mode_count].letter = 'o';
952    mode_changes[mode_count].dir = dir;    mode_changes[mode_count].dir = dir;
953    mode_changes[mode_count].caps = 0;    mode_changes[mode_count].caps = caps;
954    mode_changes[mode_count].nocaps = 0;    mode_changes[mode_count].nocaps = 0;
955    mode_changes[mode_count].mems = ALL_MEMBERS;    mode_changes[mode_count].mems = ALL_MEMBERS;
956    mode_changes[mode_count].id = targ_p->id;    mode_changes[mode_count].id = targ_p->id;
# Line 933  chm_op(struct Client *client_p, struct C Line 960  chm_op(struct Client *client_p, struct C
960    if (dir == MODE_ADD)    if (dir == MODE_ADD)
961    {    {
962      AddMemberFlag(member, CHFL_CHANOP);      AddMemberFlag(member, CHFL_CHANOP);
963      DelMemberFlag(member, CHFL_DEOPPED);      DelMemberFlag(member, CHFL_DEOPPED | CHFL_HALFOP);
964    }    }
965    else    else
966      DelMemberFlag(member, CHFL_CHANOP);      DelMemberFlag(member, CHFL_CHANOP);
# Line 997  chm_hop(struct Client *client_p, struct Line 1024  chm_hop(struct Client *client_p, struct
1024      return;      return;
1025    
1026    /* no redundant mode changes */    /* no redundant mode changes */
1027    if (dir == MODE_ADD &&  has_member_flags(member, CHFL_HALFOP))    if (dir == MODE_ADD &&  has_member_flags(member, CHFL_HALFOP | CHFL_CHANOP))
1028      return;      return;
1029    if (dir == MODE_DEL && !has_member_flags(member, CHFL_HALFOP))    if (dir == MODE_DEL && !has_member_flags(member, CHFL_HALFOP))
1030      return;      return;
1031    
1032    mode_changes[mode_count].letter = 'h';    mode_changes[mode_count].letter = 'h';
1033    mode_changes[mode_count].dir = dir;    mode_changes[mode_count].dir = dir;
1034    mode_changes[mode_count].caps = 0;    mode_changes[mode_count].caps = CAP_HOPS;
1035    mode_changes[mode_count].nocaps = 0;    mode_changes[mode_count].nocaps = 0;
1036    mode_changes[mode_count].mems = ALL_MEMBERS;    mode_changes[mode_count].mems = ALL_MEMBERS;
1037    mode_changes[mode_count].id = targ_p->id;    mode_changes[mode_count].id = targ_p->id;
1038    mode_changes[mode_count].arg = targ_p->name;    mode_changes[mode_count].arg = targ_p->name;
1039    mode_changes[mode_count++].client = targ_p;    mode_changes[mode_count++].client = targ_p;
1040    
1041      mode_changes[mode_count].letter = 'o';
1042      mode_changes[mode_count].dir = dir;
1043      mode_changes[mode_count].caps = 0;
1044      mode_changes[mode_count].nocaps = CAP_HOPS;
1045      mode_changes[mode_count].mems = ONLY_SERVERS;
1046      mode_changes[mode_count].id = targ_p->id;
1047      mode_changes[mode_count].arg = targ_p->name;
1048      mode_changes[mode_count++].client = targ_p;
1049    
1050    if (dir == MODE_ADD)    if (dir == MODE_ADD)
1051    {    {

Legend:
Removed from v.34  
changed lines
  Added in v.356

svnadmin@ircd-hybrid.org
ViewVC Help
Powered by ViewVC 1.1.28