Changeset 0bd948e
- Timestamp:
- 2010-07-03T21:16:41Z (14 years ago)
- Branches:
- master
- Children:
- c8eeadd
- Parents:
- 917a83e
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
irc.c
r917a83e r0bd948e 108 108 s = set_add( &b->set, "handle_unknown", "add_channel", NULL, irc ); 109 109 s = set_add( &b->set, "lcnicks", "true", set_eval_bool, irc ); 110 s = set_add( &b->set, "offline_user_quits", "true", set_eval_bool, irc ); 110 111 s = set_add( &b->set, "ops", "both", set_eval_irc_channel_ops, irc ); 111 112 s = set_add( &b->set, "paste_buffer", "false", set_eval_bool, irc ); -
irc.h
r917a83e r0bd948e 273 273 gint irc_user_cmp( gconstpointer a_, gconstpointer b_ ); 274 274 const char *irc_user_get_away( irc_user_t *iu ); 275 void irc_user_quit( irc_user_t *iu, const char *msg ); 275 276 276 277 /* irc_util.c */ -
irc_im.c
r917a83e r0bd948e 108 108 irc_send_num( irc, 601, "%s %s %s %d :%s", iu->nick, iu->user, 109 109 iu->host, (int) time( NULL ), "logged offline" ); 110 111 /* Send a QUIT since those will also show up in any 112 query windows the user may have, plus it's only 113 one QUIT instead of possibly many (in case of 114 multiple control chans). If there's a channel that 115 shows offline people, a JOIN will follow. */ 116 if( set_getbool( &bee->set, "offline_user_quits" ) ) 117 irc_user_quit( iu, "Leaving..." ); 110 118 } 111 119 } -
irc_user.c
r917a83e r0bd948e 52 52 int irc_user_free( irc_t *irc, irc_user_t *iu ) 53 53 { 54 GSList *l;55 gboolean send_quit = FALSE;54 static struct im_connection *last_ic; 55 static char *msg; 56 56 57 57 if( !iu ) 58 58 return 0; 59 59 60 if( iu->bu && 61 ( iu->bu->ic->flags & OPT_LOGGING_OUT ) && 62 iu->bu->ic != last_ic ) 63 { 64 char host_prefix[] = "bitlbee."; 65 char *s; 66 67 /* Irssi recognises netsplits by quitmsgs with two 68 hostnames, where a hostname is a "word" with one 69 of more dots. Mangle no-dot hostnames a bit. */ 70 if( strchr( irc->root->host, '.' ) ) 71 *host_prefix = '\0'; 72 73 last_ic = iu->bu->ic; 74 g_free( msg ); 75 if( !set_getbool( &irc->b->set, "simulate_netsplit" ) ) 76 msg = g_strdup( "Account off-line" ); 77 else if( ( s = strchr( iu->bu->ic->acc->user, '@' ) ) ) 78 msg = g_strdup_printf( "%s%s %s", host_prefix, 79 irc->root->host, s + 1 ); 80 else 81 msg = g_strdup_printf( "%s%s %s.%s", 82 host_prefix, irc->root->host, 83 iu->bu->ic->acc->prpl->name, irc->root->host ); 84 } 85 else if( !iu->bu || !( iu->bu->ic->flags & OPT_LOGGING_OUT ) ) 86 { 87 g_free( msg ); 88 msg = g_strdup( "Removed" ); 89 last_ic = NULL; 90 } 91 irc_user_quit( iu, msg ); 92 60 93 irc->users = g_slist_remove( irc->users, iu ); 61 94 g_hash_table_remove( irc->nick_user_hash, iu->key ); 62 63 for( l = irc->channels; l; l = l->next )64 send_quit |= irc_channel_del_user( (irc_channel_t*) l->data, iu, TRUE, NULL );65 66 if( send_quit )67 {68 static struct im_connection *last_ic;69 static char *msg;70 71 if( iu->bu &&72 ( iu->bu->ic->flags & OPT_LOGGING_OUT ) &&73 iu->bu->ic != last_ic )74 {75 char host_prefix[] = "bitlbee.";76 char *s;77 78 /* Irssi recognises netsplits by quitmsgs with two79 hostnames, where a hostname is a "word" with one80 of more dots. Mangle no-dot hostnames a bit. */81 if( strchr( irc->root->host, '.' ) )82 *host_prefix = '\0';83 84 last_ic = iu->bu->ic;85 g_free( msg );86 if( !set_getbool( &irc->b->set, "simulate_netsplit" ) )87 msg = g_strdup( "Account off-line" );88 else if( ( s = strchr( iu->bu->ic->acc->user, '@' ) ) )89 msg = g_strdup_printf( "%s%s %s", host_prefix,90 irc->root->host, s + 1 );91 else92 msg = g_strdup_printf( "%s%s %s.%s",93 host_prefix, irc->root->host,94 iu->bu->ic->acc->prpl->name, irc->root->host );95 }96 else if( !iu->bu || !( iu->bu->ic->flags & OPT_LOGGING_OUT ) )97 {98 g_free( msg );99 msg = g_strdup( "Removed" );100 last_ic = NULL;101 }102 irc_send_quit( iu, msg );103 }104 95 105 96 g_free( iu->nick ); … … 205 196 } 206 197 198 void irc_user_quit( irc_user_t *iu, const char *msg ) 199 { 200 GSList *l; 201 gboolean send_quit = FALSE; 202 203 if( !iu ) 204 return; 205 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 ); 208 209 if( send_quit ) 210 irc_send_quit( iu, msg ); 211 } 212 207 213 /* User-type dependent functions, for root/NickServ: */ 208 214 static gboolean root_privmsg( irc_user_t *iu, const char *msg )
Note: See TracChangeset
for help on using the changeset viewer.