Changeset 7a6ba50
- Timestamp:
- 2010-06-29T23:44:17Z (14 years ago)
- Branches:
- master
- Children:
- 217bf4e
- Parents:
- 58646d9
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
irc.h
r58646d9 r7a6ba50 193 193 IRC_CC_TYPE_GROUP, 194 194 IRC_CC_TYPE_ACCOUNT, 195 IRC_CC_TYPE_PROTOCOL, 195 196 } irc_control_channel_type_t; 196 197 … … 200 201 struct bee_group *group; 201 202 struct account *account; 203 struct prpl *protocol; 202 204 }; 203 205 -
irc_channel.c
r58646d9 r7a6ba50 474 474 static char *set_eval_fill_by( set_t *set, char *value ); 475 475 static char *set_eval_by_group( set_t *set, char *value ); 476 static char *set_eval_by_protocol( set_t *set, char *value ); 476 477 477 478 static gboolean control_channel_init( irc_channel_t *ic ) … … 482 483 set_add( &ic->set, "fill_by", "all", set_eval_fill_by, ic ); 483 484 set_add( &ic->set, "group", NULL, set_eval_by_group, ic ); 485 set_add( &ic->set, "protocol", NULL, set_eval_by_protocol, ic ); 484 486 485 487 ic->data = icc = g_new0( struct irc_control_channel, 1 ); … … 515 517 if( icc->type == IRC_CC_TYPE_ACCOUNT ) 516 518 bee_irc_channel_update( ic->irc, ic, NULL ); 519 517 520 return g_strdup_printf( "%s(%s)", acc->prpl->name, acc->user ); 518 521 } … … 531 534 else if( strcmp( value, "account" ) == 0 ) 532 535 icc->type = IRC_CC_TYPE_ACCOUNT; 536 else if( strcmp( value, "protocol" ) == 0 ) 537 icc->type = IRC_CC_TYPE_PROTOCOL; 533 538 else 534 539 return SET_INVALID; … … 546 551 if( icc->type == IRC_CC_TYPE_GROUP ) 547 552 bee_irc_channel_update( ic->irc, ic, NULL ); 553 548 554 return g_strdup( icc->group->name ); 555 } 556 557 static char *set_eval_by_protocol( set_t *set, char *value ) 558 { 559 struct irc_channel *ic = set->data; 560 struct irc_control_channel *icc = ic->data; 561 struct prpl *prpl; 562 563 if( !( prpl = find_protocol( value ) ) ) 564 return SET_INVALID; 565 566 icc->protocol = prpl; 567 if( icc->type == IRC_CC_TYPE_PROTOCOL ) 568 bee_irc_channel_update( ic->irc, ic, NULL ); 569 570 return value; 549 571 } 550 572 -
irc_im.c
r58646d9 r7a6ba50 157 157 else if( icc->type == IRC_CC_TYPE_ACCOUNT ) 158 158 show = iu->bu->ic->acc == icc->account; 159 else if( icc->type == IRC_CC_TYPE_PROTOCOL ) 160 show = iu->bu->ic->acc->prpl == icc->protocol; 159 161 160 162 if( !show ) -
storage_xml.c
r58646d9 r7a6ba50 219 219 } 220 220 221 /* The channel may exist already, for example if it's &bitlbee. 222 Also, it's possible that the user just reconnected and the 223 IRC client already rejoined all channels it was in. They 224 should still get the right settings. */ 221 225 if( ( xd->current_channel = irc_channel_by_name( irc, name ) ) || 222 226 ( xd->current_channel = irc_channel_new( irc, name ) ) )
Note: See TracChangeset
for help on using the changeset viewer.