aboutsummaryrefslogtreecommitdiffstats
path: root/protocols
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2010-08-14 12:30:40 +0100
committerWilmer van der Gaast <wilmer@gaast.net>2010-08-14 12:30:40 +0100
commit12767e39dbafc36d54995727ff2c6043e8292f16 (patch)
treec7431dc064b1e98cc636d9c50f2991fc10660344 /protocols
parent73efe3a6ea04ca19f3a4088990eda60ad852a94f (diff)
Status/Away messages.
Diffstat (limited to 'protocols')
-rw-r--r--protocols/msn/msn.c12
-rw-r--r--protocols/msn/soap.c6
2 files changed, 14 insertions, 4 deletions
diff --git a/protocols/msn/msn.c b/protocols/msn/msn.c
index 7b881c67..99db509c 100644
--- a/protocols/msn/msn.c
+++ b/protocols/msn/msn.c
@@ -38,6 +38,8 @@ static void msn_init( account_t *acc )
set_add( &acc->set, "local_display_name", "false", set_eval_bool, acc );
set_add( &acc->set, "mail_notifications", "false", set_eval_bool, acc );
set_add( &acc->set, "switchboard_keepalives", "false", set_eval_bool, acc );
+
+ acc->flags |= ACC_FLAG_AWAY_MESSAGE | ACC_FLAG_STATUS_MESSAGE;
}
static void msn_login( account_t *acc )
@@ -181,6 +183,7 @@ static GList *msn_away_states( struct im_connection *ic )
static void msn_set_away( struct im_connection *ic, char *state, char *message )
{
char buf[1024];
+ char *uux;
struct msn_data *md = ic->proto_data;
if( state == NULL )
@@ -189,7 +192,14 @@ static void msn_set_away( struct im_connection *ic, char *state, char *message )
md->away_state = msn_away_state_list + 1;
g_snprintf( buf, sizeof( buf ), "CHG %d %s\r\n", ++md->trId, md->away_state->code );
- msn_write( ic, buf, strlen( buf ) );
+ if( !msn_write( ic, buf, strlen( buf ) ) )
+ return;
+
+ uux = g_markup_printf_escaped( "<Data><PSM>%s</PSM><CurrentMedia></CurrentMedia>"
+ "</Data>", message ? message : "" );
+ g_snprintf( buf, sizeof( buf ), "UUX %d %zd\r\n%s", ++md->trId, strlen( uux ), uux );
+ if( !msn_write( ic, buf, strlen( buf ) ) )
+ return;
}
static void msn_set_my_name( struct im_connection *ic, char *info )
diff --git a/protocols/msn/soap.c b/protocols/msn/soap.c
index c23d190a..5eae3089 100644
--- a/protocols/msn/soap.c
+++ b/protocols/msn/soap.c
@@ -50,6 +50,9 @@ typedef enum
MSN_SOAP_ABORT,
} msn_soap_result_t;
+struct msn_soap_req_data;
+typedef int (*msn_soap_func) ( struct msn_soap_req_data * );
+
struct msn_soap_req_data
{
void *data;
@@ -63,8 +66,6 @@ struct msn_soap_req_data
msn_soap_func build_request, handle_response, free_data;
};
-typedef int (*msn_soap_func) ( struct msn_soap_req_data * );
-
static int msn_soap_send_request( struct msn_soap_req_data *req );
static int msn_soap_start( struct im_connection *ic,
@@ -526,7 +527,6 @@ static xt_status msn_soap_addressbook_group( struct xt_node *node, gpointer data
struct xt_node *p;
char *id = NULL, *name = NULL;
struct msn_soap_req_data *soap_req = data;
- struct im_connection *ic = soap_req->ic;
if( ( p = node->parent ) &&
( p = xt_find_node( p->children, "groupId" ) ) )