# HG changeset patch # User Tim Ringenbach # Date 1086154736 0 # Node ID 10bdd25f367f91f7e65dafe90df09bcba0483829 # Parent 1e51236d825e4222f369cd697553c59bd2495c35 [gaim-migrate @ 9952] This adds a /me command, which just sends its argument with /me prepended. Certain protocols have their own /me commands registered, which take priorty over this /me command. There's still two problems. 1. W and S aren't implemented yet, so /me's and anything else using W or S behave as though w or s were used. I.e. /me sends with no formatting. 2. Commands aren't added to the ctrl-up send_history. They should be. We also still need /help. And the bad command error messages like "Syntax Error" need to be made more clear. committer: Tailor Script diff -r 1e51236d825e -r 10bdd25f367f src/gtkconv.c --- a/src/gtkconv.c Wed Jun 02 05:08:49 2004 +0000 +++ b/src/gtkconv.c Wed Jun 02 05:38:56 2004 +0000 @@ -342,6 +342,23 @@ return "/"; } +static GaimCmdRet +me_command_cb(GaimConversation *conv, + const char *cmd, char **args, char **error) +{ + char *tmp; + + tmp = g_strdup_printf("/me %s", args[0]); + + if (gaim_conversation_get_type(conv) == GAIM_CONV_IM) + gaim_conv_im_send(GAIM_CONV_IM(conv), tmp); + else if (gaim_conversation_get_type(conv) == GAIM_CONV_CHAT) + gaim_conv_chat_send(GAIM_CONV_CHAT(conv), tmp); + + g_free(tmp); + return GAIM_CMD_RET_OK; +} + static void send_cb(GtkWidget *widget, GaimConversation *conv) { @@ -5938,6 +5955,14 @@ GAIM_SUBTYPE_CONV_WINDOW), gaim_value_new(GAIM_TYPE_SUBTYPE, GAIM_SUBTYPE_CONV_WINDOW)); + + /********************************************************************** + * Register commands + **********************************************************************/ + gaim_cmd_register("me", "S", GAIM_CMD_P_DEFAULT, + GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_IM, NULL, + me_command_cb, _("Send an IRC style action to a buddy or chat.")); + } void