diff pidgin-twitter.c @ 226:8da85ae0aa2c

tweaked user pattern and channel pattern so that they can be matched regardless of surrounding anchor markups.
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Sat, 13 Sep 2008 01:20:13 +0900
parents c3efae72f72a
children ed227c5765a2
line wrap: on
line diff
--- a/pidgin-twitter.c	Tue Sep 09 18:53:36 2008 +0900
+++ b/pidgin-twitter.c	Sat Sep 13 01:20:13 2008 +0900
@@ -24,7 +24,7 @@
 /***********/
 /* globals */
 /***********/
-#define NUM_REGPS 13
+#define NUM_REGPS 11
 #define NUM_SERVICES 3          /* twitter, wassr, identica. */
 static GRegex *regp[NUM_REGPS];
 static gboolean suppress_oops = FALSE;
@@ -2423,7 +2423,7 @@
     }
 
     /* get user's name */
-    g_regex_match(regp[USER_FORMATTED], message, 0, &match_info);
+    g_regex_match(regp[USER], message, 0, &match_info);
     if(!g_match_info_matches(match_info)) {
         twitter_debug("message was not matched : %s\n", message);
         g_match_info_free(match_info);
@@ -2595,8 +2595,6 @@
     regp[COMMAND]   = g_regex_new(P_COMMAND, G_REGEX_RAW, 0, NULL);
     regp[PSEUDO]    = g_regex_new(P_PSEUDO,  G_REGEX_RAW, 0, NULL);
     regp[USER]      = g_regex_new(P_USER, 0, 0, NULL);
-    regp[USER_FIRST_LINE] = g_regex_new(P_USER_FIRST_LINE, 0, 0, NULL);
-    regp[USER_FORMATTED]  = g_regex_new(P_USER_FORMATTED, G_REGEX_RAW, 0, NULL);
     regp[CHANNEL_WASSR]  = g_regex_new(P_CHANNEL, 0, 0, NULL);
     regp[IMAGE_TWITTER]  = g_regex_new(P_IMAGE_TWITTER, 0, 0, NULL);
     regp[IMAGE_WASSR]    = g_regex_new(P_IMAGE_WASSR, 0, 0, NULL);