Changeset b235228 for protocols


Ignore:
Timestamp:
2012-11-25T22:28:38Z (12 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
85cd12d
Parents:
67f6828
Message:

Have root confirm some commands that so far gave no feedback at all, since
"no news is good news" can be a little confusing.

Location:
protocols/twitter
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • protocols/twitter/twitter_http.c

    r67f6828 rb235228  
    135135}
    136136
     137struct http_request *twitter_http_f(struct im_connection *ic, char *url_string, http_input_function func,
     138                                    gpointer data, int is_post, char **arguments, int arguments_len, twitter_http_flags_t flags)
     139{
     140        struct http_request *ret = twitter_http(ic, url_string, func, data, is_post, arguments, arguments_len);
     141        if (ret)
     142                ret->flags |= flags;
     143        return ret;
     144}
     145
    137146static char *twitter_url_append(char *url, char *key, char *value)
    138147{
  • protocols/twitter/twitter_http.h

    r67f6828 rb235228  
    2828#include "http_client.h"
    2929
     30typedef enum {
     31        /* With this set, twitter_http_post() will post a generic confirmation
     32           message to the user. */
     33        TWITTER_HTTP_USER_ACK = 0x1000000,
     34} twitter_http_flags_t;
     35
    3036struct oauth_info;
    3137
    3238struct http_request *twitter_http(struct im_connection *ic, char *url_string, http_input_function func,
    3339                                  gpointer data, int is_post, char** arguments, int arguments_len);
     40struct http_request *twitter_http_f(struct im_connection *ic, char *url_string, http_input_function func,
     41                                    gpointer data, int is_post, char** arguments, int arguments_len, twitter_http_flags_t flags);
    3442
    3543#endif //_TWITTER_HTTP_H
  • protocols/twitter/twitter_lib.c

    r67f6828 rb235228  
    11671167       
    11681168        json_value_free(parsed);
     1169       
     1170        if (req->flags & TWITTER_HTTP_USER_ACK)
     1171                twitter_log(ic, "Command processed successfully");
    11691172}
    11701173
     
    12131216        url = g_strdup_printf("%s%llu%s", TWITTER_STATUS_DESTROY_URL,
    12141217                              (unsigned long long) id, ".json");
    1215         twitter_http(ic, url, twitter_http_post, ic, 1, NULL, 0);
     1218        twitter_http_f(ic, url, twitter_http_post, ic, 1, NULL, 0,
     1219                       TWITTER_HTTP_USER_ACK);
    12161220        g_free(url);
    12171221}
     
    12221226        url = g_strdup_printf("%s%llu%s", TWITTER_STATUS_RETWEET_URL,
    12231227                              (unsigned long long) id, ".json");
    1224         twitter_http(ic, url, twitter_http_post, ic, 1, NULL, 0);
     1228        twitter_http_f(ic, url, twitter_http_post, ic, 1, NULL, 0,
     1229                       TWITTER_HTTP_USER_ACK);
    12251230        g_free(url);
    12261231}
     
    12361241        };
    12371242        args[1] = screen_name;
    1238         twitter_http(ic, TWITTER_REPORT_SPAM_URL, twitter_http_post,
    1239                      ic, 1, args, 2);
     1243        twitter_http_f(ic, TWITTER_REPORT_SPAM_URL, twitter_http_post,
     1244                       ic, 1, args, 2, TWITTER_HTTP_USER_ACK);
    12401245}
    12411246
     
    12481253        url = g_strdup_printf("%s%llu%s", TWITTER_FAVORITE_CREATE_URL,
    12491254                              (unsigned long long) id, ".json");
    1250         twitter_http(ic, url, twitter_http_post, ic, 1, NULL, 0);
     1255        twitter_http_f(ic, url, twitter_http_post, ic, 1, NULL, 0,
     1256                       TWITTER_HTTP_USER_ACK);
    12511257        g_free(url);
    12521258}
Note: See TracChangeset for help on using the changeset viewer.