Changeset 7db65b7 for protocols/msn


Ignore:
Timestamp:
2010-08-09T19:04:55Z (14 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
523fb23
Parents:
5fecede
Message:

Not working yet, but some code for fetching the membership list. Apparently
an upgrade to MSNP15 is needed. Oh well.

Location:
protocols/msn
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • protocols/msn/ns.c

    r5fecede r7db65b7  
    2929#include "passport.h"
    3030#include "md5.h"
     31#include "soap.h"
    3132
    3233static gboolean msn_ns_callback( gpointer data, gint source, b_input_condition cond );
     
    239240                        imcb_log( ic, "Authenticated, getting buddy list" );
    240241                       
    241                         g_snprintf( buf, sizeof( buf ), "SYN %d 0\r\n", ++md->trId );
    242                         return( msn_write( ic, buf, strlen( buf ) ) );
     242                        msn_soap_memlist_request( ic );
    243243                }
    244244                else
  • protocols/msn/soap.c

    r5fecede r7db65b7  
    8383static int msn_soap_send_request( struct msn_soap_req_data *soap_req )
    8484{
     85        struct msn_data *md = soap_req->ic->proto_data;
    8586        char *http_req;
     87        char *pom, *s;
    8688        url_t url;
    8789       
    8890        soap_req->build_request( soap_req );
     91       
     92        pom = g_new0( char, strlen( md->passport_token ) * 3 );
     93        strcpy( pom, md->passport_token + 2 );
     94        if( ( s = strchr( pom, '&' ) ) )
     95                *s = '\0';
    8996       
    9097        url_set( &url, soap_req->url );
    9198        http_req = g_strdup_printf( SOAP_HTTP_REQUEST, url.file, url.host,
    92                 soap_req->action, strlen( soap_req->payload ), soap_req->payload );
     99                soap_req->action, pom,
     100                strlen( soap_req->payload ), soap_req->payload );
    93101       
    94102        soap_req->http_req = http_dorequest( url.host, url.port, url.proto == PROTO_HTTPS,
     
    152160       
    153161        soap_req->url = g_strdup( SOAP_OIM_SEND_URL );
    154         soap_req->action = g_strdup( SOAP_OIM_ACTION_URL );
     162        soap_req->action = g_strdup( SOAP_OIM_SEND_ACTION );
    155163        soap_req->payload = g_markup_printf_escaped( SOAP_OIM_SEND_PAYLOAD,
    156164                ic->acc->user, display_name_b64, oim->to, md->passport_token,
     
    256264        }
    257265}
     266
     267
     268/* memlist: Fetching the membership list (NOT address book) */
     269
     270#if 0
     271struct msn_soap_oim_send_data
     272{
     273        char *to;
     274        char *msg;
     275        int number;
     276        int need_retry;
     277};
     278#endif
     279
     280static int msn_soap_memlist_build_request( struct msn_soap_req_data *soap_req )
     281{
     282        soap_req->url = g_strdup( SOAP_MEMLIST_URL );
     283        soap_req->action = g_strdup( SOAP_MEMLIST_ACTION );
     284        soap_req->payload = g_strdup( SOAP_MEMLIST_PAYLOAD );
     285       
     286        return 1;
     287}
     288
     289static const struct xt_handler_entry msn_soap_memlist_parser[] = {
     290        { NULL,               NULL,     NULL                        }
     291};
     292
     293static int msn_soap_memlist_handle_response( struct msn_soap_req_data *soap_req )
     294{
     295        return 0;
     296}
     297
     298static int msn_soap_memlist_free_data( struct msn_soap_req_data *soap_req )
     299{
     300        return 0;
     301}
     302
     303int msn_soap_memlist_request( struct im_connection *ic )
     304{
     305        return msn_soap_start( ic, NULL, msn_soap_memlist_build_request,
     306                                         msn_soap_memlist_parser,
     307                                         msn_soap_memlist_handle_response,
     308                                         msn_soap_memlist_free_data );
     309}
  • protocols/msn/soap.h

    r5fecede r7db65b7  
    4646"User-Agent: BitlBee " BITLBEE_VERSION "\r\n" \
    4747"Content-Type: text/xml; charset=utf-8\r\n" \
     48"Cookie: MSPAuth=%s\r\n" \
    4849"Content-Length: %d\r\n" \
    4950"Cache-Control: no-cache\r\n" \
     
    5354
    5455#define SOAP_OIM_SEND_URL "https://ows.messenger.msn.com/OimWS/oim.asmx"
    55 #define SOAP_OIM_ACTION_URL "http://messenger.msn.com/ws/2004/09/oim/Store"
     56#define SOAP_OIM_SEND_ACTION "http://messenger.msn.com/ws/2004/09/oim/Store"
    5657
    5758#define SOAP_OIM_SEND_PAYLOAD \
     
    8586int msn_soap_oim_send_queue( struct im_connection *ic, GSList **msgq );
    8687
     88
     89#define SOAP_MEMLIST_URL "https://byrdr.omega.contacts.msn.com/abservice/SharingService.asmx"
     90#define SOAP_MEMLIST_ACTION "http://www.msn.com/webservices/AddressBook/FindMembership"
     91
     92#define SOAP_MEMLIST_PAYLOAD \
     93"<?xml version=\"1.0\" encoding=\"utf-8\"?>" \
     94"<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" \
     95  "<soap:Header xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" \
     96    "<ABApplicationHeader xmlns=\"http://www.msn.com/webservices/AddressBook\">" \
     97      "<ApplicationId xmlns=\"http://www.msn.com/webservices/AddressBook\">CFE80F9D-180F-4399-82AB-413F33A1FA11</ApplicationId>" \
     98      "<IsMigration xmlns=\"http://www.msn.com/webservices/AddressBook\">false</IsMigration>" \
     99      "<PartnerScenario xmlns=\"http://www.msn.com/webservices/AddressBook\">Initial</PartnerScenario>" \
     100    "</ABApplicationHeader>" \
     101    "<ABAuthHeader xmlns=\"http://www.msn.com/webservices/AddressBook\">" \
     102      "<ManagedGroupRequest xmlns=\"http://www.msn.com/webservices/AddressBook\">false</ManagedGroupRequest>" \
     103    "</ABAuthHeader>" \
     104  "</soap:Header>" \
     105  "<soap:Body xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" \
     106    "<FindMembership xmlns=\"http://www.msn.com/webservices/AddressBook\"><serviceFilter xmlns=\"http://www.msn.com/webservices/AddressBook\"><Types xmlns=\"http://www.msn.com/webservices/AddressBook\"><ServiceType xmlns=\"http://www.msn.com/webservices/AddressBook\">Messenger</ServiceType><ServiceType xmlns=\"http://www.msn.com/webservices/AddressBook\">Invitation</ServiceType><ServiceType xmlns=\"http://www.msn.com/webservices/AddressBook\">SocialNetwork</ServiceType><ServiceType xmlns=\"http://www.msn.com/webservices/AddressBook\">Space</ServiceType><ServiceType xmlns=\"http://www.msn.com/webservices/AddressBook\">Profile</ServiceType></Types></serviceFilter>" \
     107    "</FindMembership>" \
     108  "</soap:Body>" \
     109"</soap:Envelope>"
     110
     111int msn_soap_memlist_request( struct im_connection *ic );
     112
     113
    87114#endif /* __SOAP_H__ */
Note: See TracChangeset for help on using the changeset viewer.