aboutsummaryrefslogtreecommitdiffstats
path: root/irc_im.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2010-12-07 23:14:30 +0000
committerWilmer van der Gaast <wilmer@gaast.net>2010-12-07 23:14:30 +0000
commita97a336d7d3dbe83f1be750c4f1fe8f1179c7066 (patch)
treeaa71d639d742091366938acd82a1950e32a4cf55 /irc_im.c
parentd76e12f6762d0a13cbafd50ebad29baf60b7df8a (diff)
Add CTCP HELP code. Also cleaning up some noop handlers in the Twitter
module (chat_with and send_typing) that suggested support for features that obviously don't exist.
Diffstat (limited to 'irc_im.c')
-rw-r--r--irc_im.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/irc_im.c b/irc_im.c
index 074d8d2c..15c5783d 100644
--- a/irc_im.c
+++ b/irc_im.c
@@ -512,6 +512,26 @@ static gboolean bee_irc_user_ctcp( irc_user_t *iu, char *const *ctcp )
return TRUE;
}
}
+ else if( g_strcasecmp( ctcp[0], "HELP" ) == 0 && iu->bu )
+ {
+ GString *supp = g_string_new( "Supported CTCPs:" );
+ GList *l;
+
+ if( iu->bu->ic && iu->bu->ic->acc->prpl->transfer_request )
+ g_string_append( supp, " DCC SEND," );
+ if( iu->bu->ic && iu->bu->ic->acc->prpl->send_typing )
+ g_string_append( supp, " TYPING," );
+ if( iu->bu->ic->acc->prpl->buddy_action_list )
+ for( l = iu->bu->ic->acc->prpl->buddy_action_list( iu->bu ); l; l = l->next )
+ {
+ struct buddy_action *ba = l->data;
+ g_string_append_printf( supp, " %s (%s),",
+ ba->name, ba->description );
+ }
+ g_string_truncate( supp, supp->len - 1 );
+ irc_send_msg_f( iu, "NOTICE", iu->irc->user->nick, "\001HELP %s\001", supp->str );
+ g_string_free( supp, 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 );