diff pidgin-twitter.c @ 202:67d8eaba446d

preliminary identi.ca tag support.
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Tue, 12 Aug 2008 17:26:40 +0900
parents 0aeeafe37ef7
children 6c6fe6375ce4
line wrap: on
line diff
--- a/pidgin-twitter.c	Tue Aug 12 15:20:58 2008 +0900
+++ b/pidgin-twitter.c	Tue Aug 12 17:26:40 2008 +0900
@@ -881,7 +881,7 @@
         g_free(match1);
         g_free(match2);
     }
-    else if(service == wassr_service && which == CHANNEL) {
+    else if(which == CHANNEL && service == wassr_service) {
         gchar *match1 = g_match_info_fetch(match_info, 1); /*before channel*/
         gchar *match2 = g_match_info_fetch(match_info, 2); /* channel */
         const gchar *format = CHANNEL_FORMAT_WASSR;
@@ -891,6 +891,16 @@
         g_free(match1);
         g_free(match2);
     }
+    else if(which == CHANNEL && service == identica_service) {
+        gchar *match1 = g_match_info_fetch(match_info, 1); /*before channel*/
+        gchar *match2 = g_match_info_fetch(match_info, 2); /* channel */
+        const gchar *format = CHANNEL_FORMAT_IDENTICA;
+
+        g_snprintf(sub, 128, format, match1 ? match1: "", match2, match2);
+
+        g_free(match1);
+        g_free(match2);
+    }
 
     g_string_append(result, sub);
     twitter_debug("sub = %s\n", sub);
@@ -1021,12 +1031,16 @@
     if(purple_prefs_get_bool(OPT_TRANSLATE_SENDER)) {
         translate(buffer, SENDER, service);
     }
+    if(purple_prefs_get_bool(OPT_TRANSLATE_RECIPIENT)) {
+        translate(buffer, RECIPIENT, service);
+    }
     if(service == wassr_service &&
        purple_prefs_get_bool(OPT_TRANSLATE_CHANNEL)) {
         translate(buffer, CHANNEL, service);
     }
-    if(purple_prefs_get_bool(OPT_TRANSLATE_RECIPIENT)) {
-        translate(buffer, RECIPIENT, service);
+    if(service == identica_service &&
+       purple_prefs_get_bool(OPT_TRANSLATE_CHANNEL)) {
+        translate(buffer, CHANNEL, service);
     }
 
     /* escape pseudo command (to show same result to sending message) */