Mercurial > pidgin-twitter
diff main.c @ 286:6d0bb66fedc7
added group support for identi.ca.
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Wed, 28 Jan 2009 23:17:40 +0900 |
parents | 2d559555875f |
children | 4a7f4ba199cc |
line wrap: on
line diff
--- 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);