From 003a12bd2361cd1ce4d83eeaa1b81d95101ea778 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Wed, 14 Apr 2010 15:35:41 +0200 Subject: Restored all remaining IRC commands that make some sense to have at this point. --- irc_im.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'irc_im.c') diff --git a/irc_im.c b/irc_im.c index dd015ba9..d6f66d74 100644 --- a/irc_im.c +++ b/irc_im.c @@ -79,14 +79,27 @@ 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_user_t *iu = bu->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 ); + { + if( g_hash_table_lookup( irc->watches, iu->key ) ) + irc_send_num( irc, 600, "%s %s %s %d :%s", iu->nick, iu->user, + iu->host, (int) time( NULL ), "logged online" ); + + irc_channel_add_user( ic, iu ); + } else - irc_channel_del_user( ic, (irc_user_t*) bu->ui_data ); + { + if( g_hash_table_lookup( irc->watches, iu->key ) ) + irc_send_num( irc, 601, "%s %s %s %d :%s", iu->nick, iu->user, + iu->host, (int) time( NULL ), "logged offline" ); + + irc_channel_del_user( ic, iu ); + } } return TRUE; -- cgit v1.2.3