aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/twitter/twitter.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2010-04-26 01:42:37 +0100
committerWilmer van der Gaast <wilmer@gaast.net>2010-04-26 01:42:37 +0100
commit508c340d1d12d3ca932001d7ee1dea1a4c81bf02 (patch)
tree7afffb4e4258fb8190555afdc7b2707965894229 /protocols/twitter/twitter.c
parentb2bc25c4483f4c2b419d91d479f38c3f07ef4226 (diff)
Successfully posted a tweet!
Twitter's tricky. It returns vars (user_id, screen_name) in the access token that, the way I read the spec, should be included in all subsequent queries. However, stuff only started to work when I dropped those vars. This code's definitely not pretty ATM. Need to clean up now that it actually works.
Diffstat (limited to 'protocols/twitter/twitter.c')
-rw-r--r--protocols/twitter/twitter.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/protocols/twitter/twitter.c b/protocols/twitter/twitter.c
index 726c7cb1..ead03c56 100644
--- a/protocols/twitter/twitter.c
+++ b/protocols/twitter/twitter.c
@@ -81,7 +81,10 @@ static void twitter_login( account_t *acc )
twitter_connections = g_slist_append( twitter_connections, ic );
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;
ic->proto_data = td;
@@ -118,6 +121,8 @@ static void twitter_logout( struct im_connection *ic )
if( td )
{
+ g_free( td->pass );
+ g_free( td->oauth );
g_free( td );
}