# HG changeset patch # User Nathan Walp # Date 1127693288 0 # Node ID e36f0f9debb52dc67e41c3ec63c1b1e9206d9669 # Parent 603a0e626332a6eebb0741c52a0d30eee48c4c43 [gaim-migrate @ 13835] real live jabber presence support (at least in the prpl) committer: Tailor Script diff -r 603a0e626332 -r e36f0f9debb5 src/protocols/jabber/jabber.c --- a/src/protocols/jabber/jabber.c Sun Sep 25 16:45:29 2005 +0000 +++ b/src/protocols/jabber/jabber.c Mon Sep 26 00:08:08 2005 +0000 @@ -999,39 +999,50 @@ { GaimStatusType *type; GList *types = NULL; + GaimValue *priority_value; type = gaim_status_type_new_with_attrs(GAIM_STATUS_OFFLINE, "offline", _("Offline"), FALSE, TRUE, FALSE, "message", _("Message"), gaim_value_new(GAIM_TYPE_STRING), NULL); types = g_list_append(types, type); + priority_value = gaim_value_new(GAIM_TYPE_INT); + gaim_value_set_int(priority_value, 0); type = gaim_status_type_new_with_attrs(GAIM_STATUS_AVAILABLE, "available", _("Available"), TRUE, TRUE, FALSE, "priority", _("Priority"), - gaim_value_new(GAIM_TYPE_INT), "message", _("Message"), + priority_value, "message", _("Message"), gaim_value_new(GAIM_TYPE_STRING), NULL); types = g_list_append(types, type); + priority_value = gaim_value_new(GAIM_TYPE_INT); + gaim_value_set_int(priority_value, 0); type = gaim_status_type_new_with_attrs(GAIM_STATUS_AVAILABLE, "chat", _("Chatty"), TRUE, TRUE, FALSE, "priority", _("Priority"), - gaim_value_new(GAIM_TYPE_INT), "message", _("Message"), + priority_value, "message", _("Message"), gaim_value_new(GAIM_TYPE_STRING), NULL); types = g_list_append(types, type); + priority_value = gaim_value_new(GAIM_TYPE_INT); + gaim_value_set_int(priority_value, 5); type = gaim_status_type_new_with_attrs(GAIM_STATUS_AWAY, "away", _("Away"), TRUE, TRUE, FALSE, "priority", _("Priority"), - gaim_value_new(GAIM_TYPE_INT), "message", _("Message"), + priority_value, "message", _("Message"), gaim_value_new(GAIM_TYPE_STRING), NULL); types = g_list_append(types, type); + priority_value = gaim_value_new(GAIM_TYPE_INT); + gaim_value_set_int(priority_value, 10); type = gaim_status_type_new_with_attrs(GAIM_STATUS_EXTENDED_AWAY, "xa", _("Extended Away"), TRUE, TRUE, FALSE, "priority", _("Priority"), - gaim_value_new(GAIM_TYPE_INT), "message", _("Message"), + priority_value, "message", _("Message"), gaim_value_new(GAIM_TYPE_STRING), NULL); types = g_list_append(types, type); + priority_value = gaim_value_new(GAIM_TYPE_INT); + gaim_value_set_int(priority_value, 20); type = gaim_status_type_new_with_attrs(GAIM_STATUS_UNAVAILABLE, "dnd", _("Do Not Disturb"), TRUE, TRUE, FALSE, "priority", _("Priority"), - gaim_value_new(GAIM_TYPE_INT), "message", _("Message"), + priority_value, "message", _("Message"), gaim_value_new(GAIM_TYPE_STRING), NULL); types = g_list_append(types, type); diff -r 603a0e626332 -r e36f0f9debb5 src/protocols/jabber/presence.c --- a/src/protocols/jabber/presence.c Sun Sep 25 16:45:29 2005 +0000 +++ b/src/protocols/jabber/presence.c Mon Sep 26 00:08:08 2005 +0000 @@ -144,7 +144,7 @@ xmlnode *jabber_presence_create(JabberBuddyState state, const char *msg, int priority) { - xmlnode *show, *status, *presence; + xmlnode *show, *status, *presence, *pri; const char *show_string = NULL; @@ -168,6 +168,13 @@ xmlnode_insert_data(status, msg, -1); } + if(priority) { + char *pstr = g_strdup_printf("%d", priority); + pri = xmlnode_new_child(presence, "priority"); + xmlnode_insert_data(pri, pstr, -1); + g_free(pstr); + } + return presence; }