Ignore:
Timestamp:
2012-09-29T19:38:18Z (12 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
4c9d377
Parents:
3901b5d
Message:

Support for sending messages to federated contacts. They don't seem to arrive
but Pidgin seems to have the same problem.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/msn/msn.c

    r3901b5d r208db4b  
    140140static int msn_buddy_msg( struct im_connection *ic, char *who, char *message, int away )
    141141{
     142        struct bee_user *bu = bee_user_by_handle( ic->bee, ic, who );
     143        struct msn_buddy_data *bd = bu ? bu->data : NULL;
    142144        struct msn_switchboard *sb;
    143145       
     
    149151        else
    150152#endif
    151         if( ( sb = msn_sb_by_handle( ic, who ) ) )
     153        if( bd && bd->flags & MSN_BUDDY_FED )
     154        {
     155                msn_ns_sendmessage( ic, bu, message );
     156        }
     157        else if( ( sb = msn_sb_by_handle( ic, who ) ) )
    152158        {
    153159                return( msn_sb_sendmessage( sb, message ) );
     
    355361{
    356362        struct msn_data *md = bu->ic->proto_data;
    357         bu->data = g_new0( struct msn_buddy_data, 1 );
     363        struct msn_buddy_data *bd;
     364        char *handle;
     365       
     366        bd = bu->data = g_new0( struct msn_buddy_data, 1 );
    358367        g_tree_insert( md->domaintree, bu->handle, bu );
     368       
     369        for( handle = bu->handle; isdigit( *handle ); handle ++ );
     370        if( *handle == ':' )
     371        {
     372                /* Pass a nick hint so hopefully the stupid numeric prefix
     373                   won't show up to the user.  */
     374                char *s = strchr( ++handle, '@' );
     375                if( s )
     376                {
     377                        handle = g_strndup( handle, s - handle );
     378                        imcb_buddy_nick_hint( bu->ic, bu->handle, handle );
     379                        g_free( handle );
     380                }
     381               
     382                bd->flags |= MSN_BUDDY_FED;
     383        }
    359384}
    360385
Note: See TracChangeset for help on using the changeset viewer.