diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2015-01-17 20:13:19 +0000 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2015-01-17 20:13:19 +0000 |
commit | eb4ad8d31f7ed4210f24beb8753ecce594b0beef (patch) | |
tree | f7f9cf04738522a79f874e0e8ce9b915014861fc /protocols/bee_chat.c | |
parent | 1065dd4f38c81c83934ba51526471072837700ae (diff) | |
parent | 664bac38fcdf6889d3ceb29b73a0c3a4e27820ce (diff) |
Merging random other fixes/cleanups.
Diffstat (limited to 'protocols/bee_chat.c')
-rw-r--r-- | protocols/bee_chat.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/protocols/bee_chat.c b/protocols/bee_chat.c index 1b741730..39110a10 100644 --- a/protocols/bee_chat.c +++ b/protocols/bee_chat.c @@ -84,6 +84,7 @@ void imcb_chat_msg( struct groupchat *c, const char *who, char *msg, uint32_t fl struct im_connection *ic = c->ic; bee_t *bee = ic->bee; bee_user_t *bu; + gboolean temp; char *s; /* Gaim sends own messages through this too. IRC doesn't want this, so kill them */ @@ -91,16 +92,21 @@ void imcb_chat_msg( struct groupchat *c, const char *who, char *msg, uint32_t fl return; bu = bee_user_by_handle( bee, ic, who ); + temp = ( bu == NULL ); + + if( temp ) + bu = bee_user_new( bee, ic, who, BEE_USER_ONLINE ); s = set_getstr( &ic->bee->set, "strip_html" ); if( ( g_strcasecmp( s, "always" ) == 0 ) || ( ( ic->flags & OPT_DOES_HTML ) && s ) ) strip_html( msg ); - if( bu && bee->ui->chat_msg ) + if( bee->ui->chat_msg ) bee->ui->chat_msg( bee, c, bu, msg, sent_at ); - else - imcb_chat_log( c, "Message from unknown participant %s: %s", who, msg ); + + if( temp ) + bee_user_free( bee, bu ); } void imcb_chat_log( struct groupchat *c, char *format, ... ) |