Changeset b235228
- Timestamp:
- 2012-11-25T22:28:38Z (12 years ago)
- Branches:
- master
- Children:
- 85cd12d
- Parents:
- 67f6828
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/http_client.h
r67f6828 rb235228 42 42 HTTPC_STREAMING = 1, 43 43 HTTPC_EOF = 2, 44 45 /* Let's reserve 0x1000000+ for lib users. */ 44 46 } http_client_flags_t; 45 47 -
protocols/twitter/twitter_http.c
r67f6828 rb235228 135 135 } 136 136 137 struct 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 137 146 static char *twitter_url_append(char *url, char *key, char *value) 138 147 { -
protocols/twitter/twitter_http.h
r67f6828 rb235228 28 28 #include "http_client.h" 29 29 30 typedef 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 30 36 struct oauth_info; 31 37 32 38 struct http_request *twitter_http(struct im_connection *ic, char *url_string, http_input_function func, 33 39 gpointer data, int is_post, char** arguments, int arguments_len); 40 struct 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); 34 42 35 43 #endif //_TWITTER_HTTP_H -
protocols/twitter/twitter_lib.c
r67f6828 rb235228 1167 1167 1168 1168 json_value_free(parsed); 1169 1170 if (req->flags & TWITTER_HTTP_USER_ACK) 1171 twitter_log(ic, "Command processed successfully"); 1169 1172 } 1170 1173 … … 1213 1216 url = g_strdup_printf("%s%llu%s", TWITTER_STATUS_DESTROY_URL, 1214 1217 (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); 1216 1220 g_free(url); 1217 1221 } … … 1222 1226 url = g_strdup_printf("%s%llu%s", TWITTER_STATUS_RETWEET_URL, 1223 1227 (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); 1225 1230 g_free(url); 1226 1231 } … … 1236 1241 }; 1237 1242 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); 1240 1245 } 1241 1246 … … 1248 1253 url = g_strdup_printf("%s%llu%s", TWITTER_FAVORITE_CREATE_URL, 1249 1254 (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); 1251 1257 g_free(url); 1252 1258 }
Note: See TracChangeset
for help on using the changeset viewer.