Ignore:
Timestamp:
2010-05-01T13:53:59Z (14 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
f4b0911
Parents:
85ef57f
Message:

Cleaned up OAuth stuff: consumer key/secret should *not* be in lib/oauth.c.
Keep it in the Twitter module, and use the oauth_info struct through the
whole session to keep all this together.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/twitter/twitter_http.c

    r85ef57f rc2ecadc  
    2929****************************************************************************/
    3030
    31 #include "twitter_http.h"
    3231#include "twitter.h"
    3332#include "bitlbee.h"
     
    3938#include <errno.h>
    4039
     40#include "twitter_http.h"
     41
    4142
    4243char *twitter_url_append(char *url, char *key, char* value);
     
    4647 * This is actually pretty generic function... Perhaps it should move to the lib/http_client.c
    4748 */
    48 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)
     49void *twitter_http(char *url_string, http_input_function func, gpointer data, int is_post, char* user, char* pass, struct oauth_info* oi, char** arguments, int arguments_len)
    4950{
    5051        url_t *url = g_new0( url_t, 1 );
     
    111112
    112113        // If a pass and user are given we append them to the request.
    113         if (oauth_token)
     114        if (oi)
    114115        {
    115116                char *full_header;
    116117               
    117                 full_header = oauth_http_header(oauth_token,
    118                                                 is_post ? "POST" : "GET",
     118                full_header = oauth_http_header(oi, is_post ? "POST" : "GET",
    119119                                                url_string, url_arguments);
    120120               
Note: See TracChangeset for help on using the changeset viewer.