Index: protocols/twitter/twitter.c
===================================================================
--- protocols/twitter/twitter.c	(revision db57e7c0d4a88e2a2b0862afa20a1255dfffc58d)
+++ protocols/twitter/twitter.c	(revision 508c340d1d12d3ca932001d7ee1dea1a4c81bf02)
@@ -82,5 +82,8 @@
 
 	td->user = acc->user;
-	td->pass = acc->pass;
+	if( strstr( acc->pass, "oauth_token=" ) == NULL )
+		td->pass = g_strdup( acc->pass );
+	else
+		td->oauth = g_strdup( acc->pass );
 	td->home_timeline_id = 0;
 
@@ -119,4 +122,6 @@
 	if( td )
 	{
+		g_free( td->pass );
+		g_free( td->oauth );
 		g_free( td );
 	}
Index: protocols/twitter/twitter.h
===================================================================
--- protocols/twitter/twitter.h	(revision db57e7c0d4a88e2a2b0862afa20a1255dfffc58d)
+++ protocols/twitter/twitter.h	(revision 508c340d1d12d3ca932001d7ee1dea1a4c81bf02)
@@ -37,4 +37,5 @@
 	char* user;
 	char* pass;
+	char* oauth;
 	guint64 home_timeline_id;
 	gint main_loop_id;
Index: protocols/twitter/twitter_http.c
===================================================================
--- protocols/twitter/twitter_http.c	(revision db57e7c0d4a88e2a2b0862afa20a1255dfffc58d)
+++ protocols/twitter/twitter_http.c	(revision 508c340d1d12d3ca932001d7ee1dea1a4c81bf02)
@@ -35,4 +35,5 @@
 #include "misc.h"
 #include "base64.h"
+#include "oauth.h"
 #include <ctype.h>
 #include <errno.h>
@@ -45,5 +46,5 @@
  * This is actually pretty generic function... Perhaps it should move to the lib/http_client.c
  */
-void *twitter_http(char *url_string, http_input_function func, gpointer data, int is_post, char* user, char* pass, char** arguments, int arguments_len)
+void *twitter_http(char *url_string, http_input_function func, gpointer data, int is_post, char* user, char* pass, char* oauth_token, char** arguments, int arguments_len)
 {
 	url_t *url = g_new0( url_t, 1 );
@@ -110,5 +111,18 @@
 
 	// If a pass and user are given we append them to the request.
-	if (userpass_base64)
+	if (oauth_token)
+	{
+		char *full_header;
+		
+		full_header = oauth_http_header(oauth_token,
+		                                is_post ? "POST" : "GET",
+		                                url_string, url_arguments);
+		
+		tmp = g_strdup_printf("%sAuthorization: %s\r\n", request, full_header);
+		g_free(request);
+		g_free(full_header);
+		request = tmp;
+	}
+	else if (userpass_base64)
 	{
 		tmp = g_strdup_printf("%sAuthorization: Basic %s\r\n", request, userpass_base64);
Index: protocols/twitter/twitter_http.h
===================================================================
--- protocols/twitter/twitter_http.h	(revision db57e7c0d4a88e2a2b0862afa20a1255dfffc58d)
+++ protocols/twitter/twitter_http.h	(revision 508c340d1d12d3ca932001d7ee1dea1a4c81bf02)
@@ -29,5 +29,5 @@
 
 void *twitter_http(char *url_string, http_input_function func, gpointer data, int is_post, 
-					char* user, char* pass, char** arguments, int arguments_len);
+                   char* user, char* pass, char *oauth_token, char** arguments, int arguments_len);
 
 #endif //_TWITTER_HTTP_H
Index: protocols/twitter/twitter_lib.c
===================================================================
--- protocols/twitter/twitter_lib.c	(revision db57e7c0d4a88e2a2b0862afa20a1255dfffc58d)
+++ protocols/twitter/twitter_lib.c	(revision 508c340d1d12d3ca932001d7ee1dea1a4c81bf02)
@@ -130,5 +130,5 @@
 	args[0] = "cursor";
 	args[1] = g_strdup_printf ("%d", next_cursor);
-	twitter_http(TWITTER_FRIENDS_IDS_URL, twitter_http_get_friends_ids, ic, 0, td->user, td->pass, args, 2);
+	twitter_http(TWITTER_FRIENDS_IDS_URL, twitter_http_get_friends_ids, ic, 0, td->user, td->pass, td->oauth, args, 2);
 
 	g_free(args[1]);
@@ -396,5 +396,5 @@
 	}
 
-	twitter_http(TWITTER_HOME_TIMELINE_URL, twitter_http_get_home_timeline, ic, 0, td->user, td->pass, args, td->home_timeline_id ? 4 : 2);
+	twitter_http(TWITTER_HOME_TIMELINE_URL, twitter_http_get_home_timeline, ic, 0, td->user, td->pass, td->oauth, args, td->home_timeline_id ? 4 : 2);
 
 	g_free(args[1]);
@@ -620,5 +620,5 @@
 	args[1] = g_strdup_printf ("%d", next_cursor);
 
-	twitter_http(TWITTER_SHOW_FRIENDS_URL, twitter_http_get_statuses_friends, ic, 0, td->user, td->pass, args, 2);
+	twitter_http(TWITTER_SHOW_FRIENDS_URL, twitter_http_get_statuses_friends, ic, 0, td->user, td->pass, td->oauth, args, 2);
 
 	g_free(args[1]);
@@ -654,5 +654,5 @@
 	args[0] = "status";
 	args[1] = msg;
-	twitter_http(TWITTER_STATUS_UPDATE_URL, twitter_http_post_status, ic, 1, td->user, td->pass, args, 2);
+	twitter_http(TWITTER_STATUS_UPDATE_URL, twitter_http_post_status, ic, 1, td->user, td->pass, td->oauth, args, 2);
 //	g_free(args[1]);
 }
@@ -672,5 +672,5 @@
 	args[3] = msg;
 	// Use the same callback as for twitter_post_status, since it does basically the same.
-	twitter_http(TWITTER_DIRECT_MESSAGES_NEW_URL, twitter_http_post_status, ic, 1, td->user, td->pass, args, 4);
+	twitter_http(TWITTER_DIRECT_MESSAGES_NEW_URL, twitter_http_post_status, ic, 1, td->user, td->pass, td->oauth, args, 4);
 //	g_free(args[1]);
 //	g_free(args[3]);
