aboutsummaryrefslogtreecommitdiffstats
path: root/irc_im.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2010-12-06 00:03:49 +0000
committerWilmer van der Gaast <wilmer@gaast.net>2010-12-06 00:03:49 +0000
commitd88c92a40438e0ac8e897beb3ead44c4404050b3 (patch)
tree8dd4e41d7490e49501386e57cb281463b9bce7b1 /irc_im.c
parenta429907207d5b8b05463c72a9b8c880ba03ad921 (diff)
First bits of CTCP support to contacts. (Try /CTCP VERSION on a Jabber
contact.)
Diffstat (limited to 'irc_im.c')
-rw-r--r--irc_im.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/irc_im.c b/irc_im.c
index b0cd3bdf..074d8d2c 100644
--- a/irc_im.c
+++ b/irc_im.c
@@ -279,6 +279,27 @@ static gboolean bee_irc_user_typing( bee_t *bee, bee_user_t *bu, uint32_t flags
return TRUE;
}
+static gboolean bee_irc_user_action_response( bee_t *bee, bee_user_t *bu, const char *action, char * const args[], void *data )
+{
+ irc_t *irc = (irc_t *) bee->ui_data;
+ GString *msg = g_string_new( "\001" );
+
+ g_string_append( msg, action );
+ while( *args )
+ {
+ if( strchr( *args, ' ' ) )
+ g_string_append_printf( msg, " \"%s\"", *args );
+ else
+ g_string_append_printf( msg, " %s", *args );
+ args ++;
+ }
+ g_string_append_c( msg, '\001' );
+
+ irc_send_msg( (irc_user_t *) bu->ui_data, "NOTICE", irc->user->nick, msg->str, NULL );
+
+ return TRUE;
+}
+
static gboolean bee_irc_user_nick_update( irc_user_t *iu );
static gboolean bee_irc_user_fullname( bee_t *bee, bee_user_t *bu )
@@ -491,6 +512,10 @@ static gboolean bee_irc_user_ctcp( irc_user_t *iu, char *const *ctcp )
return TRUE;
}
}
+ else if( iu->bu && iu->bu->ic && iu->bu->ic->acc->prpl->buddy_action )
+ {
+ iu->bu->ic->acc->prpl->buddy_action( iu->bu, ctcp[0], ctcp + 1, NULL );
+ }
return FALSE;
}
@@ -1040,6 +1065,7 @@ const struct bee_ui_funcs irc_ui_funcs = {
bee_irc_user_status,
bee_irc_user_msg,
bee_irc_user_typing,
+ bee_irc_user_action_response,
bee_irc_chat_new,
bee_irc_chat_free,