comparison main.c @ 340:2b79bad516e6

- removed the evil hack - twitter no longer requires preceding white space on a hash tag
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Sun, 18 Oct 2009 16:55:57 +0900
parents 6ee1ed15688c
children b41f1bf69cba
comparison
equal deleted inserted replaced
339:6ee1ed15688c 340:2b79bad516e6
226 g_free(match2); 226 g_free(match2);
227 } 227 }
228 else if(which == SENDER_FFEED) { 228 else if(which == SENDER_FFEED) {
229 gchar *match1 = g_match_info_fetch(match_info, 1); /* preceding CR|LF */ 229 gchar *match1 = g_match_info_fetch(match_info, 1); /* preceding CR|LF */
230 gchar *match2 = g_match_info_fetch(match_info, 2); /* sender */ 230 gchar *match2 = g_match_info_fetch(match_info, 2); /* sender */
231
232 g_snprintf(sub, SUBST_BUF_SIZE, SENDER_FORMAT_FFEED, match1 ? match1: "", match2, match2); 231 g_snprintf(sub, SUBST_BUF_SIZE, SENDER_FORMAT_FFEED, match1 ? match1: "", match2, match2);
233 232
234 g_free(match1); 233 g_free(match1);
235 g_free(match2); 234 g_free(match2);
236 } 235 }
237 else if(which == CHANNEL_WASSR && service == wassr_service) { 236 else if(which == CHANNEL_WASSR && service == wassr_service) {
238 gchar *match1 = g_match_info_fetch(match_info, 1); /* before channel */ 237 gchar *match1 = g_match_info_fetch(match_info, 1); /* before channel */
239 gchar *match2 = g_match_info_fetch(match_info, 2); /* channel */ 238 gchar *match2 = g_match_info_fetch(match_info, 2); /* channel */
240
241 g_snprintf(sub, SUBST_BUF_SIZE, CHANNEL_FORMAT_WASSR, match1 ? match1: "", match2, match2); 239 g_snprintf(sub, SUBST_BUF_SIZE, CHANNEL_FORMAT_WASSR, match1 ? match1: "", match2, match2);
242 240
243 g_free(match1); 241 g_free(match1);
244 g_free(match2); 242 g_free(match2);
245 } 243 }
246 else if(which == TAG_TWITTER && service == twitter_service) { 244 else if(which == TAG_TWITTER && service == twitter_service) {
247 gchar *match1 = g_match_info_fetch(match_info, 1); /* white space */ 245 gchar *match = g_match_info_fetch(match_info, 1); /* search tag */
248 gchar *match2 = g_match_info_fetch(match_info, 2); /* search tag */ 246 g_snprintf(sub, SUBST_BUF_SIZE, TAG_FORMAT_TWITTER, match, match);
249 247 g_free(match);
250 /* search tag ambiguity hack */
251 gchar *last;
252 last = match2 + strlen(match2) - 1;
253 if(g_ascii_ispunct(*last))
254 *last = '\0';
255
256 g_snprintf(sub, SUBST_BUF_SIZE, TAG_FORMAT_TWITTER, match1 ? match1: "", match2, match2);
257 g_free(match1);
258 g_free(match2);
259 } 248 }
260 else if(which == TAG_IDENTICA && service == identica_service) { 249 else if(which == TAG_IDENTICA && service == identica_service) {
261 gchar *match = g_match_info_fetch(match_info, 1); 250 gchar *match = g_match_info_fetch(match_info, 1);
262 gchar *link = g_ascii_strdown(match, -1); 251 gchar *link = g_ascii_strdown(match, -1);
263 purple_str_strip_char(link, '-'); 252 purple_str_strip_char(link, '-');