aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/twitter/twitter.c
diff options
context:
space:
mode:
authorWilliam Pettersson <william.pettersson@gmail.com>2015-01-26 04:37:14 -0300
committerdequis <dx@dxzone.com.ar>2015-01-26 04:50:45 -0300
commitdfaa46d37c5a71e7d8c413c7c9714db854b8b559 (patch)
tree45b2a2dfe5fcd6f37001dd48caba31795cf037f0 /protocols/twitter/twitter.c
parent73ee390abec21c2b724175d4a5c9cfc27aa85bcf (diff)
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.
Diffstat (limited to 'protocols/twitter/twitter.c')
-rw-r--r--protocols/twitter/twitter.c9
1 files changed, 9 insertions, 0 deletions
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;