diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2010-07-29 19:08:16 +0200 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2010-07-29 19:08:16 +0200 |
commit | 2fe5eb939ff77697b578bf45ba23cd99daee9c5f (patch) | |
tree | 3a13b9bb3b9cde7fc81f325170a30daac1711688 /irc_im.c | |
parent | b40e60db39f0b187774cfd2e0fe1b503f9bf1a54 (diff) |
Clean up references from irc_user structs to channels that are being free()d.
Diffstat (limited to 'irc_im.c')
-rw-r--r-- | irc_im.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -209,13 +209,22 @@ static gboolean bee_irc_user_msg( bee_t *bee, bee_user_t *bu, const char *msg, t irc_user_t *iu = (irc_user_t *) bu->ui_data; char *dst, *prefix = NULL; char *wrapped, *ts = NULL; + irc_channel_t *ic = NULL; if( sent_at > 0 && set_getbool( &irc->b->set, "display_timestamps" ) ) ts = irc_format_timestamp( irc, sent_at ); if( iu->last_channel ) { - dst = iu->last_channel->name; + if( iu->last_channel->flags & IRC_CHANNEL_JOINED ) + ic = iu->last_channel; + else if( irc->default_channel->flags & IRC_CHANNEL_JOINED ) + ic = irc->default_channel; + } + + if( ic ) + { + dst = ic->name; prefix = g_strdup_printf( "%s%s%s", irc->user->nick, set_getstr( &bee->set, "to_char" ), ts ? : "" ); } else |