aboutsummaryrefslogtreecommitdiffstats
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
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.
-rw-r--r--doc/user-guide/commands.xml1
-rw-r--r--protocols/twitter/twitter.c9
2 files changed, 10 insertions, 0 deletions
diff --git a/doc/user-guide/commands.xml b/doc/user-guide/commands.xml
index 682c5dc1..6ce19774 100644
--- a/doc/user-guide/commands.xml
+++ b/doc/user-guide/commands.xml
@@ -846,6 +846,7 @@
<varlistentry><term>undo #[&lt;id&gt;]</term><listitem><para>Delete your last Tweet (or one with the given ID)</para></listitem></varlistentry>
<varlistentry><term>rt &lt;screenname|#id&gt;</term><listitem><para>Retweet someone's last Tweet (or one with the given ID)</para></listitem></varlistentry>
<varlistentry><term>reply &lt;screenname|#id&gt;</term><listitem><para>Reply to a Tweet (with a reply-to reference)</para></listitem></varlistentry>
+ <varlistentry><term>rawreply &lt;screenname|#id&gt;</term><listitem><para>Reply to a Tweet (with no reply-to reference)</para></listitem></varlistentry>
<varlistentry><term>report &lt;screenname|#id&gt;</term><listitem><para>Report the given user (or the user who posted the tweet with the given ID) for sending spam. This will also block them.</para></listitem></varlistentry>
<varlistentry><term>follow &lt;screenname&gt;</term><listitem><para>Start following a person</para></listitem></varlistentry>
<varlistentry><term>unfollow &lt;screenname&gt;</term><listitem><para>Stop following a person</para></listitem></varlistentry>
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;