aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2010-04-08 01:55:17 +0100
committerWilmer van der Gaast <wilmer@gaast.net>2010-04-08 01:55:17 +0100
commit5b9b2b6413d66df01a866205af489eca9f8ea308 (patch)
tree821d6baee4c15e4660f654fb1c354185043d4592
parent37d84b32ca7f02f2e3b05858e090e2470b8c479b (diff)
Added display_timestamps setting in case some people may not really like them.
-rw-r--r--doc/user-guide/commands.xml10
-rw-r--r--irc.c1
-rw-r--r--protocols/nogaim.c9
3 files changed, 17 insertions, 3 deletions
diff --git a/doc/user-guide/commands.xml b/doc/user-guide/commands.xml
index c8f2de4c..df7ee0a9 100644
--- a/doc/user-guide/commands.xml
+++ b/doc/user-guide/commands.xml
@@ -559,6 +559,16 @@
</description>
</bitlbee-setting>
+ <bitlbee-setting name="display_timestamps" type="boolean" scope="global">
+ <default>true</default>
+
+ <description>
+ <para>
+ When incoming messages are old (i.e. offline messages and channel backlogs), BitlBee will prepend them with a timestamp. If you find them ugly or useless, you can use this setting to hide them.
+ </para>
+ </description>
+ </bitlbee-setting>
+
<bitlbee-setting name="handle_unknown" type="string" scope="global">
<default>root</default>
<possible-values>root, add, add_private, add_channel, ignore</possible-values>
diff --git a/irc.c b/irc.c
index b68c5adb..28fee69d 100644
--- a/irc.c
+++ b/irc.c
@@ -185,6 +185,7 @@ irc_t *irc_new( int fd )
s = set_add( &irc->set, "debug", "false", set_eval_bool, irc );
s = set_add( &irc->set, "default_target", "root", NULL, irc );
s = set_add( &irc->set, "display_namechanges", "false", set_eval_bool, irc );
+ s = set_add( &irc->set, "display_timestamps", "true", set_eval_bool, irc );
s = set_add( &irc->set, "handle_unknown", "root", NULL, irc );
s = set_add( &irc->set, "lcnicks", "true", set_eval_bool, irc );
s = set_add( &irc->set, "ops", "both", set_eval_ops, irc );
diff --git a/protocols/nogaim.c b/protocols/nogaim.c
index 53e459b5..36d97f51 100644
--- a/protocols/nogaim.c
+++ b/protocols/nogaim.c
@@ -723,7 +723,7 @@ void imcb_buddy_status( struct im_connection *ic, const char *handle, int flags,
void imcb_buddy_msg( struct im_connection *ic, const char *handle, char *msg, uint32_t flags, time_t sent_at )
{
irc_t *irc = ic->irc;
- char *wrapped, *ts;
+ char *wrapped, *ts = NULL;
user_t *u;
u = user_findhandle( ic, handle );
@@ -766,7 +766,8 @@ void imcb_buddy_msg( struct im_connection *ic, const char *handle, char *msg, ui
( ( ic->flags & OPT_DOES_HTML ) && set_getbool( &ic->irc->set, "strip_html" ) ) )
strip_html( msg );
- if( ( ts = format_timestamp( irc, sent_at ) ) )
+ if( set_getbool( &ic->irc->set, "display_timestamps" ) &&
+ ( ts = format_timestamp( irc, sent_at ) ) )
{
char *new = g_strconcat( ts, msg, NULL );
g_free( ts );
@@ -880,7 +881,9 @@ void imcb_chat_msg( struct groupchat *c, const char *who, char *msg, uint32_t fl
wrapped = word_wrap( msg, 425 );
if( c && u )
{
- char *ts = format_timestamp( ic->irc, sent_at );
+ char *ts = NULL;
+ if( set_getbool( &ic->irc->set, "display_timestamps" ) )
+ ts = format_timestamp( ic->irc, sent_at );
irc_privmsg( ic->irc, u, "PRIVMSG", c->channel, ts ? : "", wrapped );
g_free( ts );
}