- Timestamp:
- 2008-04-14T13:10:53Z (17 years ago)
- Branches:
- master
- Children:
- 0cab388
- Parents:
- 6cac643 (diff), aa31117 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- protocols
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/Makefile
r6cac643 rb79308b 27 27 all: protocols.o 28 28 check: all 29 lcov: 29 lcov: check 30 30 gcov: 31 31 gcov *.c -
protocols/jabber/Makefile
r6cac643 rb79308b 10 10 11 11 # [SH] Program variables 12 objects = conference.o io.o iq.o jabber.o jabber_util.o message.o presence.o sasl.o xmltree.osi.o s5bytestream.o12 objects = conference.o io.o iq.o jabber.o jabber_util.o message.o presence.o sasl.o si.o s5bytestream.o 13 13 14 14 CFLAGS += -Wall … … 18 18 all: jabber_mod.o 19 19 check: all 20 lcov: 20 lcov: check 21 21 gcov: 22 22 gcov *.c -
protocols/jabber/io.c
r6cac643 rb79308b 241 241 } 242 242 243 /* EAGAIN/etc or a successful read. */ 244 return TRUE; 243 if( ssl_pending( jd->ssl ) ) 244 /* OpenSSL empties the TCP buffers completely but may keep some 245 data in its internap buffers. select() won't see that, but 246 ssl_pending() does. */ 247 return jabber_read_callback( data, fd, cond ); 248 else 249 return TRUE; 245 250 } 246 251 … … 521 526 from the server too. */ 522 527 xt_free( jd->xt ); /* In case we're RE-starting. */ 523 jd->xt = xt_new( ic ); 524 jd->xt->handlers = (struct xt_handler_entry*) jabber_handlers; 528 jd->xt = xt_new( jabber_handlers, ic ); 525 529 526 530 if( jd->r_inpa <= 0 ) -
protocols/jabber/iq.c
r6cac643 rb79308b 534 534 } 535 535 536 static xt_status jabber_add_to_roster_callback( struct im_connection *ic, struct xt_node *node, struct xt_node *orig ); 537 536 538 int jabber_add_to_roster( struct im_connection *ic, char *handle, char *name ) 537 539 { … … 549 551 xt_add_attr( node, "xmlns", XMLNS_ROSTER ); 550 552 node = jabber_make_packet( "iq", "set", NULL, node ); 553 jabber_cache_add( ic, node, jabber_add_to_roster_callback ); 551 554 552 555 st = jabber_write_packet( ic, node ); 553 556 554 xt_free_node( node );555 557 return st; 558 } 559 560 static xt_status jabber_add_to_roster_callback( struct im_connection *ic, struct xt_node *node, struct xt_node *orig ) 561 { 562 char *s, *jid = NULL; 563 struct xt_node *c; 564 565 if( ( c = xt_find_node( orig->children, "query" ) ) && 566 ( c = xt_find_node( c->children, "item" ) ) && 567 ( jid = xt_find_attr( c, "jid" ) ) && 568 ( s = xt_find_attr( node, "type" ) ) && 569 strcmp( s, "result" ) == 0 ) 570 { 571 if( imcb_find_buddy( ic, jid ) == NULL ) 572 imcb_add_buddy( ic, jid, NULL ); 573 } 574 else 575 { 576 imcb_log( ic, "Error while adding `%s' to your contact list.", 577 jid ? jid : "(unknown handle)" ); 578 } 579 580 return XT_HANDLED; 556 581 } 557 582 -
protocols/jabber/jabber.c
r6cac643 rb79308b 267 267 xt_free( jd->xt ); 268 268 269 g_free( jd->cached_id_prefix ); 269 270 g_free( jd->away_message ); 270 271 g_free( jd->username ); -
protocols/jabber/jabber_util.c
r6cac643 rb79308b 250 250 }; 251 251 252 static void jabber_buddy_ask_yes( gpointer w, struct jabber_buddy_ask_data *bla ) 253 { 252 static void jabber_buddy_ask_yes( void *data ) 253 { 254 struct jabber_buddy_ask_data *bla = data; 255 254 256 presence_send_request( bla->ic, bla->handle, "subscribed" ); 255 257 … … 261 263 } 262 264 263 static void jabber_buddy_ask_no( gpointer w, struct jabber_buddy_ask_data *bla ) 264 { 265 static void jabber_buddy_ask_no( void *data ) 266 { 267 struct jabber_buddy_ask_data *bla = data; 268 265 269 presence_send_request( bla->ic, bla->handle, "subscribed" ); 266 270 -
protocols/jabber/sasl.c
r6cac643 rb79308b 21 21 * * 22 22 \***************************************************************************/ 23 24 #include <ctype.h> 23 25 24 26 #include "jabber.h" … … 107 109 } 108 110 109 static char *sasl_get_part( char *data, char *field ) 111 /* Non-static function, but not mentioned in jabber.h because it's for internal 112 use, just that the unittest should be able to reach it... */ 113 char *sasl_get_part( char *data, char *field ) 110 114 { 111 115 int i, len; 112 116 113 117 len = strlen( field ); 118 119 while( isspace( *data ) || *data == ',' ) 120 data ++; 114 121 115 122 if( g_strncasecmp( data, field, len ) == 0 && data[len] == '=' ) … … 129 136 } 130 137 131 /* If we got a comma, we got a new field. Check it. */ 132 if( data[i] == ',' && 133 g_strncasecmp( data + i + 1, field, len ) == 0 && 134 data[i+len+1] == '=' ) 138 /* If we got a comma, we got a new field. Check it, 139 find the next key after it. */ 140 if( data[i] == ',' ) 135 141 { 136 i += len + 2; 137 break; 142 while( isspace( data[i] ) || data[i] == ',' ) 143 i ++; 144 145 if( g_strncasecmp( data + i, field, len ) == 0 && 146 data[i+len] == '=' ) 147 { 148 i += len + 1; 149 break; 150 } 138 151 } 139 152 } -
protocols/msn/Makefile
r6cac643 rb79308b 18 18 all: msn_mod.o 19 19 check: all 20 lcov: 20 lcov: check 21 21 gcov: 22 22 gcov *.c -
protocols/msn/msn.h
r6cac643 rb79308b 29 29 #define GROUPCHAT_SWITCHBOARD_MESSAGE "\r\r\rME WANT TALK TO MANY PEOPLE\r\r\r" 30 30 31 #ifdef DEBUG 31 #ifdef DEBUG_MSN 32 32 #define debug( text... ) imcb_log( ic, text ); 33 33 #else -
protocols/msn/msn_util.c
r6cac643 rb79308b 90 90 }; 91 91 92 static void msn_buddy_ask_yes( gpointer w, struct msn_buddy_ask_data *bla ) 93 { 92 static void msn_buddy_ask_yes( void *data ) 93 { 94 struct msn_buddy_ask_data *bla = data; 95 94 96 msn_buddy_list_add( bla->ic, "AL", bla->handle, bla->realname ); 95 97 … … 102 104 } 103 105 104 static void msn_buddy_ask_no( gpointer w, struct msn_buddy_ask_data *bla ) 105 { 106 static void msn_buddy_ask_no( void *data ) 107 { 108 struct msn_buddy_ask_data *bla = data; 109 106 110 msn_buddy_list_add( bla->ic, "BL", bla->handle, bla->realname ); 107 111 -
protocols/msn/ns.c
r6cac643 rb79308b 34 34 static int msn_ns_message( gpointer data, char *msg, int msglen, char **cmd, int num_parts ); 35 35 36 static void msn_auth_got_passport_ id( struct passport_reply *rep);36 static void msn_auth_got_passport_token( struct msn_auth_data *mad ); 37 37 38 38 gboolean msn_ns_connected( gpointer data, gint source, b_input_condition cond ) … … 214 214 { 215 215 /* Time for some Passport black magic... */ 216 if( !passport_get_ id( msn_auth_got_passport_id, ic, ic->acc->user, ic->acc->pass, cmd[4] ) )216 if( !passport_get_token( msn_auth_got_passport_token, ic, ic->acc->user, ic->acc->pass, cmd[4] ) ) 217 217 { 218 218 imcb_error( ic, "Error while contacting Passport server" ); … … 674 674 } 675 675 676 static void msn_auth_got_passport_ id( struct passport_reply *rep)676 static void msn_auth_got_passport_token( struct msn_auth_data *mad ) 677 677 { 678 struct im_connection *ic = rep->data; 679 struct msn_data *md = ic->proto_data; 680 char *key = rep->result; 681 char buf[1024]; 682 683 if( key == NULL ) 684 { 685 imcb_error( ic, "Error during Passport authentication (%s)", 686 rep->error_string ? rep->error_string : "Unknown error" ); 678 struct im_connection *ic = mad->data; 679 struct msn_data *md; 680 681 /* Dead connection? */ 682 if( g_slist_find( msn_connections, ic ) == NULL ) 683 return; 684 685 md = ic->proto_data; 686 if( mad->token ) 687 { 688 char buf[1024]; 689 690 g_snprintf( buf, sizeof( buf ), "USR %d TWN S %s\r\n", ++md->trId, mad->token ); 691 msn_write( ic, buf, strlen( buf ) ); 692 } 693 else 694 { 695 imcb_error( ic, "Error during Passport authentication: %s", mad->error ); 687 696 imc_logout( ic, TRUE ); 688 697 } 689 else690 {691 g_snprintf( buf, sizeof( buf ), "USR %d TWN S %s\r\n", ++md->trId, key );692 msn_write( ic, buf, strlen( buf ) );693 }694 698 } -
protocols/msn/passport.c
r6cac643 rb79308b 1 /* passport.c1 /** passport.c 2 2 * 3 * Functions to login to microsoft passport service for Messenger 4 * Copyright (C) 2004 Wouter Paesen <wouter@blue-gate.be> 5 * Copyright (C) 2004 Wilmer van der Gaast <wilmer@gaast.net> 3 * Functions to login to Microsoft Passport service for Messenger 4 * Copyright (C) 2004-2008 Wilmer van der Gaast <wilmer@gaast.net> 6 5 * 7 6 * This program is free software; you can redistribute it and/or modify … … 24 23 #include "msn.h" 25 24 #include "bitlbee.h" 25 #include "url.h" 26 #include "misc.h" 27 #include "xmltree.h" 26 28 #include <ctype.h> 27 29 #include <errno.h> 28 30 29 #define MSN_BUF_LEN 8192 31 static int passport_get_token_real( struct msn_auth_data *mad ); 32 static void passport_get_token_ready( struct http_request *req ); 30 33 31 static char *prd_cached = NULL; 32 33 static int passport_get_id_real( gpointer func, gpointer data, char *header ); 34 static void passport_get_id_ready( struct http_request *req ); 35 36 static int passport_retrieve_dalogin( gpointer data, gpointer func, char *header ); 37 static void passport_retrieve_dalogin_ready( struct http_request *req ); 38 39 static char *passport_create_header( char *cookie, char *email, char *pwd ); 40 static void destroy_reply( struct passport_reply *rep ); 41 42 int passport_get_id( gpointer func, gpointer data, char *username, char *password, char *cookie ) 34 int passport_get_token( gpointer func, gpointer data, char *username, char *password, char *cookie ) 43 35 { 44 char *header = passport_create_header( cookie, username, password ); 36 struct msn_auth_data *mad = g_new0( struct msn_auth_data, 1 ); 37 int i; 45 38 46 if( prd_cached == NULL ) 47 return passport_retrieve_dalogin( func, data, header ); 48 else 49 return passport_get_id_real( func, data, header ); 39 mad->username = g_strdup( username ); 40 mad->password = g_strdup( password ); 41 mad->cookie = g_strdup( cookie ); 42 43 mad->callback = func; 44 mad->data = data; 45 46 mad->url = g_strdup( SOAP_AUTHENTICATION_URL ); 47 mad->ttl = 3; /* Max. # of redirects. */ 48 49 /* HTTP-escape stuff and s/,/&/ */ 50 http_decode( mad->cookie ); 51 for( i = 0; mad->cookie[i]; i ++ ) 52 if( mad->cookie[i] == ',' ) 53 mad->cookie[i] = '&'; 54 55 /* Microsoft doesn't allow password longer than 16 chars and silently 56 fails authentication if you give the "full version" of your passwd. */ 57 if( strlen( mad->password ) > MAX_PASSPORT_PWLEN ) 58 mad->password[MAX_PASSPORT_PWLEN] = 0; 59 60 return passport_get_token_real( mad ); 50 61 } 51 62 52 static int passport_get_ id_real( gpointer func, gpointer data, char *header)63 static int passport_get_token_real( struct msn_auth_data *mad ) 53 64 { 54 struct passport_reply *rep; 55 char *server, *dummy, *reqs; 65 char *post_payload, *post_request; 56 66 struct http_request *req; 67 url_t url; 57 68 58 rep = g_new0( struct passport_reply, 1 ); 59 rep->data = data; 60 rep->func = func; 61 rep->header = header; 69 url_set( &url, mad->url ); 62 70 63 server = g_strdup( prd_cached ); 64 dummy = strchr( server, '/' ); 71 post_payload = g_markup_printf_escaped( SOAP_AUTHENTICATION_PAYLOAD, 72 mad->username, 73 mad->password, 74 mad->cookie ); 65 75 66 if( dummy == NULL ) 67 { 68 destroy_reply( rep ); 69 return( 0 ); 70 } 76 post_request = g_strdup_printf( SOAP_AUTHENTICATION_REQUEST, 77 url.file, url.host, 78 (int) strlen( post_payload ), 79 post_payload ); 80 81 req = http_dorequest( url.host, url.port, 1, post_request, 82 passport_get_token_ready, mad ); 71 83 72 reqs = g_strdup_printf( "GET %s HTTP/1.0\r\n%s\r\n\r\n", dummy, header ); 84 g_free( post_request ); 85 g_free( post_payload ); 73 86 74 *dummy = 0; 75 req = http_dorequest( server, 443, 1, reqs, passport_get_id_ready, rep ); 76 77 g_free( server ); 78 g_free( reqs ); 79 80 if( req == NULL ) 81 destroy_reply( rep ); 82 83 return( req != NULL ); 87 return req != NULL; 84 88 } 85 89 86 static void passport_get_id_ready( struct http_request *req ) 90 static xt_status passport_xt_extract_token( struct xt_node *node, gpointer data ); 91 static xt_status passport_xt_handle_fault( struct xt_node *node, gpointer data ); 92 93 static const struct xt_handler_entry passport_xt_handlers[] = { 94 { "wsse:BinarySecurityToken", "wst:RequestedSecurityToken", passport_xt_extract_token }, 95 { "S:Fault", "S:Envelope", passport_xt_handle_fault }, 96 { NULL, NULL, NULL } 97 }; 98 99 static void passport_get_token_ready( struct http_request *req ) 87 100 { 88 struct passport_reply *rep = req->data; 101 struct msn_auth_data *mad = req->data; 102 struct xt_parser *parser; 89 103 90 if( !g_slist_find( msn_connections, rep->data ) ) 104 g_free( mad->url ); 105 g_free( mad->error ); 106 mad->url = mad->error = NULL; 107 108 if( req->status_code == 200 ) 91 109 { 92 destroy_reply( rep ); 93 return; 94 } 95 96 if( req->finished && req->reply_headers && req->status_code == 200 ) 97 { 98 char *dummy; 99 100 if( ( dummy = strstr( req->reply_headers, "from-PP='" ) ) ) 101 { 102 char *responseend; 103 104 dummy += strlen( "from-PP='" ); 105 responseend = strchr( dummy, '\'' ); 106 if( responseend ) 107 *responseend = 0; 108 109 rep->result = g_strdup( dummy ); 110 } 111 else 112 { 113 rep->error_string = g_strdup( "Could not parse Passport server response" ); 114 } 110 parser = xt_new( passport_xt_handlers, mad ); 111 xt_feed( parser, req->reply_body, req->body_size ); 112 xt_handle( parser, NULL, -1 ); 113 xt_free( parser ); 115 114 } 116 115 else 117 116 { 118 rep->error_string = g_strdup_printf( "HTTP error: %s",119 req->status_string ? req->status_string : "Unknown error" );117 mad->error = g_strdup_printf( "HTTP error %d (%s)", req->status_code, 118 req->status_string ? req->status_string : "unknown" ); 120 119 } 121 120 122 rep->func( rep ); 123 destroy_reply( rep ); 121 if( mad->error == NULL && mad->token == NULL ) 122 mad->error = g_strdup( "Could not parse Passport server response" ); 123 124 if( mad->url && mad->token == NULL ) 125 { 126 passport_get_token_real( mad ); 127 } 128 else 129 { 130 mad->callback( mad ); 131 132 g_free( mad->url ); 133 g_free( mad->username ); 134 g_free( mad->password ); 135 g_free( mad->cookie ); 136 g_free( mad->token ); 137 g_free( mad->error ); 138 g_free( mad ); 139 } 124 140 } 125 141 126 static char *passport_create_header( char *cookie, char *email, char *pwd)142 static xt_status passport_xt_extract_token( struct xt_node *node, gpointer data ) 127 143 { 128 char *buffer; 129 char *currenttoken; 130 char *email_enc, *pwd_enc; 144 struct msn_auth_data *mad = data; 145 char *s; 131 146 132 currenttoken = strstr( cookie, "lc=" ); 133 if( currenttoken == NULL ) 134 return NULL; 147 if( ( s = xt_find_attr( node, "Id" ) ) && strcmp( s, "PPToken1" ) == 0 ) 148 mad->token = g_memdup( node->text, node->text_len + 1 ); 135 149 136 email_enc = g_new0( char, strlen( email ) * 3 + 1 ); 137 strcpy( email_enc, email ); 138 http_encode( email_enc ); 139 140 pwd_enc = g_new0( char, strlen( pwd ) * 3 + 1 ); 141 strcpy( pwd_enc, pwd ); 142 http_encode( pwd_enc ); 143 144 buffer = g_strdup_printf( "Authorization: Passport1.4 OrgVerb=GET," 145 "OrgURL=http%%3A%%2F%%2Fmessenger%%2Emsn%%2Ecom," 146 "sign-in=%s,pwd=%s,%s", email_enc, pwd_enc, 147 currenttoken ); 148 149 g_free( email_enc ); 150 g_free( pwd_enc ); 151 152 return buffer; 150 return XT_HANDLED; 153 151 } 154 152 155 static int passport_retrieve_dalogin( gpointer func, gpointer data, char *header)153 static xt_status passport_xt_handle_fault( struct xt_node *node, gpointer data ) 156 154 { 157 struct passport_reply *rep = g_new0( struct passport_reply, 1 ); 158 struct http_request *req; 155 struct msn_auth_data *mad = data; 156 struct xt_node *code = xt_find_node( node->children, "faultcode" ); 157 struct xt_node *string = xt_find_node( node->children, "faultstring" ); 158 struct xt_node *redirect = xt_find_node( node->children, "psf:redirectUrl" ); 159 159 160 rep->data = data; 161 rep->func = func; 162 rep->header = header; 160 if( redirect && redirect->text_len && mad->ttl-- > 0 ) 161 mad->url = g_memdup( redirect->text, redirect->text_len + 1 ); 163 162 164 req = http_dorequest_url( "https://nexus.passport.com/rdr/pprdr.asp", passport_retrieve_dalogin_ready, rep ); 163 if( code == NULL || code->text_len == 0 ) 164 mad->error = g_strdup( "Unknown error" ); 165 else 166 mad->error = g_strdup_printf( "%s (%s)", code->text, string && string->text_len ? 167 string->text : "no description available" ); 165 168 166 if( !req ) 167 destroy_reply( rep ); 168 169 return( req != NULL ); 169 return XT_HANDLED; 170 170 } 171 172 static void passport_retrieve_dalogin_ready( struct http_request *req )173 {174 struct passport_reply *rep = req->data;175 char *dalogin;176 char *urlend;177 178 if( !g_slist_find( msn_connections, rep->data ) )179 {180 destroy_reply( rep );181 return;182 }183 184 if( !req->finished || !req->reply_headers || req->status_code != 200 )185 {186 rep->error_string = g_strdup_printf( "HTTP error while fetching DALogin: %s",187 req->status_string ? req->status_string : "Unknown error" );188 goto failure;189 }190 191 dalogin = strstr( req->reply_headers, "DALogin=" );192 193 if( !dalogin )194 {195 rep->error_string = g_strdup( "Parse error while fetching DALogin" );196 goto failure;197 }198 199 dalogin += strlen( "DALogin=" );200 urlend = strchr( dalogin, ',' );201 if( urlend )202 *urlend = 0;203 204 /* strip the http(s):// part from the url */205 urlend = strstr( urlend, "://" );206 if( urlend )207 dalogin = urlend + strlen( "://" );208 209 if( prd_cached == NULL )210 prd_cached = g_strdup( dalogin );211 212 if( passport_get_id_real( rep->func, rep->data, rep->header ) )213 {214 rep->header = NULL;215 destroy_reply( rep );216 return;217 }218 219 failure:220 rep->func( rep );221 destroy_reply( rep );222 }223 224 static void destroy_reply( struct passport_reply *rep )225 {226 g_free( rep->result );227 g_free( rep->header );228 g_free( rep->error_string );229 g_free( rep );230 } -
protocols/msn/passport.h
r6cac643 rb79308b 1 #ifndef __PASSPORT_H__2 #define __PASSPORT_H__3 1 /* passport.h 4 2 * 5 * Functions to login to Microsoft Passport Service for Messenger 6 * Copyright (C) 2004 Wouter Paesen <wouter@blue-gate.be>, 7 * Wilmer van der Gaast <wilmer@gaast.net> 3 * Functions to login to Microsoft Passport service for Messenger 4 * Copyright (C) 2004-2008 Wilmer van der Gaast <wilmer@gaast.net> 8 5 * 9 6 * This program is free software; you can redistribute it and/or modify … … 18 15 * You should have received a copy of the GNU General Public License 19 16 * along with this program; if not, write to the Free Software 20 * 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 18 */ 19 20 /* Thanks to http://msnpiki.msnfanatic.com/index.php/MSNP13:SOAPTweener 21 for the specs! */ 22 23 #ifndef __PASSPORT_H__ 24 #define __PASSPORT_H__ 22 25 23 26 #include <stdio.h> … … 33 36 #include "nogaim.h" 34 37 35 struct passport_reply 38 #define MAX_PASSPORT_PWLEN 16 39 40 struct msn_auth_data 36 41 { 37 void (*func)( struct passport_reply * ); 38 void *data; 39 char *result; 40 char *header; 41 char *error_string; 42 char *url; 43 int ttl; 44 45 char *username; 46 char *password; 47 char *cookie; 48 49 /* The end result, the only thing we'll really be interested in 50 once finished. */ 51 char *token; 52 char *error; /* Yeah, or that... */ 53 54 void (*callback)( struct msn_auth_data *mad ); 55 gpointer data; 42 56 }; 43 57 44 int passport_get_id( gpointer func, gpointer data, char *username, char *password, char *cookie ); 58 #define SOAP_AUTHENTICATION_URL "https://loginnet.passport.com/RST.srf" 59 60 #define SOAP_AUTHENTICATION_REQUEST \ 61 "POST %s HTTP/1.0\r\n" \ 62 "Accept: text/*\r\n" \ 63 "User-Agent: BitlBee " BITLBEE_VERSION "\r\n" \ 64 "Host: %s\r\n" \ 65 "Content-Length: %d\r\n" \ 66 "Cache-Control: no-cache\r\n" \ 67 "\r\n" \ 68 "%s" 69 70 #define SOAP_AUTHENTICATION_PAYLOAD \ 71 "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" \ 72 "<Envelope xmlns=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:wsse=\"http://schemas.xmlsoap.org/ws/2003/06/secext\" xmlns:saml=\"urn:oasis:names:tc:SAML:1.0:assertion\" xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2002/12/policy\" xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\" xmlns:wsa=\"http://schemas.xmlsoap.org/ws/2004/03/addressing\" xmlns:wssc=\"http://schemas.xmlsoap.org/ws/2004/04/sc\" xmlns:wst=\"http://schemas.xmlsoap.org/ws/2004/04/trust\">" \ 73 "<Header>" \ 74 "<ps:AuthInfo xmlns:ps=\"http://schemas.microsoft.com/Passport/SoapServices/PPCRL\" Id=\"PPAuthInfo\">" \ 75 "<ps:HostingApp>{7108E71A-9926-4FCB-BCC9-9A9D3F32E423}</ps:HostingApp>" \ 76 "<ps:BinaryVersion>4</ps:BinaryVersion>" \ 77 "<ps:UIVersion>1</ps:UIVersion>" \ 78 "<ps:Cookies></ps:Cookies>" \ 79 "<ps:RequestParams>AQAAAAIAAABsYwQAAAAzMDg0</ps:RequestParams>" \ 80 "</ps:AuthInfo>" \ 81 "<wsse:Security>" \ 82 "<wsse:UsernameToken Id=\"user\">" \ 83 "<wsse:Username>%s</wsse:Username>" \ 84 "<wsse:Password>%s</wsse:Password>" \ 85 "</wsse:UsernameToken>" \ 86 "</wsse:Security>" \ 87 "</Header>" \ 88 "<Body>" \ 89 "<ps:RequestMultipleSecurityTokens xmlns:ps=\"http://schemas.microsoft.com/Passport/SoapServices/PPCRL\" Id=\"RSTS\">" \ 90 "<wst:RequestSecurityToken Id=\"RST0\">" \ 91 "<wst:RequestType>http://schemas.xmlsoap.org/ws/2004/04/security/trust/Issue</wst:RequestType>" \ 92 "<wsp:AppliesTo>" \ 93 "<wsa:EndpointReference>" \ 94 "<wsa:Address>http://Passport.NET/tb</wsa:Address>" \ 95 "</wsa:EndpointReference>" \ 96 "</wsp:AppliesTo>" \ 97 "</wst:RequestSecurityToken>" \ 98 "<wst:RequestSecurityToken Id=\"RST1\">" \ 99 "<wst:RequestType>http://schemas.xmlsoap.org/ws/2004/04/security/trust/Issue</wst:RequestType>" \ 100 "<wsp:AppliesTo>" \ 101 "<wsa:EndpointReference>" \ 102 "<wsa:Address>messenger.msn.com</wsa:Address>" \ 103 "</wsa:EndpointReference>" \ 104 "</wsp:AppliesTo>" \ 105 "<wsse:PolicyReference URI=\"?%s\"></wsse:PolicyReference>" \ 106 "</wst:RequestSecurityToken>" \ 107 "</ps:RequestMultipleSecurityTokens>" \ 108 "</Body>" \ 109 "</Envelope>" 110 111 int passport_get_token( gpointer func, gpointer data, char *username, char *password, char *cookie ); 45 112 46 113 #endif /* __PASSPORT_H__ */ -
protocols/nogaim.c
r6cac643 rb79308b 343 343 /* dialogs.c */ 344 344 345 void imcb_ask( struct im_connection *ic, char *msg, void *data, void *doit, void *dont ) 345 void imcb_ask( struct im_connection *ic, char *msg, void *data, 346 query_callback doit, query_callback dont ) 346 347 { 347 348 query_add( ic->irc, ic, msg, doit, dont, data ); … … 495 496 }; 496 497 497 void show_got_added_no( gpointer w, struct show_got_added_data*data )498 { 499 g_free( data->handle );498 void show_got_added_no( void *data ) 499 { 500 g_free( ((struct show_got_added_data*)data)->handle ); 500 501 g_free( data ); 501 502 } 502 503 503 void show_got_added_yes( gpointer w, struct show_got_added_data *data ) 504 { 505 data->ic->acc->prpl->add_buddy( data->ic, data->handle, NULL ); 506 /* imcb_add_buddy( data->ic, NULL, data->handle, data->handle ); */ 507 508 return show_got_added_no( w, data ); 504 void show_got_added_yes( void *data ) 505 { 506 struct show_got_added_data *sga = data; 507 508 sga->ic->acc->prpl->add_buddy( sga->ic, sga->handle, NULL ); 509 /* imcb_add_buddy( sga->ic, NULL, sga->handle, sga->handle ); */ 510 511 return show_got_added_no( data ); 509 512 } 510 513 -
protocols/nogaim.h
r6cac643 rb79308b 42 42 #include "account.h" 43 43 #include "proxy.h" 44 #include "query.h" 44 45 #include "md5.h" 45 46 #include "ft.h" … … 265 266 * - 'doit' or 'dont' will be called depending of the answer of the user. 266 267 */ 267 G_MODULE_EXPORT void imcb_ask( struct im_connection *ic, char *msg, void *data, void *doit, void *dont );268 G_MODULE_EXPORT void imcb_ask( struct im_connection *ic, char *msg, void *data, query_callback doit, query_callback dont ); 268 269 G_MODULE_EXPORT void imcb_ask_add( struct im_connection *ic, char *handle, const char *realname ); 269 270 -
protocols/oscar/Makefile
r6cac643 rb79308b 18 18 all: oscar_mod.o 19 19 check: all 20 lcov: 20 lcov: check 21 21 gcov: 22 22 gcov *.c -
protocols/oscar/oscar.c
r6cac643 rb79308b 1084 1084 } 1085 1085 1086 void oscar_accept_chat( gpointer w, struct aim_chat_invitation * inv);1087 void oscar_reject_chat( gpointer w, struct aim_chat_invitation * inv);1086 void oscar_accept_chat(void *data); 1087 void oscar_reject_chat(void *data); 1088 1088 1089 1089 static int incomingim_chan2(aim_session_t *sess, aim_conn_t *conn, aim_userinfo_t *userinfo, struct aim_incomingim_ch2_args *args) { … … 1119 1119 } 1120 1120 1121 static void gaim_icq_authgrant(gpointer w, struct icq_auth *data) { 1121 static void gaim_icq_authgrant(void *data_) { 1122 struct icq_auth *data = data_; 1122 1123 char *uin, message; 1123 1124 struct oscar_data *od = (struct oscar_data *)data->ic->proto_data; … … 1134 1135 } 1135 1136 1136 static void gaim_icq_authdeny(gpointer w, struct icq_auth *data) { 1137 static void gaim_icq_authdeny(void *data_) { 1138 struct icq_auth *data = data_; 1137 1139 char *uin, *message; 1138 1140 struct oscar_data *od = (struct oscar_data *)data->ic->proto_data; … … 2588 2590 } 2589 2591 2590 void oscar_accept_chat( gpointer w, struct aim_chat_invitation * inv)2592 void oscar_accept_chat(void *data) 2591 2593 { 2594 struct aim_chat_invitation * inv = data; 2595 2592 2596 oscar_chat_join(inv->ic, inv->name, NULL, NULL); 2593 2597 g_free(inv->name); … … 2595 2599 } 2596 2600 2597 void oscar_reject_chat( gpointer w, struct aim_chat_invitation * inv)2601 void oscar_reject_chat(void *data) 2598 2602 { 2603 struct aim_chat_invitation * inv = data; 2604 2599 2605 g_free(inv->name); 2600 2606 g_free(inv); -
protocols/yahoo/Makefile
r6cac643 rb79308b 18 18 all: yahoo_mod.o 19 19 check: all 20 lcov: 20 lcov: check 21 21 gcov: 22 22 gcov *.c -
protocols/yahoo/libyahoo2.c
r6cac643 rb79308b 737 737 738 738 memcpy(data + pos, "YMSG", 4); pos += 4; 739 pos += yahoo_put16(data + pos, 0x0 a00);739 pos += yahoo_put16(data + pos, 0x000c); 740 740 pos += yahoo_put16(data + pos, 0x0000); 741 741 pos += yahoo_put16(data + pos, pktlen + extra_pad); … … 3351 3351 break; 3352 3352 case 5: 3353 if( cp != "\005")3353 if(strcmp(cp, "5") != 0) 3354 3354 yct->location = cp; 3355 3355 k = 0; -
protocols/yahoo/yahoo.c
r6cac643 rb79308b 315 315 struct byahoo_data *yd = (struct byahoo_data *) c->ic->proto_data; 316 316 317 yahoo_conference_invite( yd->y2_id, NULL, c->data, c->title, msg );317 yahoo_conference_invite( yd->y2_id, NULL, c->data, c->title, msg ? msg : "" ); 318 318 } 319 319 … … 797 797 } 798 798 799 static void byahoo_accept_conf( gpointer w, struct byahoo_conf_invitation *inv ) 800 { 799 static void byahoo_accept_conf( void *data ) 800 { 801 struct byahoo_conf_invitation *inv = data; 802 801 803 yahoo_conference_logon( inv->yid, NULL, inv->members, inv->name ); 802 804 imcb_chat_add_buddy( inv->c, inv->ic->acc->user ); … … 805 807 } 806 808 807 static void byahoo_reject_conf( gpointer w, struct byahoo_conf_invitation *inv ) 808 { 809 static void byahoo_reject_conf( void *data ) 810 { 811 struct byahoo_conf_invitation *inv = data; 812 809 813 yahoo_conference_decline( inv->yid, NULL, inv->members, inv->name, "User rejected groupchat" ); 810 814 imcb_chat_free( inv->c );
Note: See TracChangeset
for help on using the changeset viewer.