Changeset 1c8e5f7


Ignore:
Timestamp:
2010-06-11T15:12:27Z (14 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
12b29db
Parents:
70ac477
Message:

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).

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • doc/user-guide/commands.xml

    r70ac477 r1c8e5f7  
    484484        </bitlbee-setting>
    485485
     486        <bitlbee-setting name="away_reply_timeout" type="integer" scope="global">
     487                <default>3600</default>
     488
     489                <description>
     490                        <para>
     491                                Most IRC servers send a user's away message every time s/he gets a private message, to inform the sender that they may not get a response immediately. With this setting set to 0, BitlBee will also behave like this.
     492                        </para>
     493
     494                        <para>
     495                                Since not all IRC clients do an excellent job at suppressing these messages, this setting lets BitlBee do it instead. BitlBee will wait this many seconds (or until the away state/message changes) before re-informing you that the person's away.
     496                        </para>
     497                </description>
     498        </bitlbee-setting>
     499
    486500        <bitlbee-setting name="buddy_sendbuffer" type="boolean" scope="global">
    487501                <default>false</default>
  • irc.c

    r70ac477 r1c8e5f7  
    101101       
    102102        s = set_add( &b->set, "away_devoice", "true", set_eval_away_devoice, irc );
     103        s = set_add( &b->set, "away_reply_timeout", "3600", set_eval_int, irc );
    103104        s = set_add( &b->set, "charset", "utf-8", set_eval_charset, irc );
    104105        s = set_add( &b->set, "default_target", "root", NULL, irc );
  • irc.h

    r70ac477 r1c8e5f7  
    109109        irc_user_flags_t flags;
    110110       
    111         GString *pastebuf;
     111        GString *pastebuf; /* Paste buffer (combine lines into a multiline msg). */
    112112        guint pastebuf_timer;
     113        time_t away_reply_timeout; /* Only send a 301 if this time passed. */
    113114       
    114115        struct bee_user *bu;
     
    146147        time_t topic_time;
    147148       
    148         GSList *users;
     149        GSList *users; /* struct irc_channel_user */
    149150        struct set *set;
    150151       
    151         GString *pastebuf;
     152        GString *pastebuf; /* Paste buffer (combine lines into a multiline msg). */
    152153        guint pastebuf_timer;
    153154       
  • irc_im.c

    r70ac477 r1c8e5f7  
    114114        }
    115115       
     116        /* Reset this one since the info may have changed. */
     117        iu->away_reply_timeout = 0;
     118       
    116119        bee_irc_channel_update( irc, NULL, iu );
    117120       
     
    320323static gboolean bee_irc_user_privmsg( irc_user_t *iu, const char *msg )
    321324{
     325        const char *away;
     326       
    322327        if( iu->bu == NULL )
    323328                return FALSE;
    324         else if( set_getbool( &iu->irc->b->set, "paste_buffer" ) )
     329       
     330        if( ( away = irc_user_get_away( iu ) ) &&
     331            time( NULL ) >= iu->away_reply_timeout )
     332        {
     333                irc_send_num( iu->irc, 301, "%s :%s", iu->nick, away );
     334                iu->away_reply_timeout = time( NULL ) +
     335                        set_getint( &iu->irc->b->set, "away_reply_timeout" );
     336        }
     337       
     338        if( set_getbool( &iu->irc->b->set, "paste_buffer" ) )
    325339        {
    326340                int delay;
Note: See TracChangeset for help on using the changeset viewer.