Changeset bc676ac


Ignore:
Timestamp:
2012-09-16T00:09:58Z (12 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
f9258ae
Parents:
ddca104
Message:

MSNP18 code. It logs in now but otherwise doesn't work all too well.

Location:
protocols/msn
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • protocols/msn/msn.c

    rddca104 rbc676ac  
    232232{
    233233        struct msn_switchboard *sb = msn_sb_by_chat( c );
    234         char buf[1024];
    235234       
    236235        if( sb )
    237         {
    238                 g_snprintf( buf, sizeof( buf ), "CAL %d %s\r\n", ++sb->trId, who );
    239                 msn_sb_write( sb, buf, strlen( buf ) );
    240         }
     236                msn_sb_write( sb, "CAL %d %s\r\n", ++sb->trId, who );
    241237}
    242238
     
    246242       
    247243        if( sb )
    248                 msn_sb_write( sb, "OUT\r\n", 5 );
     244                msn_sb_write( sb, "OUT\r\n" );
    249245}
    250246
  • protocols/msn/msn.h

    rddca104 rbc676ac  
    5353*/
    5454
     55/* <= BitlBee 3.0.5
    5556#define MSNP11_PROD_KEY "ILTXC!4IXB5FB*PX"
    5657#define MSNP11_PROD_ID  "PROD0119GSJUC$18"
    57 #define MSNP_VER        "MSNP15"
    58 #define MSNP_BUILD      "8.5.1288"
     58*/
     59
     60#define MSNP11_PROD_KEY "C1BX{V4W}Q3*10SM"
     61#define MSNP11_PROD_ID  "PROD0120PW!CCV9@"
     62#define MSNP_VER        "MSNP18"
     63#define MSNP_BUILD      "14.0.8117.416"
    5964
    6065#define MSN_SB_NEW         -24062002
     
    222227
    223228/* ns.c */
    224 int msn_ns_write( struct im_connection *ic, int fd, const char *fmt, ... );
     229int msn_ns_write( struct im_connection *ic, int fd, const char *fmt, ... ) G_GNUC_PRINTF( 3, 4 );
    225230gboolean msn_ns_connect( struct im_connection *ic, struct msn_handler_data *handler, const char *host, int port );
    226231void msn_ns_close( struct msn_handler_data *handler );
     
    228233void msn_auth_got_contact_list( struct im_connection *ic );
    229234int msn_ns_finish_login( struct im_connection *ic );
     235int msn_ns_sendmessage( struct im_connection *ic, struct bee_user *bu, const char *text );
     236void msn_ns_oim_send_queue( struct im_connection *ic, GSList **msgq );
    230237
    231238/* msn_util.c */
     
    250257
    251258/* sb.c */
    252 int msn_sb_write( struct msn_switchboard *sb, const char *fmt, ... );
     259int msn_sb_write( struct msn_switchboard *sb, const char *fmt, ... ) G_GNUC_PRINTF( 2, 3 );;
    253260struct msn_switchboard *msn_sb_create( struct im_connection *ic, char *host, int port, char *key, int session );
    254261struct msn_switchboard *msn_sb_by_handle( struct im_connection *ic, char *handle );
  • protocols/msn/ns.c

    rddca104 rbc676ac  
    757757        if( token )
    758758        {
    759                 msn_ns_write( ic, -1, "USR %d SSO S %s %s\r\n", ++md->trId, md->tokens[0], token );
     759                msn_ns_write( ic, -1, "USR %d SSO S %s %s {7535ef7c-ff92-11e1-8069-50e5493b06de}\r\n", ++md->trId, md->tokens[0], token );
    760760        }
    761761        else
     
    886886        return 1;
    887887}
     888
     889int msn_ns_sendmessage( struct im_connection *ic, bee_user_t *bu, const char *text )
     890{
     891        struct msn_data *md = ic->proto_data;
     892        char *buf;
     893       
     894        if( strncmp( text, "\r\r\r", 3 ) == 0 )
     895                /* Err. Shouldn't happen but I guess it can. Don't send others
     896                   any of the "SHAKE THAT THING" messages. :-D */
     897                return 1;
     898       
     899        buf = g_strdup_printf( "%s%s", MSN_MESSAGE_HEADERS, text );
     900       
     901        if( msn_ns_write( ic, -1, "UUM %d %s %d %d %zd\r\n%s",
     902                                  ++md->trId, bu->handle,
     903                                  1, /* type == MSN offline message */
     904                                  1, /* type == IM (not nudge/typing) */
     905                                  strlen( buf ), buf ) )
     906                return 1;
     907        else
     908                return 0;
     909}
     910
     911void msn_ns_oim_send_queue( struct im_connection *ic, GSList **msgq )
     912{
     913        GSList *l;
     914       
     915        for( l = *msgq; l; l = l->next )
     916        {
     917                struct msn_message *m = l->data;
     918                bee_user_t *bu = bee_user_by_handle( ic->bee, ic, m->who );
     919               
     920                if( bu )
     921                        if( !msn_ns_sendmessage( ic, bu, m->text ) )
     922                                return;
     923        }
     924       
     925        while( *msgq != NULL )
     926        {
     927                struct msn_message *m = (*msgq)->data;
     928               
     929                g_free( m->who );
     930                g_free( m->text );
     931                g_free( m );
     932               
     933                *msgq = g_slist_remove( *msgq, m );
     934        }
     935}
  • protocols/msn/sb.c

    rddca104 rbc676ac  
    629629                /* If the person is offline, send an offline message instead,
    630630                   and don't report an error. */
    631                 /* TODO: Support for OIMs that works. (#874) */
    632                 /*
    633631                if( num == 217 )
    634                         msn_soap_oim_send_queue( ic, &sb->msgq );
     632                        msn_ns_oim_send_queue( ic, &sb->msgq );
    635633                else
    636                 */
    637634                        imcb_error( ic, "Error reported by switchboard server: %s", err->text );
    638635               
Note: See TracChangeset for help on using the changeset viewer.