aboutsummaryrefslogtreecommitdiffstats
path: root/irc_im.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2010-06-11 17:12:27 +0200
committerWilmer van der Gaast <wilmer@gaast.net>2010-06-11 17:12:27 +0200
commit1c8e5f7fba87b6096a7fd86508ca1821876abb54 (patch)
tree4550a2bac9ceb7e7d60f98fdb87242a1a7c036d1 /irc_im.c
parent70ac4771ebf3358d7bec9bd6fe37cde4c23223bc (diff)
Added away_reply_timeout setting so BitlBee will suppress away messages sent
in response to PRIVMSG if one was sent recently - some IRC clients including irssi don't do this very well (when talking to >1 people who are away for example).
Diffstat (limited to 'irc_im.c')
-rw-r--r--irc_im.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/irc_im.c b/irc_im.c
index 3dca5c3d..ee86d4b1 100644
--- a/irc_im.c
+++ b/irc_im.c
@@ -113,6 +113,9 @@ static gboolean bee_irc_user_status( bee_t *bee, bee_user_t *bu, bee_user_t *old
}
}
+ /* Reset this one since the info may have changed. */
+ iu->away_reply_timeout = 0;
+
bee_irc_channel_update( irc, NULL, iu );
return TRUE;
@@ -319,9 +322,20 @@ static gboolean bee_irc_user_privmsg_cb( gpointer data, gint fd, b_input_conditi
static gboolean bee_irc_user_privmsg( irc_user_t *iu, const char *msg )
{
+ const char *away;
+
if( iu->bu == NULL )
return FALSE;
- else if( set_getbool( &iu->irc->b->set, "paste_buffer" ) )
+
+ if( ( away = irc_user_get_away( iu ) ) &&
+ time( NULL ) >= iu->away_reply_timeout )
+ {
+ irc_send_num( iu->irc, 301, "%s :%s", iu->nick, away );
+ iu->away_reply_timeout = time( NULL ) +
+ set_getint( &iu->irc->b->set, "away_reply_timeout" );
+ }
+
+ if( set_getbool( &iu->irc->b->set, "paste_buffer" ) )
{
int delay;