- Timestamp:
- 2005-12-26T14:42:54Z (19 years ago)
- Branches:
- master
- Children:
- e4d6271
- Parents:
- d25f6fc
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
irc.c
rd25f6fc r238f828 506 506 irc_reply( irc, 461, "%s :Need more parameters", cmd[0] ); 507 507 else if( strcmp( cmd[2], global.conf->oper_pass ) == 0 ) 508 irc_umode_set( irc, irc->nick, "+o");508 irc_umode_set( irc, "+o", 1 ); 509 509 // else 510 510 /* FIXME/TODO: Find out which reply to send now. */ … … 533 533 { 534 534 if( cmd[2] ) 535 irc_umode_set( irc, irc->nick, cmd[2]);535 irc_umode_set( irc, cmd[2], 0 ); 536 536 } 537 537 else … … 1084 1084 irc_reply( irc, 2, ":Host %s is running BitlBee " BITLBEE_VERSION " " ARCH "/" CPU ".", irc->myhost ); 1085 1085 irc_reply( irc, 3, ":%s", IRCD_INFO ); 1086 irc_reply( irc, 4, "%s %s %s %s", irc->myhost, BITLBEE_VERSION, UMODES , CMODES );1086 irc_reply( irc, 4, "%s %s %s %s", irc->myhost, BITLBEE_VERSION, UMODES UMODES_PRIV, CMODES ); 1087 1087 irc_reply( irc, 5, "PREFIX=(ov)@+ CHANTYPES=#& CHANMODES=,,,%s NICKLEN=%d NETWORK=BitlBee CASEMAPPING=rfc1459 MAXTARGETS=1 WATCH=128 :are supported by this server", CMODES, MAX_NICK_LENGTH - 1 ); 1088 1088 irc_motd( irc ); 1089 irc_umode_set( irc, irc->myhost, "+" UMODE);1089 irc_umode_set( irc, "+" UMODE, 1 ); 1090 1090 1091 1091 u = user_add( irc, irc->mynick ); … … 1214 1214 1215 1215 1216 void irc_umode_set( irc_t *irc, char *who, char *s ) 1217 { 1216 void irc_umode_set( irc_t *irc, char *s, int allow_priv ) 1217 { 1218 /* allow_priv: Set to 0 if s contains user input, 1 if you want 1219 to set a "privileged" mode (+o, +R, etc). */ 1218 1220 char m[256], st = 1, *t; 1219 1221 int i; … … 1228 1230 if( *t == '+' || *t == '-' ) 1229 1231 st = *t == '+'; 1230 else 1232 else if( st == 0 || ( strchr( UMODES, *t ) || ( allow_priv && strchr( UMODES_PRIV, *t ) ) ) ) 1231 1233 m[(int)*t] = st; 1232 1234 } … … 1235 1237 1236 1238 for( i = 0; i < 256 && strlen( irc->umode ) < ( sizeof( irc->umode ) - 1 ); i ++ ) 1237 if( m[i] && strchr( UMODES, i ))1239 if( m[i] ) 1238 1240 irc->umode[strlen(irc->umode)] = i; 1239 1241
Note: See TracChangeset
for help on using the changeset viewer.