Package: gaim
Version: 1:1.1.1-1
Severity: wishlist
This is a patch, originally for 0.77, but I've been using it for
a long time, works fine.
For some reason the jabber priority isn't available in gaim, this
patch fixes that.
Original link:
http://bat.sabazios.org/vrac/patch-gaim0.77cvs-jabberpriority.diff
--- src/protocols/jabber/jabber.c.org 2004-12-02 00:32:31.000000000 +0100
+++ src/protocols/jabber/jabber.c 2005-01-11 07:48:17.000000000 +0100
@@ -370,6 +370,7 @@
js->chat_servers = g_list_append(NULL,
g_strdup("conference.jabber.org"));
js->user = jabber_id_new(gaim_account_get_username(account));
js->next_id = g_random_int();
+ js->priority = gaim_account_get_int(account, "priority", 0);
if(!js->user) {
gaim_connection_error(gc, _("Invalid Jabber ID"));
@@ -1609,6 +1610,10 @@
prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,
option);
+ option = gaim_account_option_int_new(_("Priority"), "priority", 0);
+ prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,
+ option);
+
option = gaim_account_option_int_new(_("Port"), "port", 5222);
prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,
option);
--- src/protocols/jabber/jabber.h.org 2004-03-06 00:42:34.000000000 +0100
+++ src/protocols/jabber/jabber.h 2005-01-11 07:48:50.000000000 +0100
@@ -84,6 +84,7 @@
GHashTable *disco_callbacks;
int next_id;
+ int priority;
GList *oob_file_transfers;
GList *file_transfers;
--- src/protocols/jabber/presence.c.org 2004-11-29 14:27:36.000000000 +0100
+++ src/protocols/jabber/presence.c 2005-01-11 07:50:36.000000000 +0100
@@ -96,8 +96,9 @@
const char *msg)
{
JabberStream *js = gc->proto_data;
- xmlnode *presence;
+ xmlnode *presence, *priority;
char *stripped = NULL;
+ char *priority_str = NULL;
if(msg) {
gaim_markup_html_to_xhtml(msg, NULL, &stripped);
@@ -111,8 +112,14 @@
gc->away = stripped;
presence = jabber_presence_create(state, stripped);
+
+ priority = xmlnode_new_child(presence, "priority");
+ priority_str = g_strdup_printf("%d", js->priority);
+ xmlnode_insert_data(priority, priority_str , -1);
+
jabber_send(js, presence);
g_hash_table_foreach(js->chats, chats_send_presence_foreach, presence);
+ g_free(priority_str);
xmlnode_free(presence);
jabber_presence_fake_to_self(js, state, stripped);