/soc/2015/koosha/main: 8b425175a5ca: count incoming stanzas only...

Koosha Khajehmoogahi <[email protected]>
Newsgroups gmane.comp.gnome.gaim.cvs
Message-ID <[email protected]>
Changeset: 8b425175a5ca3d0eff0686d3340fde88f06271ac
Author:	 Koosha Khajehmoogahi <[email protected]>
Date:	 2015-08-10 19:23 +0200
Branch:	 default
URL: https://hg.pidgin.im/soc/2015/koosha/main/rev/8b425175a5ca

Description:

count incoming stanzas only if server has SM feature

diffstat:

 libpurple/protocols/jabber/jabber.c |  18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)

diffs (28 lines):

diff --git a/libpurple/protocols/jabber/jabber.c b/libpurple/protocols/jabber/jabber.c
--- a/libpurple/protocols/jabber/jabber.c
+++ b/libpurple/protocols/jabber/jabber.c
@@ -398,14 +398,16 @@ void jabber_process_packet(JabberStream 
 
 	/* Count received stanzas to include when acking
 	 * via <a/> (stream management) to the server */
-	if (purple_strequal(name, "iq") ||
-	    purple_strequal(name, "presence") ||
-	    purple_strequal(name, "message"))
-	{
-		if (G_UNLIKELY(G_MAXUINT32 == js->stanzas_recvd))
-			js->stanzas_recvd = 0;
-		else
-			js->stanzas_recvd++;
+	if (js->server_caps & JABBER_CAP_SM) {
+		if (purple_strequal(name, "iq") ||
+		    purple_strequal(name, "presence") ||
+		    purple_strequal(name, "message"))
+		{
+			if (G_UNLIKELY(G_MAXUINT32 == js->stanzas_recvd))
+				js->stanzas_recvd = 0;
+			else
+				js->stanzas_recvd++;
+		}
 	}
 
 	if (purple_strequal(name, "iq")) {

_______________________________________________
Commits mailing list
[email protected]
https://pidgin.im/cgi-bin/mailman/listinfo/commits
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.