Mercurial > pidgin-twitter
comparison pidgin-twitter.c @ 223:c3efae72f72a
tweaked the recipient pattern to allow mail addresses or some special strings such as "idolm@ster."
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Sat, 06 Sep 2008 18:37:30 +0900 |
parents | b168502b73c3 |
children | 8da85ae0aa2c |
comparison
equal
deleted
inserted
replaced
222:b168502b73c3 | 223:c3efae72f72a |
---|---|
891 gchar sub[SUBST_BUF_SIZE]; | 891 gchar sub[SUBST_BUF_SIZE]; |
892 | 892 |
893 twitter_debug("which = %d service = %d\n", which, service); | 893 twitter_debug("which = %d service = %d\n", which, service); |
894 | 894 |
895 if(which == RECIPIENT) { | 895 if(which == RECIPIENT) { |
896 gchar *match = g_match_info_fetch(match_info, 1); | 896 gchar *match1 = g_match_info_fetch(match_info, 1); /* preceding \s */ |
897 gchar *match2 = g_match_info_fetch(match_info, 2); /* recipient */ | |
897 const gchar *format = NULL; | 898 const gchar *format = NULL; |
899 | |
898 switch(service) { | 900 switch(service) { |
899 case twitter_service: | 901 case twitter_service: |
900 format = RECIPIENT_FORMAT_TWITTER; | 902 format = RECIPIENT_FORMAT_TWITTER; |
901 break; | 903 break; |
902 case wassr_service: | 904 case wassr_service: |
907 break; | 909 break; |
908 default: | 910 default: |
909 twitter_debug("unknown service\n"); | 911 twitter_debug("unknown service\n"); |
910 break; | 912 break; |
911 } | 913 } |
912 g_snprintf(sub, SUBST_BUF_SIZE, format, match, match); | 914 g_snprintf(sub, SUBST_BUF_SIZE, format, match1 ? match1: "", match2, match2); |
913 g_free(match); | 915 g_free(match1); |
916 g_free(match2); | |
914 } | 917 } |
915 else if(which == SENDER) { | 918 else if(which == SENDER) { |
916 gchar *match1 = g_match_info_fetch(match_info, 1); /*preceding CR|LF*/ | 919 gchar *match1 = g_match_info_fetch(match_info, 1); /*preceding CR|LF*/ |
917 gchar *match2 = g_match_info_fetch(match_info, 2); /* sender */ | 920 gchar *match2 = g_match_info_fetch(match_info, 2); /* sender */ |
918 const gchar *format = NULL; | 921 const gchar *format = NULL; |