diff main.c @ 331:b4c846870b3c

improved handling of RT string
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Tue, 13 Oct 2009 02:45:03 +0900
parents cc41ee1f5d3a
children 227852ee649c
line wrap: on
line diff
--- a/main.c	Mon Oct 12 21:51:13 2009 +0900
+++ b/main.c	Tue Oct 13 02:45:03 2009 +0900
@@ -362,6 +362,7 @@
     twitter_debug("called\n");
 
     gint service = get_service_type(conv);
+    gchar *linkstr = NULL, *tmpstr = NULL;
 
     /* check if the conversation is between twitter */
     if(service == unknown_service)
@@ -398,7 +399,8 @@
     } /* send */
 
     /* strip all markups */
-    strip_markup(buffer, TRUE);
+//    strip_markup(buffer, TRUE);
+    strip_markup(buffer, FALSE);
 
     /* playsound */
     if(purple_prefs_get_bool(OPT_PLAYSOUND_SENDER)) {
@@ -409,14 +411,8 @@
     }
 
     if(service == twitter_service) {
-        /* escape pseudo command (to show the same result as
-           sending message) */
-        if(purple_prefs_get_bool(OPT_ESCAPE_PSEUDO)) {
-            escape(buffer);
-        }
-
         /* replace ptmsgid=123 with appropriate links */
-        twitter_add_links(buffer);
+        linkstr = twitter_make_link_string(buffer);
     }
 
     /* translate */
@@ -446,7 +442,6 @@
         translate(buffer, GROUP_IDENTICA, service);
     }
 
-#if 0
     if(service == twitter_service) {
         /* escape pseudo command (to show the same result as
            sending message) */
@@ -454,10 +449,11 @@
             escape(buffer);
         }
 
-        /* replace ptmsgid=123 with appropriate links */
-        twitter_add_links(buffer);
+        tmpstr = g_strconcat(*buffer, linkstr, NULL);
+        g_free(linkstr);
+        g_free(*buffer);
+        *buffer = tmpstr;
     }
-#endif
 
     if(purple_prefs_get_bool(OPT_STRIP_EXCESS_LF)) {
         translate(buffer, EXCESS_LF, service);