Changes in protocols/twitter/twitter.c [0e788f5:777461b]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/twitter/twitter.c
r0e788f5 r777461b 158 158 { 159 159 struct twitter_data *td = ic->proto_data; 160 const char *url = set_getstr(&ic->acc->set, "base_url"); 160 161 161 162 imcb_log(ic, "Requesting OAuth request token"); 163 164 if (!strstr(url, "twitter.com") && !strstr(url, "identi.ca")) 165 imcb_log(ic, "Warning: OAuth only works with identi.ca and " 166 "Twitter."); 162 167 163 168 td->oauth_info = oauth_request_token(get_oauth_service(ic), twitter_oauth_callback, ic); … … 178 183 td = ic->proto_data; 179 184 if (info->stage == OAUTH_REQUEST_TOKEN) { 180 char name[strlen(ic->acc->user) + 9], *msg;185 char *name, *msg; 181 186 182 187 if (info->request_token == NULL) { … … 186 191 } 187 192 188 sprintf(name,"%s_%s", td->prefix, ic->acc->user);193 name = g_strdup_printf("%s_%s", td->prefix, ic->acc->user); 189 194 msg = g_strdup_printf("To finish OAuth authentication, please visit " 190 195 "%s and respond with the resulting PIN code.", 191 196 info->auth_url); 192 197 imcb_buddy_msg(ic, name, msg, 0, 0); 198 g_free(name); 193 199 g_free(msg); 194 200 } else if (info->stage == OAUTH_ACCESS_TOKEN) { … … 283 289 char *def_url; 284 290 char *def_tul; 291 char *def_mentions; 285 292 286 293 if (strcmp(acc->prpl->name, "twitter") == 0) { 287 294 def_url = TWITTER_API_URL; 288 295 def_tul = "20"; 296 def_mentions = "true"; 289 297 } else { /* if( strcmp( acc->prpl->name, "identica" ) == 0 ) */ 290 298 def_url = IDENTICA_API_URL; 291 299 def_tul = "0"; 300 def_mentions = "false"; 292 301 } 293 302 … … 302 311 s->flags |= ACC_SET_OFFLINE_ONLY; 303 312 304 s = set_add(&acc->set, "fetch_mentions", "true", set_eval_bool, acc);313 s = set_add(&acc->set, "fetch_mentions", def_mentions, set_eval_bool, acc); 305 314 306 315 s = set_add(&acc->set, "message_length", "140", set_eval_int, acc);
Note: See TracChangeset
for help on using the changeset viewer.