Changeset c8eeadd
- Timestamp:
- 2010-07-04T10:16:07Z (14 years ago)
- Branches:
- master
- Children:
- 5c7b45c
- Parents:
- 0bd948e
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
irc.c
r0bd948e rc8eeadd 653 653 ic = irc->default_channel = irc_channel_new( irc, ROOT_CHAN ); 654 654 irc_channel_set_topic( ic, CONTROL_TOPIC, irc->root ); 655 irc_channel_add_user( ic, irc->user ); 655 set_setstr( &ic->set, "auto_join", "true" ); 656 irc_channel_auto_joins( irc, NULL ); 656 657 657 658 irc->last_root_cmd = g_strdup( ROOT_CHAN ); -
irc.h
r0bd948e rc8eeadd 237 237 int irc_channel_set_topic( irc_channel_t *ic, const char *topic, const irc_user_t *who ); 238 238 void irc_channel_user_set_mode( irc_channel_t *ic, irc_user_t *iu, irc_channel_user_flags_t flags ); 239 void irc_channel_auto_joins( irc_t *irc, struct account *acc ); 239 240 void irc_channel_printf( irc_channel_t *ic, char *format, ... ); 240 241 gboolean irc_channel_name_ok( const char *name ); -
irc_channel.c
r0bd948e rc8eeadd 48 48 irc->channels = g_slist_append( irc->channels, ic ); 49 49 50 set_add( &ic->set, "auto_join", "false", set_eval_bool, ic ); 50 51 set_add( &ic->set, "type", "control", set_eval_channel_type, ic ); 51 52 … … 309 310 } 310 311 312 void irc_channel_auto_joins( irc_t *irc, account_t *acc ) 313 { 314 GSList *l; 315 316 for( l = irc->channels; l; l = l->next ) 317 { 318 irc_channel_t *ic = l->data; 319 gboolean aj = set_getbool( &ic->set, "auto_join" ); 320 char *type; 321 322 if( acc && 323 ( type = set_getstr( &ic->set, "chat_type" ) ) && 324 strcmp( type, "room" ) == 0 ) 325 { 326 /* Bit of an ugly special case: Handle chatrooms here, we 327 can only auto-join them if their account is online. */ 328 char *acc_s; 329 330 if( !aj && !( ic->flags & IRC_CHANNEL_JOINED ) ) 331 /* Only continue if this one's marked as auto_join 332 or if we're in it already. (Possible if the 333 client auto-rejoined it before identyfing.) */ 334 continue; 335 else if( !( acc_s = set_getstr( &ic->set, "account" ) ) ) 336 continue; 337 else if( account_get( irc->b, acc_s ) != acc ) 338 continue; 339 else if( acc->ic == NULL || !( acc->ic->flags & OPT_LOGGED_IN ) ) 340 continue; 341 else 342 ic->f->join( ic ); 343 } 344 else if( aj ) 345 { 346 irc_channel_add_user( ic, irc->user ); 347 } 348 } 349 } 350 311 351 void irc_channel_printf( irc_channel_t *ic, char *format, ... ) 312 352 { … … 521 561 bee_irc_channel_update( ic->irc, ic, NULL ); 522 562 } 563 564 return TRUE; 565 } 566 567 static gboolean control_channel_join( irc_channel_t *ic ) 568 { 569 bee_irc_channel_update( ic->irc, ic, NULL ); 523 570 524 571 return TRUE; … … 608 655 static const struct irc_channel_funcs control_channel_funcs = { 609 656 control_channel_privmsg, 610 NULL,657 control_channel_join, 611 658 NULL, 612 659 NULL, -
root_commands.c
r0bd948e rc8eeadd 157 157 irc->status |= USTATUS_IDENTIFIED; 158 158 irc_umode_set( irc, "+R", 1 ); 159 irc_channel_auto_joins( irc, NULL ); 159 160 if( load && set_getbool( &irc->b->set, "auto_connect" ) ) 160 161 cmd_account( irc, account_on );
Note: See TracChangeset
for help on using the changeset viewer.