Changes in / [3759849:1dd3470]
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
debian/changelog
r3759849 r1dd3470 1 bitlbee (1.2.7-1) unstable; urgency=high2 3 * New upstream version.4 * Fixes MSN Messenger login issues, so uploading at high priority.5 6 -- Wilmer van der Gaast <wilmer@gaast.net> Sat, 15 May 2010 16:15:57 +01007 8 1 bitlbee (1.2.6a-1) unstable; urgency=low 9 2 -
debian/control
r3759849 r1dd3470 15 15 Description: An IRC to other chat networks gateway 16 16 This program can be used as an IRC server which forwards everything you 17 say to people on other chat networks: Jabber, ICQ, AIM, MSN, Yahoo! and 18 Twitter. 17 say to people on other chat networks: Jabber, ICQ, AIM, MSN and Yahoo. 19 18 20 19 Package: bitlbee-dev … … 23 22 Description: An IRC to other chat networks gateway 24 23 This program can be used as an IRC server which forwards everything you 25 say to people on other chat networks: Jabber, ICQ, AIM, MSN, Yahoo! and 26 Twitter. 24 say to people on other chat networks: Jabber, ICQ, AIM, MSN and Yahoo. 27 25 . 28 26 This package holds development stuff for compiling plug-ins. -
debian/rules
r3759849 r1dd3470 99 99 find usr -type f -exec md5sum {} \; > DEBIAN/md5sums 100 100 101 ifdef BITLBEE_FORCE_VERSION102 101 dpkg-gencontrol -ldebian/changelog -isp -pbitlbee-dev -Pdebian/bitlbee-dev -v1:$(BITLBEE_VERSION)-0 103 else104 dpkg-gencontrol -ldebian/changelog -isp -pbitlbee-dev -Pdebian/bitlbee-dev105 endif106 102 107 103 dpkg --build debian/bitlbee-dev .. -
doc/bitlbee.8
r3759849 r1dd3470 39 39 networks and acts as a gateway. Users can connect to the server 40 40 with any normal IRC client and see their 'buddy list' in 41 &bitlbee. It currently supports Oscar (AIM and ICQ), 42 MSN, Jabber, Yahoo! and Twitter. 41 &bitlbee. BitlBee's protocol support is based on the gaim 42 protocol plugins. BitlBee currently supports Oscar (aim and icq), 43 MSN, Jabber and Yahoo. 43 44 44 45 \fBbitlbee\fP should be called by -
doc/user-guide/commands.xml
r3759849 r1dd3470 794 794 795 795 <bitlbee-setting name="ignore_auth_requests" type="boolean" scope="account"> 796 <default> false</default>796 <default>true</default> 797 797 798 798 <description> -
doc/user-guide/quickstart.xml
r3759849 r1dd3470 3 3 4 4 <para> 5 Welcome to BitlBee, your IRC gateway to ICQ, MSN, AOL, Jabber , Yahoo! and Twitter.5 Welcome to BitlBee, your IRC gateway to ICQ, MSN, AOL, Jabber and Yahoo Instant Messaging Systems. 6 6 </para> 7 7 … … 43 43 44 44 <para> 45 Other available IM protocols are msn, oscar, yahoo and twitter. OSCAR is the protocol used by ICQ and AOL. For more information about the <emphasis>account add</emphasis> command, see <emphasis>help account add</emphasis>.45 Other available IM protocols are msn, oscar, and yahoo. OSCAR is the protocol used by ICQ and AOL. For more information about the <emphasis>account add</emphasis> command, see <emphasis>help account add</emphasis>. 46 46 </para> 47 47 -
irc_commands.c
r3759849 r1dd3470 73 73 static void irc_cmd_nick( irc_t *irc, char **cmd ) 74 74 { 75 if( irc->status & USTATUS_IDENTIFIED && irc->nick ) 76 { 77 irc_reply( irc, 438, "%s %s :You can only change your nick if you're not " 78 "logged in (i.e. pre-identify)", irc->nick, cmd[1] ); 75 if( irc->nick ) 76 { 77 irc_reply( irc, 438, ":The hand of the deity is upon thee, thy nick may not change" ); 79 78 } 80 79 /* This is not clean, but for now it'll have to be like this... */ 81 else if( ( nick_cmp( cmd[1], irc->mynick ) == 0 ) || ( nick_cmp( cmd[1], NS_NICK ) == 0 ) || ( user_find( irc, cmd[1] ) != NULL ))82 { 83 irc_reply( irc, 433, " %s :This nick is already in use", cmd[1]);80 else if( ( nick_cmp( cmd[1], irc->mynick ) == 0 ) || ( nick_cmp( cmd[1], NS_NICK ) == 0 ) ) 81 { 82 irc_reply( irc, 433, ":This nick is already in use" ); 84 83 } 85 84 else if( !nick_ok( cmd[1] ) ) 86 85 { 87 86 /* [SH] Invalid characters. */ 88 irc_reply( irc, 432, "%s :This nick contains invalid characters", cmd[1] ); 89 } 90 else if(irc->nick) 91 { 92 if( user_find( irc, irc->nick ) ) 93 user_rename(irc, irc->nick, cmd[1]); 94 95 irc_write( irc, ":%s!%s@%s NICK %s", irc->nick, irc->user, irc->host, cmd[1] ); 96 g_free(irc->nick); 97 irc->nick = g_strdup( cmd[1] ); 87 irc_reply( irc, 432, ":This nick contains invalid characters" ); 98 88 } 99 89 else -
lib/misc.c
r3759849 r1dd3470 154 154 { 155 155 char *start = in; 156 char out[strlen(in)+1];156 char *out = g_malloc( strlen( in ) + 1 ); 157 157 char *s = out, *cs; 158 158 int i, matched; 159 159 int taglen; 160 160 161 memset( out, 0, s izeof( out ));161 memset( out, 0, strlen( in ) + 1 ); 162 162 163 163 while( *in ) … … 230 230 231 231 strcpy( start, out ); 232 g_free( out ); 232 233 } 233 234 -
protocols/jabber/iq.c
r3759849 r1dd3470 127 127 !( s = xt_find_attr( c, "xmlns" ) ) ) 128 128 { 129 imcb_log( ic, "Warning: Received incomplete IQ-%s packet", type ); 129 130 return XT_HANDLED; 130 131 } -
protocols/oscar/auth.c
r3759849 r1dd3470 120 120 aim_snacid_t snacid; 121 121 aim_tlvlist_t *tl = NULL; 122 struct im_connection *ic = sess->aux_data;123 122 124 123 if (!sess || !conn || !sn) 125 124 return -EINVAL; 126 125 127 if ( isdigit(sn[0]) && set_getbool(&ic->acc->set, "old_icq_auth"))126 if ((sn[0] >= '0') && (sn[0] <= '9')) 128 127 return goddamnicq(sess, conn, sn); 129 128 -
protocols/oscar/oscar.c
r3759849 r1dd3470 374 374 if (isdigit(acc->user[0])) { 375 375 set_add(&acc->set, "ignore_auth_requests", "false", set_eval_bool, acc); 376 set_add(&acc->set, "old_icq_auth", "false", set_eval_bool, acc);377 376 } 378 377 … … 1031 1030 m = g_list_append(m, exch); 1032 1031 1033 g_snprintf( txt, 1024, "Got an invitation to chatroom %s from %s: %s", name, userinfo->sn, args->msg);1032 g_snprintf( txt, 1024, "Got an invitation to chatroom %s from %s: %s", name, userinfo->sn, args->msg ); 1034 1033 1035 1034 inv->ic = ic; … … 1037 1036 inv->name = g_strdup(name); 1038 1037 1039 imcb_ask( ic, txt, inv, oscar_accept_chat, oscar_reject_chat);1038 imcb_ask( ic, txt, inv, oscar_accept_chat, oscar_reject_chat); 1040 1039 1041 1040 if (name) 1042 1041 g_free(name); 1043 } else if (args->reqclass & AIM_CAPS_ICQRTF) {1044 // TODO: constify1045 char text[strlen(args->info.rtfmsg.rtfmsg)+1];1046 strncpy(text, args->info.rtfmsg.rtfmsg, sizeof(text));1047 imcb_buddy_msg(ic, normalize(userinfo->sn), text, 0, 0);1048 1042 } 1049 1043 -
protocols/twitter/twitter.c
r3759849 r1dd3470 27 27 #include "twitter_http.h" 28 28 #include "twitter_lib.h" 29 #include "url.h"30 29 31 30 /** … … 71 70 "http://api.twitter.com/oauth/request_token", 72 71 "http://api.twitter.com/oauth/access_token", 73 "http s://api.twitter.com/oauth/authorize",72 "http://api.twitter.com/oauth/authorize", 74 73 .consumer_key = "xsDNKJuNZYkZyMcu914uEA", 75 74 .consumer_secret = "FCxqcr0pXKzsF9ajmP57S3VQ8V6Drk4o2QYtqMcOszo", … … 161 160 set_t *s; 162 161 163 s = set_add( &acc->set, "base_url", TWITTER_API_URL, NULL, acc );164 s->flags |= ACC_SET_OFFLINE_ONLY;165 166 162 s = set_add( &acc->set, "message_length", "140", set_eval_int, acc ); 167 163 … … 179 175 { 180 176 struct im_connection *ic = imcb_new( acc ); 181 struct twitter_data *td ;177 struct twitter_data *td = g_new0( struct twitter_data, 1 ); 182 178 char name[strlen(acc->user)+9]; 183 url_t url; 184 185 if( !url_set( &url, set_getstr( &ic->acc->set, "base_url" ) ) || 186 ( url.proto != PROTO_HTTP && url.proto != PROTO_HTTPS ) ) 187 { 188 imcb_error( ic, "Incorrect API base URL: %s", set_getstr( &ic->acc->set, "base_url" ) ); 189 imc_logout( ic, FALSE ); 190 return; 191 } 192 179 193 180 twitter_connections = g_slist_append( twitter_connections, ic ); 194 td = g_new0( struct twitter_data, 1 );195 181 ic->proto_data = td; 196 197 td->url_ssl = url.proto == PROTO_HTTPS; 198 td->url_port = url.port; 199 td->url_host = g_strdup( url.host ); 200 if( strcmp( url.file, "/" ) != 0 ) 201 td->url_path = g_strdup( url.file ); 202 else 203 td->url_path = g_strdup( "" ); 182 ic->flags |= OPT_DOES_HTML; 204 183 205 184 td->user = acc->user; 206 if( strstr( acc->pass, "oauth_token=" ) ) 185 if( !set_getbool( &acc->set, "oauth" ) ) 186 td->pass = g_strdup( acc->pass ); 187 else if( strstr( acc->pass, "oauth_token=" ) ) 207 188 td->oauth_info = oauth_from_string( acc->pass, &twitter_oauth ); 189 td->home_timeline_id = 0; 208 190 209 191 sprintf( name, "twitter_%s", acc->user ); … … 211 193 imcb_buddy_status( ic, name, OPT_LOGGED_IN, NULL, NULL ); 212 194 213 if( td-> oauth_info || !set_getbool( &acc->set, "oauth" ))195 if( td->pass || td->oauth_info ) 214 196 twitter_main_loop_start( ic ); 215 197 else … … 286 268 static void twitter_add_buddy( struct im_connection *ic, char *who, char *group ) 287 269 { 288 twitter_friendships_create_destroy(ic, who, 1);289 270 } 290 271 291 272 static void twitter_remove_buddy( struct im_connection *ic, char *who, char *group ) 292 273 { 293 twitter_friendships_create_destroy(ic, who, 0);294 274 } 295 275 -
protocols/twitter/twitter.h
r3759849 r1dd3470 42 42 struct groupchat *home_timeline_gc; 43 43 gint http_fails; 44 45 gboolean url_ssl;46 int url_port;47 char *url_host;48 char *url_path;49 44 }; 50 45 -
protocols/twitter/twitter_http.c
r3759849 r1dd3470 41 41 42 42 43 staticchar *twitter_url_append(char *url, char *key, char* value);43 char *twitter_url_append(char *url, char *key, char* value); 44 44 45 45 /** … … 47 47 * This is actually pretty generic function... Perhaps it should move to the lib/http_client.c 48 48 */ 49 void *twitter_http( struct im_connection *ic, char *url_string, http_input_function func, gpointer data, int is_post, char** arguments, int arguments_len)49 void *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) 50 50 { 51 struct twitter_data *td = ic->proto_data;51 url_t *url = g_new0( url_t, 1 ); 52 52 char *tmp; 53 GString *request = g_string_new("");53 char *request; 54 54 void *ret; 55 char *userpass = NULL; 56 char *userpass_base64; 55 57 char *url_arguments; 56 58 57 url_arguments = g_strdup(""); 59 // Fill the url structure. 60 if( !url_set( url, url_string ) ) 61 { 62 g_free( url ); 63 return NULL; 64 } 65 66 if( url->proto != PROTO_HTTP && url->proto != PROTO_HTTPS ) 67 { 68 g_free( url ); 69 return NULL; 70 } 71 72 // Concatenate user and pass 73 if (user && pass) { 74 userpass = g_strdup_printf("%s:%s", user, pass); 75 userpass_base64 = base64_encode((unsigned char*)userpass, strlen(userpass)); 76 } else { 77 userpass_base64 = NULL; 78 } 79 80 url_arguments = g_malloc(1); 81 url_arguments[0] = '\0'; 58 82 59 83 // Construct the url arguments. … … 69 93 } 70 94 95 // Do GET stuff... 96 if (!is_post) 97 { 98 // Find the char-pointer of the end of the string. 99 tmp = url->file + strlen(url->file); 100 tmp[0] = '?'; 101 // append the url_arguments to the end of the url->file. 102 // TODO GM: Check the length? 103 g_stpcpy (tmp+1, url_arguments); 104 } 105 106 71 107 // Make the request. 72 g_string_printf(request, "%s %s%s%s%s HTTP/1.0\r\n" 73 "Host: %s\r\n" 74 "User-Agent: BitlBee " BITLBEE_VERSION " " ARCH "/" CPU "\r\n", 75 is_post ? "POST" : "GET", 76 td->url_path, url_string, 77 is_post ? "" : "?", is_post ? "" : url_arguments, 78 td->url_host); 108 request = g_strdup_printf( "%s %s HTTP/1.0\r\n" 109 "Host: %s\r\n" 110 "User-Agent: BitlBee " BITLBEE_VERSION " " ARCH "/" CPU "\r\n", 111 is_post ? "POST" : "GET", url->file, url->host ); 79 112 80 113 // If a pass and user are given we append them to the request. 81 if ( td->oauth_info)114 if (oi) 82 115 { 83 116 char *full_header; 84 char *full_url;85 117 86 full_url = g_strconcat(set_getstr(&ic->acc->set, "base_url" ), url_string, NULL); 87 full_header = oauth_http_header(td->oauth_info, is_post ? "POST" : "GET", 88 full_url, url_arguments); 118 full_header = oauth_http_header(oi, is_post ? "POST" : "GET", 119 url_string, url_arguments); 89 120 90 g_string_append_printf(request, "Authorization: %s\r\n", full_header); 121 tmp = g_strdup_printf("%sAuthorization: %s\r\n", request, full_header); 122 g_free(request); 91 123 g_free(full_header); 92 g_free(full_url);124 request = tmp; 93 125 } 94 else 126 else if (userpass_base64) 95 127 { 96 char userpass[strlen(ic->acc->user)+2+strlen(ic->acc->pass)]; 97 char *userpass_base64; 98 99 g_snprintf(userpass, sizeof(userpass), "%s:%s", ic->acc->user, ic->acc->pass); 100 userpass_base64 = base64_encode((unsigned char*)userpass, strlen(userpass)); 101 g_string_append_printf(request, "Authorization: Basic %s\r\n", userpass_base64); 102 g_free( userpass_base64 ); 128 tmp = g_strdup_printf("%sAuthorization: Basic %s\r\n", request, userpass_base64); 129 g_free(request); 130 request = tmp; 103 131 } 104 132 … … 107 135 { 108 136 // Append the Content-Type and url-encoded arguments. 109 g_string_append_printf(request,110 "Content-Type: application/x-www-form-urlencoded\r\n"111 "Content-Length: %zd\r\n\r\n%s",112 strlen(url_arguments), url_arguments);137 tmp = g_strdup_printf("%sContent-Type: application/x-www-form-urlencoded\r\nContent-Length: %zd\r\n\r\n%s", 138 request, strlen(url_arguments), url_arguments); 139 g_free(request); 140 request = tmp; 113 141 } else { 114 142 // Append an extra \r\n to end the request... 115 g_string_append(request, "\r\n"); 143 tmp = g_strdup_printf("%s\r\n", request); 144 g_free(request); 145 request = tmp; 116 146 } 117 147 118 ret = http_dorequest( td->url_host, td->url_port, td->url_ssl, request->str, func, data);148 ret = http_dorequest( url->host, url->port, url->proto == PROTO_HTTPS, request, func, data ); 119 149 150 g_free( url ); 151 g_free( userpass ); 152 g_free( userpass_base64 ); 120 153 g_free( url_arguments ); 121 g_ string_free( request, TRUE);154 g_free( request ); 122 155 return ret; 123 156 } 124 157 125 staticchar *twitter_url_append(char *url, char *key, char* value)158 char *twitter_url_append(char *url, char *key, char* value) 126 159 { 127 160 char *key_encoded = g_strndup(key, 3 * strlen(key)); -
protocols/twitter/twitter_http.h
r3759849 r1dd3470 30 30 struct oauth_info; 31 31 32 void *twitter_http( struct im_connection *ic, char *url_string, http_input_function func,33 gpointer data, int is_post, char** arguments, int arguments_len);32 void *twitter_http(char *url_string, http_input_function func, gpointer data, int is_post, 33 char* user, char* pass, struct oauth_info *oi, char** arguments, int arguments_len); 34 34 35 35 #endif //_TWITTER_HTTP_H -
protocols/twitter/twitter_lib.c
r3759849 r1dd3470 117 117 } 118 118 119 /* Warning: May return a malloc()ed value, which will be free()d on the next120 call. Only for short-term use. */121 static char *twitter_parse_error(struct http_request *req)122 {123 static char *ret = NULL;124 struct xt_parser *xp = NULL;125 struct xt_node *node;126 127 g_free(ret);128 ret = NULL;129 130 if (req->body_size > 0)131 {132 xp = xt_new(NULL, NULL);133 xt_feed(xp, req->reply_body, req->body_size);134 135 if ((node = xt_find_node(xp->root, "hash")) &&136 (node = xt_find_node(node->children, "error")) &&137 node->text_len > 0)138 {139 ret = g_strdup_printf("%s (%s)", req->status_string, node->text);140 xt_free(xp);141 return ret;142 }143 144 xt_free(xp);145 }146 147 return req->status_string;148 }149 150 119 static void twitter_http_get_friends_ids(struct http_request *req); 151 120 … … 155 124 void twitter_get_friends_ids(struct im_connection *ic, int next_cursor) 156 125 { 126 struct twitter_data *td = ic->proto_data; 127 157 128 // Primitive, but hey! It works... 158 129 char* args[2]; 159 130 args[0] = "cursor"; 160 131 args[1] = g_strdup_printf ("%d", next_cursor); 161 twitter_http( ic, TWITTER_FRIENDS_IDS_URL, twitter_http_get_friends_ids, ic, 0, args, 2);132 twitter_http(TWITTER_FRIENDS_IDS_URL, twitter_http_get_friends_ids, ic, 0, td->user, td->pass, td->oauth_info, args, 2); 162 133 163 134 g_free(args[1]); … … 225 196 // It didn't go well, output the error and return. 226 197 if (++td->http_fails >= 5) 227 imcb_error(ic, "Could not retrieve friends : %s", twitter_parse_error(req));198 imcb_error(ic, "Could not retrieve friends. HTTP STATUS: %d", req->status_code); 228 199 229 200 return; … … 425 396 } 426 397 427 twitter_http( ic, TWITTER_HOME_TIMELINE_URL, twitter_http_get_home_timeline, ic, 0, args, td->home_timeline_id ? 4 : 2);398 twitter_http(TWITTER_HOME_TIMELINE_URL, twitter_http_get_home_timeline, ic, 0, td->user, td->pass, td->oauth_info, args, td->home_timeline_id ? 4 : 2); 428 399 429 400 g_free(args[1]); … … 463 434 twitter_add_buddy(ic, status->user->screen_name, status->user->name); 464 435 465 strip_html(status->text);466 467 436 // Say it! 468 437 if (g_strcasecmp(td->user, status->user->screen_name) == 0) … … 502 471 status = l->data; 503 472 504 strip_html( status->text );505 473 if( mode_one ) 506 474 text = g_strdup_printf( "\002<\002%s\002>\002 %s", … … 555 523 // It didn't go well, output the error and return. 556 524 if (++td->http_fails >= 5) 557 imcb_error(ic, "Could not retrieve " TWITTER_HOME_TIMELINE_URL " : %s", twitter_parse_error(req));525 imcb_error(ic, "Could not retrieve " TWITTER_HOME_TIMELINE_URL ". HTTP STATUS: %d", req->status_code); 558 526 559 527 return; … … 607 575 // It didn't go well, output the error and return. 608 576 if (++td->http_fails >= 5) 609 imcb_error(ic, "Could not retrieve " TWITTER_SHOW_FRIENDS_URL " : %s", twitter_parse_error(req));577 imcb_error(ic, "Could not retrieve " TWITTER_SHOW_FRIENDS_URL " HTTP STATUS: %d", req->status_code); 610 578 611 579 return; … … 646 614 void twitter_get_statuses_friends(struct im_connection *ic, int next_cursor) 647 615 { 616 struct twitter_data *td = ic->proto_data; 617 648 618 char* args[2]; 649 619 args[0] = "cursor"; 650 620 args[1] = g_strdup_printf ("%d", next_cursor); 651 621 652 twitter_http( ic, TWITTER_SHOW_FRIENDS_URL, twitter_http_get_statuses_friends, ic, 0, args, 2);622 twitter_http(TWITTER_SHOW_FRIENDS_URL, twitter_http_get_statuses_friends, ic, 0, td->user, td->pass, td->oauth_info, args, 2); 653 623 654 624 g_free(args[1]); … … 656 626 657 627 /** 658 * Callback to use after sending a post requestto twitter.659 */ 660 static void twitter_http_post (struct http_request *req)628 * Callback after sending a new update to twitter. 629 */ 630 static void twitter_http_post_status(struct http_request *req) 661 631 { 662 632 struct im_connection *ic = req->data; … … 669 639 if (req->status_code != 200) { 670 640 // It didn't go well, output the error and return. 671 imcb_error(ic, " HTTP error: %s", twitter_parse_error(req));641 imcb_error(ic, "Could not post message... HTTP STATUS: %d", req->status_code); 672 642 return; 673 643 } … … 679 649 void twitter_post_status(struct im_connection *ic, char* msg) 680 650 { 651 struct twitter_data *td = ic->proto_data; 652 681 653 char* args[2]; 682 654 args[0] = "status"; 683 655 args[1] = msg; 684 twitter_http( ic, TWITTER_STATUS_UPDATE_URL, twitter_http_post, ic, 1, args, 2);656 twitter_http(TWITTER_STATUS_UPDATE_URL, twitter_http_post_status, ic, 1, td->user, td->pass, td->oauth_info, args, 2); 685 657 // g_free(args[1]); 686 658 } … … 692 664 void twitter_direct_messages_new(struct im_connection *ic, char *who, char *msg) 693 665 { 666 struct twitter_data *td = ic->proto_data; 667 694 668 char* args[4]; 695 669 args[0] = "screen_name"; … … 698 672 args[3] = msg; 699 673 // Use the same callback as for twitter_post_status, since it does basically the same. 700 twitter_http( ic, TWITTER_DIRECT_MESSAGES_NEW_URL, twitter_http_post, ic, 1, args, 4);674 twitter_http(TWITTER_DIRECT_MESSAGES_NEW_URL, twitter_http_post_status, ic, 1, td->user, td->pass, td->oauth_info, args, 4); 701 675 // g_free(args[1]); 702 676 // g_free(args[3]); 703 677 } 704 705 void twitter_friendships_create_destroy(struct im_connection *ic, char *who, int create)706 {707 char* args[2];708 args[0] = "screen_name";709 args[1] = who;710 twitter_http(ic, create ? TWITTER_FRIENDSHIPS_CREATE_URL : TWITTER_FRIENDSHIPS_DESTROY_URL, twitter_http_post, ic, 1, args, 2);711 } -
protocols/twitter/twitter_lib.h
r3759849 r1dd3470 32 32 33 33 /* Status URLs */ 34 #define TWITTER_STATUS_UPDATE_URL "/statuses/update.xml"35 #define TWITTER_STATUS_SHOW_URL "/statuses/show/"36 #define TWITTER_STATUS_DESTROY_URL "/statuses/destroy/"34 #define TWITTER_STATUS_UPDATE_URL TWITTER_API_URL "/statuses/update.xml" 35 #define TWITTER_STATUS_SHOW_URL TWITTER_API_URL "/statuses/show/" 36 #define TWITTER_STATUS_DESTROY_URL TWITTER_API_URL "/statuses/destroy/" 37 37 38 38 /* Timeline URLs */ 39 #define TWITTER_PUBLIC_TIMELINE_URL "/statuses/public_timeline.xml"40 #define TWITTER_FEATURED_USERS_URL "/statuses/featured.xml"41 #define TWITTER_FRIENDS_TIMELINE_URL "/statuses/friends_timeline.xml"42 #define TWITTER_HOME_TIMELINE_URL "/statuses/home_timeline.xml"43 #define TWITTER_MENTIONS_URL "/statuses/mentions.xml"44 #define TWITTER_USER_TIMELINE_URL "/statuses/user_timeline.xml"39 #define TWITTER_PUBLIC_TIMELINE_URL TWITTER_API_URL "/statuses/public_timeline.xml" 40 #define TWITTER_FEATURED_USERS_URL TWITTER_API_URL "/statuses/featured.xml" 41 #define TWITTER_FRIENDS_TIMELINE_URL TWITTER_API_URL "/statuses/friends_timeline.xml" 42 #define TWITTER_HOME_TIMELINE_URL TWITTER_API_URL "/statuses/home_timeline.xml" 43 #define TWITTER_MENTIONS_URL TWITTER_API_URL "/statuses/mentions.xml" 44 #define TWITTER_USER_TIMELINE_URL TWITTER_API_URL "/statuses/user_timeline.xml" 45 45 46 46 /* Users URLs */ 47 #define TWITTER_SHOW_USERS_URL "/users/show.xml"48 #define TWITTER_SHOW_FRIENDS_URL "/statuses/friends.xml"49 #define TWITTER_SHOW_FOLLOWERS_URL "/statuses/followers.xml"47 #define TWITTER_SHOW_USERS_URL TWITTER_API_URL "/users/show.xml" 48 #define TWITTER_SHOW_FRIENDS_URL TWITTER_API_URL "/statuses/friends.xml" 49 #define TWITTER_SHOW_FOLLOWERS_URL TWITTER_API_URL "/statuses/followers.xml" 50 50 51 51 /* Direct messages URLs */ 52 #define TWITTER_DIRECT_MESSAGES_URL "/direct_messages.xml"53 #define TWITTER_DIRECT_MESSAGES_NEW_URL "/direct_messages/new.xml"54 #define TWITTER_DIRECT_MESSAGES_SENT_URL "/direct_messages/sent.xml"55 #define TWITTER_DIRECT_MESSAGES_DESTROY_URL "/direct_messages/destroy/"52 #define TWITTER_DIRECT_MESSAGES_URL TWITTER_API_URL "/direct_messages.xml" 53 #define TWITTER_DIRECT_MESSAGES_NEW_URL TWITTER_API_URL "/direct_messages/new.xml" 54 #define TWITTER_DIRECT_MESSAGES_SENT_URL TWITTER_API_URL "/direct_messages/sent.xml" 55 #define TWITTER_DIRECT_MESSAGES_DESTROY_URL TWITTER_API_URL "/direct_messages/destroy/" 56 56 57 57 /* Friendships URLs */ 58 #define TWITTER_FRIENDSHIPS_CREATE_URL "/friendships/create.xml"59 #define TWITTER_FRIENDSHIPS_DESTROY_URL "/friendships/destroy.xml"60 #define TWITTER_FRIENDSHIPS_SHOW_URL "/friendships/show.xml"58 #define TWITTER_FRIENDSHIPS_CREATE_URL TWITTER_API_URL "/friendships/create.xml" 59 #define TWITTER_FRIENDSHIPS_DESTROY_URL TWITTER_API_URL "/friendships/destroy.xml" 60 #define TWITTER_FRIENDSHIPS_SHOW_URL TWITTER_API_URL "/friendships/show.xml" 61 61 62 62 /* Social graphs URLs */ 63 #define TWITTER_FRIENDS_IDS_URL "/friends/ids.xml"64 #define TWITTER_FOLLOWERS_IDS_URL "/followers/ids.xml"63 #define TWITTER_FRIENDS_IDS_URL TWITTER_API_URL "/friends/ids.xml" 64 #define TWITTER_FOLLOWERS_IDS_URL TWITTER_API_URL "/followers/ids.xml" 65 65 66 66 /* Account URLs */ 67 #define TWITTER_ACCOUNT_RATE_LIMIT_URL "/account/rate_limit_status.xml"67 #define TWITTER_ACCOUNT_RATE_LIMIT_URL TWITTER_API_URL "/account/rate_limit_status.xml" 68 68 69 69 /* Favorites URLs */ 70 #define TWITTER_FAVORITES_GET_URL "/favorites.xml"71 #define TWITTER_FAVORITE_CREATE_URL "/favorites/create/"72 #define TWITTER_FAVORITE_DESTROY_URL "/favorites/destroy/"70 #define TWITTER_FAVORITES_GET_URL TWITTER_API_URL "/favorites.xml" 71 #define TWITTER_FAVORITE_CREATE_URL TWITTER_API_URL "/favorites/create/" 72 #define TWITTER_FAVORITE_DESTROY_URL TWITTER_API_URL "/favorites/destroy/" 73 73 74 74 /* Block URLs */ 75 #define TWITTER_BLOCKS_CREATE_URL "/blocks/create/"76 #define TWITTER_BLOCKS_DESTROY_URL "/blocks/destroy/"75 #define TWITTER_BLOCKS_CREATE_URL TWITTER_API_URL "/blocks/create/" 76 #define TWITTER_BLOCKS_DESTROY_URL TWITTER_API_URL "/blocks/destroy/" 77 77 78 78 void twitter_get_friends_ids(struct im_connection *ic, int next_cursor); … … 82 82 void twitter_post_status(struct im_connection *ic, char *msg); 83 83 void twitter_direct_messages_new(struct im_connection *ic, char *who, char *message); 84 void twitter_friendships_create_destroy(struct im_connection *ic, char *who, int create);85 84 86 85 #endif //_TWITTER_LIB_H
Note: See TracChangeset
for help on using the changeset viewer.