Changeset c5aefa4
- Timestamp:
- 2010-06-07T15:39:53Z (15 years ago)
- Branches:
- master
- Children:
- 70f69ecc
- Parents:
- 0e8b3e8
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
irc.c
r0e8b3e8 rc5aefa4 107 107 s = set_add( &b->set, "handle_unknown", "add_channel", NULL, irc ); 108 108 s = set_add( &b->set, "lcnicks", "true", set_eval_bool, irc ); 109 s = set_add( &b->set, "ops", "both", NULL/*set_eval_ops*/, irc );109 s = set_add( &b->set, "ops", "both", set_eval_irc_channel_ops, irc ); 110 110 s = set_add( &b->set, "paste_buffer", "false", set_eval_bool, irc ); 111 111 s->old_key = g_strdup( "buddy_sendbuffer" ); … … 663 663 irc_channel_add_user( ic, irc->user ); 664 664 665 if( strcmp( set_getstr( &irc->b->set, "ops" ), "both" ) == 0 ||666 strcmp( set_getstr( &irc->b->set, "ops" ), "user" ) == 0 )667 irc_channel_user_set_mode( ic, irc->user, IRC_CHANNEL_USER_OP );668 669 665 irc->last_root_cmd = g_strdup( ROOT_CHAN ); 670 666 -
irc.h
r0e8b3e8 rc5aefa4 229 229 void irc_channel_printf( irc_channel_t *ic, char *format, ... ); 230 230 gboolean irc_channel_name_ok( const char *name ); 231 void irc_channel_update_ops( irc_channel_t *ic, char *value ); 232 char *set_eval_irc_channel_ops( struct set *set, char *value ); 231 233 232 234 /* irc_commands.c */ -
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.