diff util.c @ 345:2e37e715e4a6

add preliminary support for quotetweet and official retweet.
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Sat, 12 Dec 2009 00:18:27 +0900
parents 9f78fb6bfc76
children dbebabe99035
line wrap: on
line diff
--- a/util.c	Mon Oct 19 00:48:25 2009 +0900
+++ b/util.c	Sat Dec 12 00:18:27 2009 +0900
@@ -6,7 +6,6 @@
 
 /* prototypes */
 static gchar *twitter_memrchr(const gchar *s, int c, size_t n);
-void fav_with_api(guint64 id);
 
 
 /* functions */
@@ -485,6 +484,11 @@
         return TRUE;
     }
     else if(strstr(cmd, "retweet-twitter")) {
+        idstr = g_hash_table_lookup(params, "id");
+        retweet_with_api(strtoull(idstr, NULL, 10));
+        return TRUE;
+    }
+    else if(strstr(cmd, "quotetweet-twitter")) {
         gchar *msg0;
         sender = g_hash_table_lookup(params, "user");
         idstr = g_hash_table_lookup(params, "id");
@@ -503,7 +507,7 @@
 
         twitter_debug("sender = %s, id = %llu\n", sender, (unsigned long long)msgid);
 
-        recipient = g_strdup_printf("RT @%s: %s", sender, msg);
+        recipient = g_strdup_printf("QT @%s: %s", sender, msg);
         g_free(msg);
         gtk_text_buffer_insert_at_cursor(gtkconv->entry_buffer,
                                          recipient, -1);
@@ -559,7 +563,8 @@
         linkstr = g_strdup_printf(LINK_FORMAT_TWITTER,
                                   idstr, user,         /* Reply */
                                   idstr,               /* Favorite */
-                                  idstr, user, boddy); /* Retweet */
+                                  idstr,               /* Retweet */
+                                  idstr, user, boddy); /* Quotetweet */
 
         twitter_debug("linkstr = %s\n", linkstr);