Package: irssi-plugin-xmpp / 0.53-1~bpo8+1

singpolyma-0001-Set-presence-in-one-place.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
From 2d68051afcdddcc02a1a5e46c58cee388086418f Mon Sep 17 00:00:00 2001
From: Stephen Paul Weber <singpolyma@singpolyma.net>
Date: Wed, 20 Apr 2011 23:58:34 -0500
Subject: [PATCH 01/18] Set presence in one place

Had two bits of code to set presence, one on initial connect, and one when changing.  No reason to do that, snip out the code duplication.
---
 src/core/xmpp-servers.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

--- a/src/core/xmpp-servers.c
+++ b/src/core/xmpp-servers.c
@@ -508,22 +508,14 @@
 static void
 sig_connected(XMPP_SERVER_REC *server)
 {
-	LmMessage *lmsg;
-	char *str;
-
 	if (!IS_XMPP_SERVER(server) || (server->connrec->reconnection
 	    && xmpp_presence_changed(server->connrec->show, server->show,
 	    server->connrec->away_reason, server->away_reason,
 	    server->connrec->priority, server->priority)))
 		return;
+
 	/* set presence available */
-	lmsg = lm_message_new_with_sub_type(NULL, LM_MESSAGE_TYPE_PRESENCE,
-	    LM_MESSAGE_SUB_TYPE_AVAILABLE);
-	str = g_strdup_printf("%d", server->priority);
-	lm_message_node_add_child(lmsg->node, "priority", str);
-	g_free(str);
-	signal_emit("xmpp send presence", 2, server, lmsg);
-	lm_message_unref(lmsg);
+	signal_emit("xmpp set presence", 4, server, XMPP_PRESENCE_AVAILABLE, "", server->priority);
 }
 
 static void