Ignore:
Timestamp:
2010-08-14T11:30:40Z (10 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
d93c0eb9
Parents:
73efe3a
Message:

Status/Away messages.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/msn/msn.c

    r73efe3a r12767e3  
    3939        set_add( &acc->set, "mail_notifications", "false", set_eval_bool, acc );
    4040        set_add( &acc->set, "switchboard_keepalives", "false", set_eval_bool, acc );
     41       
     42        acc->flags |= ACC_FLAG_AWAY_MESSAGE | ACC_FLAG_STATUS_MESSAGE;
    4143}
    4244
     
    182184{
    183185        char buf[1024];
     186        char *uux;
    184187        struct msn_data *md = ic->proto_data;
    185188       
     
    190193       
    191194        g_snprintf( buf, sizeof( buf ), "CHG %d %s\r\n", ++md->trId, md->away_state->code );
    192         msn_write( ic, buf, strlen( buf ) );
     195        if( !msn_write( ic, buf, strlen( buf ) ) )
     196                return;
     197       
     198        uux = g_markup_printf_escaped( "<Data><PSM>%s</PSM><CurrentMedia></CurrentMedia>"
     199                                       "</Data>", message ? message : "" );
     200        g_snprintf( buf, sizeof( buf ), "UUX %d %zd\r\n%s", ++md->trId, strlen( uux ), uux );
     201        if( !msn_write( ic, buf, strlen( buf ) ) )
     202                return;
    193203}
    194204
Note: See TracChangeset for help on using the changeset viewer.