# HG changeset patch # User Yoshiki Yazawa # Date 1215689182 -32400 # Node ID e460e1978ca3929cf8694199219ba7109af3f2b5 # Parent 24ad534e438e5cc21b6f7a26f077877ae1ee5bb4 - fixed a bug introduced in r97. - trimmed unnecessary debug messages. diff -r 24ad534e438e -r e460e1978ca3 pidgin-twitter.c --- a/pidgin-twitter.c Thu Jul 10 19:41:26 2008 +0900 +++ b/pidgin-twitter.c Thu Jul 10 20:26:22 2008 +0900 @@ -557,12 +557,14 @@ g_free(match2); } else if(service == wassr_service && which == CHANNEL) { - gchar *match = g_match_info_fetch(match_info, 1); + 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; - snprintf(sub, 128, format, match, match); + snprintf(sub, 128, format, match1 ? match1: "", match2, match2); - g_free(match); + g_free(match1); + g_free(match2); } g_string_append(result, sub); @@ -665,7 +667,7 @@ } /* strip all markups */ - strip_markup(buffer); // this causes missing of strings surrounded by <> + strip_markup(buffer); // it causes missing of strings surrounded by <> /* playsound */ if(purple_prefs_get_bool(OPT_PLAYSOUND_SENDER)) { @@ -679,13 +681,13 @@ 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); + } /* escape pseudo command (to show same result to sending message) */ if(is_twitter_conv(conv) && purple_prefs_get_bool(OPT_ESCAPE_PSEUDO)) { @@ -970,8 +972,6 @@ { const gchar *proto = purple_account_get_protocol_id(account); - twitter_debug("name = %s proto = %s\n", name, proto); - if(g_strstr_len(name, 19, "twitter@twitter.com") && g_strstr_len(proto, 11, "prpl-jabber")) { return TRUE; @@ -996,8 +996,6 @@ { const gchar *proto = purple_account_get_protocol_id(account); - twitter_debug("name = %s proto = %s\n", name, proto); - if(g_strstr_len(name, 18, "wassr-bot@wassr.jp") && g_strstr_len(proto, 11, "prpl-jabber")) { return TRUE; @@ -1022,8 +1020,6 @@ { const gchar *proto = purple_account_get_protocol_id(account); - twitter_debug("name = %s proto = %s\n", name, proto); - if(g_strstr_len(name, 16, "update@identi.ca") && g_strstr_len(proto, 11, "prpl-jabber")) { return TRUE; diff -r 24ad534e438e -r e460e1978ca3 pidgin-twitter.h --- a/pidgin-twitter.h Thu Jul 10 19:41:26 2008 +0900 +++ b/pidgin-twitter.h Thu Jul 10 20:26:22 2008 +0900 @@ -56,10 +56,10 @@ #define SENDER_FORMAT_WASSR "%s%s: " #define RECIPIENT_FORMAT_IDENTICA "@%s" #define SENDER_FORMAT_IDENTICA "%s%s: " +#define CHANNEL_FORMAT_WASSR "%s%s " #define DEFAULT_LIST "(list of users: separated with ' ,:;')" #define OOPS_MESSAGE "Oops! Your update was over 140 characters. We sent the short version to your friends (they can view the entire update on the web).
" #define EMPTY "" -#define CHANNEL_FORMAT_WASSR "#%s " /* patterns */ #define P_RECIPIENT "@([A-Za-z0-9_]+)" @@ -69,7 +69,7 @@ #define P_USER "^\\(.+?\\)\\s*([A-Za-z0-9_]+):" #define P_USER_FIRST_LINE "^\\(.+?\\)\\s*.+:\\s*([A-Za-z0-9_]+):" #define P_USER_FORMATTED "^.*?([A-Za-z0-9_]+):" -#define P_CHANNEL "^.*?(?:[A-Za-z0-9_]+): #([A-Za-z0-9_]+) " +#define P_CHANNEL "^(.*?[A-Za-z0-9_]+: #)([A-Za-z0-9_]+) " /* debug macros */ #define twitter_debug(fmt, ...) purple_debug(PURPLE_DEBUG_INFO, PLUGIN_NAME, "%s():%4d: " fmt, __FUNCTION__, (int)__LINE__, ## __VA_ARGS__);