Changeset 1c40aa7
- Timestamp:
- 2010-06-28T00:07:46Z (14 years ago)
- Branches:
- master
- Children:
- c7eb771
- Parents:
- 134a02c
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
irc.h
r134a02c r1c40aa7 132 132 typedef enum 133 133 { 134 IRC_CHANNEL_JOINED = 1, 134 IRC_CHANNEL_JOINED = 1, /* The user is currently in the channel. */ 135 IRC_CHANNEL_TEMP = 2, /* Erase the channel when the user leaves, 136 and don't save it. */ 135 137 136 138 /* Hack: Set this flag right before jumping into IM when we expect -
irc_channel.c
r134a02c r1c40aa7 202 202 203 203 if( iu == ic->irc->user ) 204 { 204 205 ic->flags &= ~IRC_CHANNEL_JOINED; 206 207 if( ic->flags & IRC_CHANNEL_TEMP ) 208 irc_channel_free( ic ); 209 } 205 210 206 211 return 1; -
irc_im.c
r134a02c r1c40aa7 455 455 irc_channel_printf( ic, "Cleaning up channel, bye!" ); 456 456 457 /* irc_channel_free( ic ); */ 458 457 ic->data = NULL; 459 458 irc_channel_del_user( ic, ic->irc->user, FALSE, "Chatroom closed by server" ); 460 ic->data = NULL;461 459 462 460 return TRUE; … … 501 499 irc_t *irc = bee->ui_data; 502 500 501 /* TODO: Possible bug here: If a module removes $user here instead of just 502 using imcb_chat_free() and the channel was IRC_CHANNEL_TEMP, we get into 503 a broken state around here. */ 503 504 irc_channel_del_user( c->ui_data, bu == bee->user ? irc->user : bu->ui_data, FALSE, NULL ); 504 505 … … 696 697 697 698 static char *set_eval_room_account( set_t *set, char *value ); 699 static char *set_eval_chat_type( set_t *set, char *value ); 698 700 699 701 static gboolean bee_irc_channel_init( irc_channel_t *ic ) 700 702 { 701 703 set_add( &ic->set, "account", NULL, set_eval_room_account, ic ); 702 set_add( &ic->set, "chat_type", "groupchat", NULL, ic );704 set_add( &ic->set, "chat_type", "groupchat", set_eval_chat_type, ic ); 703 705 set_add( &ic->set, "nick", NULL, NULL, ic ); 704 706 set_add( &ic->set, "room", NULL, NULL, ic ); 707 708 /* chat_type == groupchat */ 709 ic->flags |= IRC_CHANNEL_TEMP; 705 710 706 711 return TRUE; … … 721 726 722 727 return g_strdup_printf( "%s(%s)", acc->prpl->name, acc->user ); 728 } 729 730 static char *set_eval_chat_type( set_t *set, char *value ) 731 { 732 struct irc_channel *ic = set->data; 733 734 if( strcmp( value, "groupchat" ) == 0 ) 735 ic->flags |= IRC_CHANNEL_TEMP; 736 else if( strcmp( value, "room" ) == 0 ) 737 ic->flags &= ~IRC_CHANNEL_TEMP; 738 else 739 return NULL; 740 741 return value; 723 742 } 724 743 … … 729 748 set_del( &ic->set, "nick" ); 730 749 set_del( &ic->set, "room" ); 750 751 ic->flags &= ~IRC_CHANNEL_TEMP; 731 752 732 753 return TRUE; -
storage_xml.c
r134a02c r1c40aa7 517 517 irc_channel_t *ic = l->data; 518 518 519 if( ic->flags & IRC_CHANNEL_TEMP ) 520 continue; 521 519 522 if( !xml_printf( fd, 1, "<channel name=\"%s\" type=\"%s\">\n", 520 523 ic->name, set_getstr( &ic->set, "type" ) ) )
Note: See TracChangeset
for help on using the changeset viewer.