changeset 162:1237fc885a92

revised http request. "broken_firewall" no longre needed?
author Yoshiki Yazawa <yaz@honeyplnaet.jp>
date Sat, 26 Jul 2008 21:13:34 +0900
parents 5dcd8699cba0
children 84cb6e8ad755
files pidgin-twitter.c pidgin-twitter.h
diffstat 2 files changed, 6 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin-twitter.c	Sat Jul 26 15:48:26 2008 +0900
+++ b/pidgin-twitter.c	Sat Jul 26 21:13:34 2008 +0900
@@ -535,7 +535,7 @@
 
     /* header */
     header = g_strdup_printf(TWITTER_STATUS_GET, basic_auth_encoded);
-    request = g_strconcat(header, TWITTER_STATUS_TERMINATOR, NULL);
+    request = g_strconcat(header, "\r\n", NULL);
 
     /* invoke fetch */
     purple_util_fetch_url_request(TWITTER_BASE_URL, FALSE,
@@ -713,14 +713,10 @@
     g_free(basic_auth);
 
     status = g_strdup_printf(TWITTER_STATUS_FORMAT, url_encoded);
-
     header = g_strdup_printf(TWITTER_STATUS_POST, basic_auth_encoded,
                              (int)strlen(status));
 
-    if(purple_prefs_get_bool(OPT_BROKEN_FIREWALL))
-        request = g_strconcat(header, status, NULL);
-    else
-        request = g_strconcat(header, status, TWITTER_STATUS_TERMINATOR, NULL);
+    request = g_strconcat(header, "\r\n", status, "\r\n", NULL);
 
     purple_util_fetch_url_request(TWITTER_BASE_URL, FALSE,
                                   NULL, TRUE, request, TRUE,
--- a/pidgin-twitter.h	Sat Jul 26 15:48:26 2008 +0900
+++ b/pidgin-twitter.h	Sat Jul 26 21:13:34 2008 +0900
@@ -147,15 +147,14 @@
 #define TWITTER_BASE_URL "http://twitter.com"
 #define TWITTER_STATUS_GET "GET /statuses/friends_timeline.xml HTTP/1.1\r\n" \
     "Host: twitter.com\r\n"                                          \
-    "User-Agent: Pidgin-Twitter\r\n"                                 \
+    "User-Agent: pidgin-twitter\r\n"                                 \
     "Authorization: Basic %s\r\n"
 #define TWITTER_STATUS_POST "POST /statuses/update.xml HTTP/1.1\r\n" \
     "Host: twitter.com\r\n"                                          \
-    "User-Agent: Pidgin-Twitter\r\n"                                 \
+    "User-Agent: pidgin-twitter\r\n"                                 \
     "Authorization: Basic %s\r\n"                                    \
-    "Content-Length: %d\r\n\r\n"
-#define TWITTER_STATUS_FORMAT "status=%s"
-#define TWITTER_STATUS_TERMINATOR "\r\n\r\n"
+    "Content-Length: %d\r\n"
+#define TWITTER_STATUS_FORMAT "status=%s&source=pidgin-twitter"
 #define TWITTER_DEFAULT_INTERVAL (60)
 #define TWITTER_DEFAULT_ICON_URL "http://static.twitter.com/images/default_profile_bigger.png"