Changeset ab6006c
- Timestamp:
- 2010-06-28T09:03:39Z (14 years ago)
- Branches:
- master
- Children:
- a670aeb
- Parents:
- c7eb771
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
irc.h
rc7eb771 rab6006c 229 229 irc_channel_t *irc_channel_get( irc_t *irc, char *id ); 230 230 int irc_channel_free( irc_channel_t *ic ); 231 void irc_channel_free_soon( irc_channel_t *ic ); 231 232 int irc_channel_add_user( irc_channel_t *ic, irc_user_t *iu ); 232 233 int irc_channel_del_user( irc_channel_t *ic, irc_user_t *iu, gboolean silent, const char *msg ); -
irc_channel.c
rc7eb771 rab6006c 141 141 } 142 142 143 struct irc_channel_free_data 144 { 145 irc_t *irc; 146 irc_channel_t *ic; 147 char *name; 148 }; 149 150 static gboolean irc_channel_free_callback( gpointer data, gint fd, b_input_condition cond ) 151 { 152 struct irc_channel_free_data *d = data; 153 154 if( g_slist_find( irc_connection_list, d->irc ) && 155 irc_channel_by_name( d->irc, d->name ) == d->ic && 156 !( d->ic->flags & IRC_CHANNEL_JOINED ) ) 157 irc_channel_free( d->ic ); 158 159 g_free( d->name ); 160 g_free( d ); 161 return FALSE; 162 } 163 164 /* Free the channel, but via the event loop, so after finishing whatever event 165 we're currently handling. */ 166 void irc_channel_free_soon( irc_channel_t *ic ) 167 { 168 struct irc_channel_free_data *d = g_new0( struct irc_channel_free_data, 1 ); 169 170 d->irc = ic->irc; 171 d->ic = ic; 172 d->name = g_strdup( ic->name ); 173 174 b_timeout_add( 0, irc_channel_free_callback, d ); 175 } 176 143 177 static char *set_eval_channel_type( set_t *set, char *value ) 144 178 { … … 206 240 207 241 if( ic->flags & IRC_CHANNEL_TEMP ) 208 irc_channel_free ( ic );242 irc_channel_free_soon( ic ); 209 243 } 210 244
Note: See TracChangeset
for help on using the changeset viewer.