Mercurial > pidgin-twitter
comparison 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 |
comparison
equal
deleted
inserted
replaced
285:15b8e403c7e1 | 286:6d0bb66fedc7 |
---|---|
206 | 206 |
207 g_free(match1); | 207 g_free(match1); |
208 g_free(match2); | 208 g_free(match2); |
209 } | 209 } |
210 else if(which == CHANNEL_WASSR && service == wassr_service) { | 210 else if(which == CHANNEL_WASSR && service == wassr_service) { |
211 gchar *match1 = g_match_info_fetch(match_info, 1); /*before channel*/ | 211 gchar *match1 = g_match_info_fetch(match_info, 1); /* before channel */ |
212 gchar *match2 = g_match_info_fetch(match_info, 2); /* channel */ | 212 gchar *match2 = g_match_info_fetch(match_info, 2); /* channel */ |
213 const gchar *format = CHANNEL_FORMAT_WASSR; | 213 const gchar *format = CHANNEL_FORMAT_WASSR; |
214 | 214 |
215 g_snprintf(sub, SUBST_BUF_SIZE, format, match1 ? match1: "", match2, match2); | 215 g_snprintf(sub, SUBST_BUF_SIZE, format, match1 ? match1: "", match2, match2); |
216 | 216 |
220 else if(which == TAG_IDENTICA && service == identica_service) { | 220 else if(which == TAG_IDENTICA && service == identica_service) { |
221 gchar *match = g_match_info_fetch(match_info, 1); | 221 gchar *match = g_match_info_fetch(match_info, 1); |
222 gchar *link = g_ascii_strdown(match, -1); | 222 gchar *link = g_ascii_strdown(match, -1); |
223 purple_str_strip_char(link, '-'); | 223 purple_str_strip_char(link, '-'); |
224 purple_str_strip_char(link, '_'); | 224 purple_str_strip_char(link, '_'); |
225 const gchar *format = TAG_FORMAT_IDENTICA; | 225 g_snprintf(sub, SUBST_BUF_SIZE, TAG_FORMAT_IDENTICA, link, match); |
226 g_snprintf(sub, SUBST_BUF_SIZE, format, link, match); | 226 g_free(match); |
227 g_free(link); | |
228 } | |
229 else if(which == GROUP_IDENTICA && service == identica_service) { | |
230 gchar *match = g_match_info_fetch(match_info, 1); | |
231 gchar *link = g_ascii_strdown(match, -1); | |
232 purple_str_strip_char(link, '-'); | |
233 purple_str_strip_char(link, '_'); | |
234 g_snprintf(sub, SUBST_BUF_SIZE, GROUP_FORMAT_IDENTICA, link, match); | |
227 g_free(match); | 235 g_free(match); |
228 g_free(link); | 236 g_free(link); |
229 } | 237 } |
230 else if(which == EXCESS_LF) { | 238 else if(which == EXCESS_LF) { |
231 g_snprintf(sub, SUBST_BUF_SIZE, "%s", "\n"); | 239 g_snprintf(sub, SUBST_BUF_SIZE, "%s", "\n"); |
369 translate(buffer, CHANNEL_WASSR, service); | 377 translate(buffer, CHANNEL_WASSR, service); |
370 } | 378 } |
371 if(service == identica_service && | 379 if(service == identica_service && |
372 purple_prefs_get_bool(OPT_TRANSLATE_CHANNEL)) { | 380 purple_prefs_get_bool(OPT_TRANSLATE_CHANNEL)) { |
373 translate(buffer, TAG_IDENTICA, service); | 381 translate(buffer, TAG_IDENTICA, service); |
382 } | |
383 if(service == identica_service && | |
384 purple_prefs_get_bool(OPT_TRANSLATE_CHANNEL)) { | |
385 translate(buffer, GROUP_IDENTICA, service); | |
374 } | 386 } |
375 | 387 |
376 /* escape pseudo command (to show the same result as sending message) */ | 388 /* escape pseudo command (to show the same result as sending message) */ |
377 if(service == twitter_service && | 389 if(service == twitter_service && |
378 purple_prefs_get_bool(OPT_ESCAPE_PSEUDO)) { | 390 purple_prefs_get_bool(OPT_ESCAPE_PSEUDO)) { |
1103 regp[COMMAND] = g_regex_new(P_COMMAND, G_REGEX_RAW, 0, NULL); | 1115 regp[COMMAND] = g_regex_new(P_COMMAND, G_REGEX_RAW, 0, NULL); |
1104 regp[PSEUDO] = g_regex_new(P_PSEUDO, G_REGEX_RAW, 0, NULL); | 1116 regp[PSEUDO] = g_regex_new(P_PSEUDO, G_REGEX_RAW, 0, NULL); |
1105 regp[USER] = g_regex_new(P_USER, 0, 0, NULL); | 1117 regp[USER] = g_regex_new(P_USER, 0, 0, NULL); |
1106 regp[CHANNEL_WASSR] = g_regex_new(P_CHANNEL, 0, 0, NULL); | 1118 regp[CHANNEL_WASSR] = g_regex_new(P_CHANNEL, 0, 0, NULL); |
1107 regp[TAG_IDENTICA] = g_regex_new(P_TAG_IDENTICA, 0, 0, NULL); | 1119 regp[TAG_IDENTICA] = g_regex_new(P_TAG_IDENTICA, 0, 0, NULL); |
1120 regp[GROUP_IDENTICA] = g_regex_new(P_GROUP_IDENTICA, 0, 0, NULL); | |
1108 regp[IMAGE_TWITTER] = g_regex_new(P_IMAGE_TWITTER, 0, 0, NULL); | 1121 regp[IMAGE_TWITTER] = g_regex_new(P_IMAGE_TWITTER, 0, 0, NULL); |
1109 regp[IMAGE_WASSR] = g_regex_new(P_IMAGE_WASSR, 0, 0, NULL); | 1122 regp[IMAGE_WASSR] = g_regex_new(P_IMAGE_WASSR, 0, 0, NULL); |
1110 regp[IMAGE_IDENTICA] = g_regex_new(P_IMAGE_IDENTICA, 0, 0, NULL); | 1123 regp[IMAGE_IDENTICA] = g_regex_new(P_IMAGE_IDENTICA, 0, 0, NULL); |
1111 regp[IMAGE_JISKO] = g_regex_new(P_IMAGE_JISKO, 0, 0, NULL); | 1124 regp[IMAGE_JISKO] = g_regex_new(P_IMAGE_JISKO, 0, 0, NULL); |
1112 regp[SIZE_128_WASSR] = g_regex_new(P_SIZE_128_WASSR, 0, 0, NULL); | 1125 regp[SIZE_128_WASSR] = g_regex_new(P_SIZE_128_WASSR, 0, 0, NULL); |