Changeset bc676ac for protocols/msn/ns.c


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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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}
Note: See TracChangeset for help on using the changeset viewer.