# HG changeset patch # User Yoshiki Yazawa # Date 1216765941 -32400 # Node ID eaf5d2c4ada04540801e42e966a9fcdda0ceab55 # Parent 97f11d057071f1303bc2451788edc17e69248628 temporal fix for identi.ca problems: - identi.ca sends us massive html. - the XMPP daemon starts to parrot user's post. diff -r 97f11d057071 -r eaf5d2c4ada0 pidgin-twitter.c --- a/pidgin-twitter.c Wed Jul 23 04:53:17 2008 +0900 +++ b/pidgin-twitter.c Wed Jul 23 07:32:21 2008 +0900 @@ -33,6 +33,7 @@ static GList *statuseslist = NULL; static GList *postedlist = NULL; static gchar *wassr_post = NULL; +static gchar *identica_post = NULL; /*************/ @@ -68,6 +69,7 @@ "", "", + "", "", "", @@ -76,6 +78,9 @@ "
", "
", "", + "", NULL }; @@ -85,7 +90,7 @@ gchar *head, *tail; /* head and tail of html */ gchar *begin, *end; /* begin:< end:> */ gchar *html, *str; /* copied src and str to be returned */ - gchar *vis1, *vis2; /* begin and end of address part */ +// gchar *vis1, *vis2; /* begin and end of address part */ gchar *startp; /* starting point marker */ gchar **tagp; /* tag iterator */ gchar *tmp, *tmp2; /* scratches */ @@ -153,6 +158,7 @@ if(!g_ascii_strncasecmp(begin, *tagp, strlen(*tagp))) { /* we found a valid tag */ /* if tag is 投稿完了:") || strstr(*buffer, "チャンネル投稿完了:")) { twitter_debug("clearing sender and buffer\n"); @@ -1474,14 +1493,27 @@ g_free(*buffer); *buffer = NULL; } /* fix for parrot problem during post to a channel */ - else if(strlen(wassr_post) && strstr(*buffer, wassr_post)) { + else if(wassr_post && + strlen(wassr_post) && + strstr(*buffer, wassr_post)) { twitter_debug("parrot clearing: buf = %s post = %s\n", *buffer, wassr_post); g_free(*sender); *sender = NULL; g_free(*buffer); *buffer = NULL; } } - if(!is_twitter_conv(conv)) { + if(service == identica_service) { + if(identica_post && + strlen(identica_post) && + strstr(*buffer, identica_post)) { + twitter_debug("identica parrot clearing: buf = %s post = %s\n", + *buffer, identica_post); + g_free(*sender); *sender = NULL; + g_free(*buffer); *buffer = NULL; + } + } + + if(service != twitter_service) { return FALSE; } @@ -2261,6 +2293,9 @@ /* allocate wassr_post */ wassr_post = g_new0(gchar, WASSR_POST_LEN + 1); + /* allocate identica_post */ + identica_post = g_new0(gchar, IDENTICA_POST_LEN + 1); + return TRUE; } @@ -2344,6 +2379,10 @@ g_free(wassr_post); wassr_post = NULL; + /* free identica_post */ + g_free(identica_post); + identica_post = NULL; + return TRUE; } diff -r 97f11d057071 -r eaf5d2c4ada0 pidgin-twitter.h --- a/pidgin-twitter.h Wed Jul 23 04:53:17 2008 +0900 +++ b/pidgin-twitter.h Wed Jul 23 07:32:21 2008 +0900 @@ -148,13 +148,14 @@ "Content-Length: %d\r\n\r\n" #define TWITTER_STATUS_FORMAT "status=%s" #define TWITTER_STATUS_TERMINATOR "\r\n\r\n" -#define TWITTER_DEFAULT_INTERVAL 60 +#define TWITTER_DEFAULT_INTERVAL (60) /* wassr specific macros */ #define WASSR_POST_LEN (255 * 4) +#define IDENTICA_POST_LEN (140) /* misc macros */ -#define DEFAULT_ICON_SIZE 48 +#define DEFAULT_ICON_SIZE (48) /* debug macros */ #define twitter_debug(fmt, ...) purple_debug(PURPLE_DEBUG_INFO, PLUGIN_NAME, "%s():%4d: " fmt, __FUNCTION__, (int)__LINE__, ## __VA_ARGS__);