From dfaa46d37c5a71e7d8c413c7c9714db854b8b559 Mon Sep 17 00:00:00 2001 From: William Pettersson Date: Mon, 26 Jan 2015 04:37:14 -0300 Subject: twitter: Add raw reply support By default, "reply" prepends the username of the tweet being replied to. This adds support for a "rawreply" command which does not prepend this username. This is useful for "replying" to your own tweet to maintain a chain of tweets on a singular topic. --- protocols/twitter/twitter.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'protocols/twitter/twitter.c') diff --git a/protocols/twitter/twitter.c b/protocols/twitter/twitter.c index edc81427..eb30187f 100644 --- a/protocols/twitter/twitter.c +++ b/protocols/twitter/twitter.c @@ -931,6 +931,15 @@ static void twitter_handle_command(struct im_connection *ic, char *message) message = new = g_strdup_printf("@%s %s", bu->handle, cmd[2]); in_reply_to = id; allow_post = TRUE; + } else if (g_strcasecmp(cmd[0], "rawreply") == 0 && cmd[1] && cmd[2]) { + id = twitter_message_id_from_command_arg(ic, cmd[1], NULL); + if (!id) { + twitter_log(ic, "Tweet `%s' does not exist", cmd[1]); + goto eof; + } + message = cmd[2]; + in_reply_to = id; + allow_post = TRUE; } else if (g_strcasecmp(cmd[0], "post") == 0) { message += 5; allow_post = TRUE; -- cgit v1.2.3