Changeset 006a84f
- Timestamp:
- 2010-07-04T20:40:15Z (14 years ago)
- Branches:
- master
- Children:
- 69b896b, 6c2404e
- Parents:
- f537044
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
irc.h
rf537044 r006a84f 206 206 extern const struct bee_ui_funcs irc_ui_funcs; 207 207 208 typedef enum 209 { 210 IRC_CDU_SILENT, 211 IRC_CDU_PART, 212 IRC_CDU_KICK, 213 } irc_channel_del_user_type_t; 214 208 215 /* irc.c */ 209 216 extern GSList *irc_connection_list; … … 233 240 void irc_channel_free_soon( irc_channel_t *ic ); 234 241 int irc_channel_add_user( irc_channel_t *ic, irc_user_t *iu ); 235 int irc_channel_del_user( irc_channel_t *ic, irc_user_t *iu, gboolean silent, const char *msg );242 int irc_channel_del_user( irc_channel_t *ic, irc_user_t *iu, irc_channel_del_user_type_t type, const char *msg ); 236 243 irc_channel_user_t *irc_channel_has_user( irc_channel_t *ic, irc_user_t *iu ); 237 244 int irc_channel_set_topic( irc_channel_t *ic, const char *topic, const irc_user_t *who ); … … 256 263 void irc_send_part( irc_channel_t *ic, irc_user_t *iu, const char *reason ); 257 264 void irc_send_quit( irc_user_t *iu, const char *reason ); 265 void irc_send_kick( irc_channel_t *ic, irc_user_t *iu, irc_user_t *kicker, const char *reason ); 258 266 void irc_send_names( irc_channel_t *ic ); 259 267 void irc_send_topic( irc_channel_t *ic, gboolean topic_change ); -
irc_channel.c
rf537044 r006a84f 119 119 120 120 if( ic->flags & IRC_CHANNEL_JOINED ) 121 irc_channel_del_user( ic, irc->user, FALSE, "Cleaning up channel" );121 irc_channel_del_user( ic, irc->user, IRC_CDU_KICK, "Cleaning up channel" ); 122 122 123 123 if( ic->f->_free ) … … 223 223 } 224 224 225 int irc_channel_del_user( irc_channel_t *ic, irc_user_t *iu, gboolean silent, const char *msg )225 int irc_channel_del_user( irc_channel_t *ic, irc_user_t *iu, irc_channel_del_user_type_t type, const char *msg ) 226 226 { 227 227 irc_channel_user_t *icu; … … 233 233 g_free( icu ); 234 234 235 if( ic->flags & IRC_CHANNEL_JOINED && !silent ) 235 if( !( ic->flags & IRC_CHANNEL_JOINED ) || type == IRC_CDU_SILENT ) {} 236 /* Do nothing. The caller should promise it won't screw 237 up state of the IRC client. :-) */ 238 else if( type == IRC_CDU_PART ) 236 239 irc_send_part( ic, iu, msg ); 240 else if( type == IRC_CDU_KICK ) 241 irc_send_kick( ic, iu, ic->irc->root, msg ); 237 242 238 243 if( iu == ic->irc->user ) -
irc_im.c
rf537044 r006a84f 183 183 if( !show ) 184 184 { 185 irc_channel_del_user( ic, iu, FALSE, NULL );185 irc_channel_del_user( ic, iu, IRC_CDU_PART, NULL ); 186 186 } 187 187 else … … 479 479 480 480 ic->data = NULL; 481 irc_channel_del_user( ic, ic->irc->user, FALSE, "Chatroom closed by server" );481 irc_channel_del_user( ic, ic->irc->user, IRC_CDU_KICK, "Chatroom closed by server" ); 482 482 483 483 return TRUE; … … 525 525 using imcb_chat_free() and the channel was IRC_CHANNEL_TEMP, we get into 526 526 a broken state around here. */ 527 irc_channel_del_user( c->ui_data, bu == bee->user ? irc->user : bu->ui_data, FALSE, NULL );527 irc_channel_del_user( c->ui_data, bu == bee->user ? irc->user : bu->ui_data, IRC_CDU_PART, NULL ); 528 528 529 529 return TRUE; -
irc_send.c
rf537044 r006a84f 158 158 } 159 159 160 void irc_send_kick( irc_channel_t *ic, irc_user_t *iu, irc_user_t *kicker, const char *reason ) 161 { 162 irc_write( ic->irc, ":%s!%s@%s KICK %s %s :%s", kicker->nick, kicker->user, 163 kicker->host, ic->name, iu->nick, reason ? : "" ); 164 } 165 160 166 void irc_send_names( irc_channel_t *ic ) 161 167 { -
irc_user.c
rf537044 r006a84f 205 205 206 206 for( l = iu->irc->channels; l; l = l->next ) 207 send_quit |= irc_channel_del_user( (irc_channel_t*) l->data, iu, TRUE, NULL );207 send_quit |= irc_channel_del_user( (irc_channel_t*) l->data, iu, IRC_CDU_SILENT, NULL ); 208 208 209 209 if( send_quit )
Note: See TracChangeset
for help on using the changeset viewer.