# HG changeset patch # User Yoshiki Yazawa # Date 1233152260 -32400 # Node ID 6d0bb66fedc7ab76b7fe7cacaca29dd14670bb19 # Parent 15b8e403c7e1db59fc00488c4e2f8bba5225e336 added group support for identi.ca. diff -r 15b8e403c7e1 -r 6d0bb66fedc7 main.c --- a/main.c Mon Jan 12 01:09:30 2009 +0900 +++ b/main.c Wed Jan 28 23:17:40 2009 +0900 @@ -208,7 +208,7 @@ g_free(match2); } else if(which == CHANNEL_WASSR && service == wassr_service) { - gchar *match1 = g_match_info_fetch(match_info, 1); /*before channel*/ + 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; @@ -222,8 +222,16 @@ gchar *link = g_ascii_strdown(match, -1); purple_str_strip_char(link, '-'); purple_str_strip_char(link, '_'); - const gchar *format = TAG_FORMAT_IDENTICA; - g_snprintf(sub, SUBST_BUF_SIZE, format, link, match); + g_snprintf(sub, SUBST_BUF_SIZE, TAG_FORMAT_IDENTICA, link, match); + g_free(match); + g_free(link); + } + else if(which == GROUP_IDENTICA && service == identica_service) { + gchar *match = g_match_info_fetch(match_info, 1); + gchar *link = g_ascii_strdown(match, -1); + purple_str_strip_char(link, '-'); + purple_str_strip_char(link, '_'); + g_snprintf(sub, SUBST_BUF_SIZE, GROUP_FORMAT_IDENTICA, link, match); g_free(match); g_free(link); } @@ -372,6 +380,10 @@ purple_prefs_get_bool(OPT_TRANSLATE_CHANNEL)) { translate(buffer, TAG_IDENTICA, service); } + if(service == identica_service && + purple_prefs_get_bool(OPT_TRANSLATE_CHANNEL)) { + translate(buffer, GROUP_IDENTICA, service); + } /* escape pseudo command (to show the same result as sending message) */ if(service == twitter_service && @@ -1105,6 +1117,7 @@ regp[USER] = g_regex_new(P_USER, 0, 0, NULL); regp[CHANNEL_WASSR] = g_regex_new(P_CHANNEL, 0, 0, NULL); regp[TAG_IDENTICA] = g_regex_new(P_TAG_IDENTICA, 0, 0, NULL); + regp[GROUP_IDENTICA] = g_regex_new(P_GROUP_IDENTICA, 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); regp[IMAGE_IDENTICA] = g_regex_new(P_IMAGE_IDENTICA, 0, 0, NULL); diff -r 15b8e403c7e1 -r 6d0bb66fedc7 pidgin-twitter.h --- a/pidgin-twitter.h Mon Jan 12 01:09:30 2009 +0900 +++ b/pidgin-twitter.h Wed Jan 28 23:17:40 2009 +0900 @@ -39,6 +39,7 @@ USER, CHANNEL_WASSR, TAG_IDENTICA, + GROUP_IDENTICA, IMAGE_TWITTER, IMAGE_WASSR, IMAGE_IDENTICA, @@ -159,6 +160,7 @@ #define CHANNEL_FORMAT_WASSR "%s%s " #define CHANNEL_FORMAT_IDENTICA "%s%s " #define TAG_FORMAT_IDENTICA "#%s" +#define GROUP_FORMAT_IDENTICA "!%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).
" @@ -172,6 +174,7 @@ #define P_USER "^.*?(?:)?([-A-Za-z0-9_]+)(?:)?:" #define P_CHANNEL "^(.*?(?:)?[-A-Za-z0-9_]+(?:)?: \\r?\\n?#)([A-Za-z0-9_]+) " #define P_TAG_IDENTICA "#([-A-Za-z0-9_]+)" +#define P_GROUP_IDENTICA "!([-A-Za-z0-9_]+)" #define P_IMAGE_TWITTER "" #define P_IMAGE_WASSR "
" #define P_IMAGE_IDENTICA "\"[A-Za-z0-9_]+\"/" @@ -213,7 +216,7 @@ #define DEFAULT_ICON_MAX_COUNT (50) #define DEFAULT_ICON_MAX_DAYS (7) #define DAYS_TO_SECONDS(d) ((d) * 86400) -#define NUM_REGPS (13) +#define NUM_REGPS (14) #define NUM_SERVICES (4) /* twitter, wassr, identica, jisko. */ /* debug macros */