diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2010-04-14 15:35:41 +0200 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2010-04-14 15:35:41 +0200 |
commit | 003a12bd2361cd1ce4d83eeaa1b81d95101ea778 (patch) | |
tree | db8349d136c9beecdb8b85f08e81d2f7fa4816d2 /irc_im.c | |
parent | d7d677dac118a1240ada9ddcc8617c49293e5a5e (diff) |
Restored all remaining IRC commands that make some sense to have at this
point.
Diffstat (limited to 'irc_im.c')
-rw-r--r-- | irc_im.c | 17 |
1 files changed, 15 insertions, 2 deletions
@@ -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; |