Changeset c5aefa4 for irc_channel.c
- Timestamp:
- 2010-06-07T15:39:53Z (14 years ago)
- Branches:
- master
- Children:
- 70f69ecc
- Parents:
- 0e8b3e8
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
irc_channel.c
r0e8b3e8 rc5aefa4 45 45 46 46 irc_channel_add_user( ic, irc->root ); 47 if( strcmp( set_getstr( &irc->b->set, "ops" ), "both" ) == 0 ||48 strcmp( set_getstr( &irc->b->set, "ops" ), "root" ) == 0 )49 irc_channel_user_set_mode( ic, irc->root, IRC_CHANNEL_USER_OP );50 47 51 48 irc->channels = g_slist_append( irc->channels, ic ); … … 173 170 ic->users = g_slist_insert_sorted( ic->users, icu, irc_channel_user_cmp ); 174 171 172 irc_channel_update_ops( ic, set_getstr( &ic->irc->b->set, "ops" ) ); 173 175 174 if( iu == ic->irc->user || ic->flags & IRC_CHANNEL_JOINED ) 176 175 { … … 239 238 irc_channel_user_t *icu = irc_channel_has_user( ic, iu ); 240 239 241 if( icu->flags == flags )240 if( !icu || icu->flags == flags ) 242 241 return; 243 242 … … 282 281 283 282 return irc_user_cmp( a->iu, b->iu ); 283 } 284 285 void irc_channel_update_ops( irc_channel_t *ic, char *value ) 286 { 287 irc_channel_user_set_mode( ic, ic->irc->root, 288 ( strcmp( value, "both" ) == 0 || 289 strcmp( value, "root" ) == 0 ) ? IRC_CHANNEL_USER_OP : 0 ); 290 irc_channel_user_set_mode( ic, ic->irc->user, 291 ( strcmp( value, "both" ) == 0 || 292 strcmp( value, "user" ) == 0 ) ? IRC_CHANNEL_USER_OP : 0 ); 293 } 294 295 char *set_eval_irc_channel_ops( set_t *set, char *value ) 296 { 297 irc_t *irc = set->data; 298 GSList *l; 299 300 if( strcmp( value, "both" ) != 0 && strcmp( value, "none" ) != 0 && 301 strcmp( value, "user" ) != 0 && strcmp( value, "root" ) != 0 ) 302 return SET_INVALID; 303 304 for( l = irc->channels; l; l = l->next ) 305 irc_channel_update_ops( l->data, value ); 306 307 return value; 284 308 } 285 309
Note: See TracChangeset
for help on using the changeset viewer.