Changeset 238f828
- Timestamp:
- 2005-12-26T14:42:54Z (19 years ago)
- Branches:
- master
- Children:
- e4d6271
- Parents:
- d25f6fc
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
commands.c
rd25f6fc r238f828 97 97 case STORAGE_OK: 98 98 irc_usermsg( irc, "Password accepted" ); 99 irc_umode_set( irc, "+R", 1 ); 99 100 break; 100 101 default: … … 122 123 case STORAGE_OK: 123 124 irc->status = USTATUS_IDENTIFIED; 125 irc_umode_set( irc, "+R", 1 ); 124 126 break; 125 127 … … 146 148 case STORAGE_OK: 147 149 irc_setpass( irc, NULL ); 150 irc->status = USTATUS_LOGGED_IN; 151 irc_umode_set( irc, "-R", 1 ); 148 152 irc_usermsg( irc, "Account `%s' removed", irc->nick ); 149 153 return( 0 ); -
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 -
irc.h
rd25f6fc r238f828 40 40 #define FLOOD_SEND_MAXBUFFER (1024*20) 41 41 42 #define UMODES "aiso" 42 #define UMODES "ias" 43 #define UMODES_PRIV "Ro" 43 44 #define CMODES "nt" 44 45 #define CMODE "t" … … 127 128 void irc_names( irc_t *irc, char *channel ); 128 129 void irc_topic( irc_t *irc, char *channel ); 129 void irc_umode_set( irc_t *irc, char * who, char *s);130 void irc_umode_set( irc_t *irc, char *s, int allow_priv ); 130 131 void irc_who( irc_t *irc, char *channel ); 131 132 void irc_spawn( irc_t *irc, user_t *u );
Note: See TracChangeset
for help on using the changeset viewer.