diff pidgin-twitter.c @ 223:c3efae72f72a

tweaked the recipient pattern to allow mail addresses or some special strings such as "idolm@ster."
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Sat, 06 Sep 2008 18:37:30 +0900
parents b168502b73c3
children 8da85ae0aa2c
line wrap: on
line diff
--- a/pidgin-twitter.c	Wed Sep 03 18:39:39 2008 +0900
+++ b/pidgin-twitter.c	Sat Sep 06 18:37:30 2008 +0900
@@ -893,8 +893,10 @@
     twitter_debug("which = %d service = %d\n", which, service);
 
     if(which == RECIPIENT) {
-        gchar *match = g_match_info_fetch(match_info, 1);
+        gchar *match1 = g_match_info_fetch(match_info, 1); /* preceding \s */
+        gchar *match2 = g_match_info_fetch(match_info, 2); /* recipient */
         const gchar *format = NULL;
+
         switch(service) {
         case twitter_service:
             format = RECIPIENT_FORMAT_TWITTER;
@@ -909,8 +911,9 @@
             twitter_debug("unknown service\n");
             break;
         }
-        g_snprintf(sub, SUBST_BUF_SIZE, format, match, match);
-        g_free(match);
+        g_snprintf(sub, SUBST_BUF_SIZE, format, match1 ? match1: "", match2, match2);
+        g_free(match1);
+        g_free(match2);
     }
     else if(which == SENDER) {
         gchar *match1 = g_match_info_fetch(match_info, 1); /*preceding CR|LF*/