From 231b08b07a2807881da1327408e33855370b7b95 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Thu, 1 Apr 2010 22:54:39 -0400 Subject: Show buddy online/offline status in the first channel. --- irc_im.c | 11 +++++++++++ protocols/bee_user.c | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/irc_im.c b/irc_im.c index 07b478fb..9a4ce176 100644 --- a/irc_im.c +++ b/irc_im.c @@ -75,6 +75,17 @@ static gboolean bee_irc_user_free( bee_t *bee, bee_user_t *bu ) static gboolean bee_irc_user_status( bee_t *bee, bee_user_t *bu, bee_user_t *old ) { + irc_t *irc = bee->ui_data; + irc_channel_t *ic = irc->channels->data; /* For now, just pick the first channel. */ + + if( ( bu->flags & BEE_USER_ONLINE ) != ( old->flags & BEE_USER_ONLINE ) ) + { + if( bu->flags & BEE_USER_ONLINE ) + irc_channel_add_user( ic, (irc_user_t*) bu->ui_data ); + else + irc_channel_del_user( ic, (irc_user_t*) bu->ui_data ); + } + return TRUE; } diff --git a/protocols/bee_user.c b/protocols/bee_user.c index 2c11ca1d..cbcebe33 100644 --- a/protocols/bee_user.c +++ b/protocols/bee_user.c @@ -74,7 +74,7 @@ bee_user_t *bee_user_by_handle( bee_t *bee, struct im_connection *ic, const char { bee_user_t *bu = l->data; - if( bu->ic == ic && ic->acc->prpl->handle_cmp( bu->handle, handle ) ) + if( bu->ic == ic && ic->acc->prpl->handle_cmp( bu->handle, handle ) == 0 ) return bu; } -- cgit v1.2.3