diff options
-rw-r--r-- | doc/CHANGES | 1 | ||||
-rw-r--r-- | doc/user-guide/commands.xml | 4 | ||||
-rw-r--r-- | doc/user-guide/help.txt | 4 | ||||
-rw-r--r-- | doc/user-guide/user-guide.html | 2 | ||||
-rw-r--r-- | doc/user-guide/user-guide.txt | 4 | ||||
-rw-r--r-- | irc.c | 11 |
6 files changed, 18 insertions, 8 deletions
diff --git a/doc/CHANGES b/doc/CHANGES index b8ca1047..f39e2b96 100644 --- a/doc/CHANGES +++ b/doc/CHANGES @@ -2,6 +2,7 @@ Version 1.0: - Removed some crashy debugging code. - QUIT command now works before logging in. (Mainly an RFC-compliancy fix.) - Hopefully slightly clearer handling of buddy add requests. +- set buddy_sendbuffer_delay now also supports milisecond precision. Finished ... diff --git a/doc/user-guide/commands.xml b/doc/user-guide/commands.xml index 1fc30e6d..cdd6f6a1 100644 --- a/doc/user-guide/commands.xml +++ b/doc/user-guide/commands.xml @@ -461,10 +461,12 @@ </bitlbee-setting> <bitlbee-setting name="buddy_sendbuffer_delay" type="integer"> + <default>200</default> + <description> <para> - Tell BitlBee after how many seconds a buffered message should be sent. + Tell BitlBee after how many (mili)seconds a buffered message should be sent. Values greater than 5 will be interpreted as miliseconds, 5 and lower as seconds. </para> <para> diff --git a/doc/user-guide/help.txt b/doc/user-guide/help.txt index b6c88da3..fe7dc27b 100644 --- a/doc/user-guide/help.txt +++ b/doc/user-guide/help.txt @@ -436,9 +436,9 @@ Please note that if you remove a buddy from your list (or if the connection to t % ?set buddy_sendbuffer_delay Type: integer -Default: +Default: 200 -Tell BitlBee after how many seconds a buffered message should be sent. +Tell BitlBee after how many (mili)seconds a buffered message should be sent. Values greater than 5 will be interpreted as miliseconds, 5 and lower as seconds. See also the buddy_sendbuffer setting. % diff --git a/doc/user-guide/user-guide.html b/doc/user-guide/user-guide.html index 8bd7f716..3c34bf31 100644 --- a/doc/user-guide/user-guide.html +++ b/doc/user-guide/user-guide.html @@ -331,7 +331,7 @@ allow <connection> <handle> </p><p> Please note that if you remove a buddy from your list (or if the connection to that user drops) and there's still data in the buffer, this data will be lost. BitlBee will not try to send the message to the user in those cases. </p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="set_buddy_sendbuffer_delay"></a>buddy_sendbuffer_delay</h2></div></div></div><table class="simplelist" border="0" summary="Simple list"><tr><td>Type: integer</td></tr></table><p> - Tell BitlBee after how many seconds a buffered message should be sent. + Tell BitlBee after how many (mili)seconds a buffered message should be sent. Values greater than 5 will be interpreted as miliseconds, 5 and lower as seconds. </p><p> See also the <span class="emphasis"><em>buddy_sendbuffer</em></span> setting. </p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="set_default_target"></a>default_target</h2></div></div></div><table class="simplelist" border="0" summary="Simple list"><tr><td>Type: string</td></tr></table><p> diff --git a/doc/user-guide/user-guide.txt b/doc/user-guide/user-guide.txt index 449dd4de..63d3a67a 100644 --- a/doc/user-guide/user-guide.txt +++ b/doc/user-guide/user-guide.txt @@ -800,7 +800,9 @@ buddy_sendbuffer_delay Type: integer -Tell BitlBee after how many seconds a buffered message should be sent. +Tell BitlBee after how many (mili)seconds a buffered message should be sent. +Values greater than 5 will be interpreted as miliseconds, 5 and lower as +seconds. See also the buddy_sendbuffer setting. @@ -114,7 +114,7 @@ irc_t *irc_new( int fd ) set_add( irc, "auto_reconnect", "false", set_eval_bool ); set_add( irc, "auto_reconnect_delay", "300", set_eval_int ); set_add( irc, "buddy_sendbuffer", "false", set_eval_bool ); - set_add( irc, "buddy_sendbuffer_delay", "1", set_eval_int ); + set_add( irc, "buddy_sendbuffer_delay", "200", set_eval_int ); set_add( irc, "charset", "iso8859-1", set_eval_charset ); set_add( irc, "debug", "false", set_eval_bool ); set_add( irc, "default_target", "root", NULL ); @@ -1427,6 +1427,8 @@ int buddy_send_handler( irc_t *irc, user_t *u, char *msg, int flags ) if( set_getint( irc, "buddy_sendbuffer" ) && set_getint( irc, "buddy_sendbuffer_delay" ) > 0 ) { + int delay; + if( u->sendbuf_len > 0 && u->sendbuf_flags != flags) { //Flush the buffer @@ -1450,10 +1452,13 @@ int buddy_send_handler( irc_t *irc, user_t *u, char *msg, int flags ) strcat( u->sendbuf, msg ); strcat( u->sendbuf, "\n" ); + delay = set_getint( irc, "buddy_sendbuffer_delay" ); + if( delay <= 5 ) + delay *= 1000; + if( u->sendbuf_timer > 0 ) g_source_remove( u->sendbuf_timer ); - u->sendbuf_timer = g_timeout_add( set_getint( irc, "buddy_sendbuffer_delay" ) * 1000, - buddy_send_handler_delayed, u ); + u->sendbuf_timer = g_timeout_add( delay, buddy_send_handler_delayed, u ); return( 1 ); } |