aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2008-01-20 00:17:57 +0000
committerWilmer van der Gaast <wilmer@gaast.net>2008-01-20 00:17:57 +0000
commit31e584652a5543b87e0953525a742fb067c28e6f (patch)
tree3cb1e401c6ff93f859a2daacadbf9c1b742588fa
parent0adce2151fc2a4f517e558663e5afe010b86a39a (diff)
Added imcb_chat_log() for chatroom system messages, so they can be
displayed inside the right channel.
-rw-r--r--protocols/nogaim.c18
-rw-r--r--protocols/nogaim.h2
2 files changed, 20 insertions, 0 deletions
diff --git a/protocols/nogaim.c b/protocols/nogaim.c
index cfdaa454..3ce15166 100644
--- a/protocols/nogaim.c
+++ b/protocols/nogaim.c
@@ -785,6 +785,24 @@ void imcb_chat_msg( struct groupchat *c, char *who, char *msg, uint32_t flags, t
g_free( wrapped );
}
+void imcb_chat_log( struct groupchat *c, char *format, ... )
+{
+ irc_t *irc = c->ic->irc;
+ va_list params;
+ char *text;
+ user_t *u;
+
+ va_start( params, format );
+ text = g_strdup_vprintf( format, params );
+ va_end( params );
+
+ u = user_find( irc, irc->mynick );
+
+ irc_privmsg( irc, u, "PRIVMSG", c->channel, "System message: ", text );
+
+ g_free( text );
+}
+
void imcb_chat_topic( struct groupchat *c, char *who, char *topic, time_t set_at )
{
struct im_connection *ic = c->ic;
diff --git a/protocols/nogaim.h b/protocols/nogaim.h
index 8ba8fd9e..7d391edd 100644
--- a/protocols/nogaim.h
+++ b/protocols/nogaim.h
@@ -299,6 +299,8 @@ G_MODULE_EXPORT void imcb_chat_add_buddy( struct groupchat *b, char *handle );
G_MODULE_EXPORT void imcb_chat_remove_buddy( struct groupchat *b, char *handle, char *reason );
/* To tell BitlBee 'who' said 'msg' in 'c'. 'flags' and 'sent_at' can be 0. */
G_MODULE_EXPORT void imcb_chat_msg( struct groupchat *c, char *who, char *msg, uint32_t flags, time_t sent_at );
+/* System messages specific to a groupchat, so they can be displayed in the right context. */
+G_MODULE_EXPORT void imcb_chat_log( struct groupchat *c, char *format, ... ) G_GNUC_PRINTF( 2, 3 );
/* To tell BitlBee 'who' changed the topic of 'c' to 'topic'. */
G_MODULE_EXPORT void imcb_chat_topic( struct groupchat *c, char *who, char *topic, time_t set_at );
G_MODULE_EXPORT void imcb_chat_free( struct groupchat *c );