libpurple/protocols/jabber/message.c

changeset 27747
4b4809acfb81
parent 27623
b88136cb00b6
parent 27746
4b3f015977d9
child 27748
2f3e6478093b
--- a/libpurple/protocols/jabber/message.c	Mon Jul 06 04:38:08 2009 +0000
+++ b/libpurple/protocols/jabber/message.c	Sun Jul 12 04:41:56 2009 +0000
@@ -1171,9 +1171,15 @@
 		xhtml = tmp;
 	}
 
-	if ((!jbr || jbr->capabilities & JABBER_CAP_XHTML) &&
-			!jabber_xhtml_plain_equal(xhtml, jm->body))
-		jm->xhtml = g_strdup_printf("<html xmlns='http://jabber.org/protocol/xhtml-im'><body xmlns='http://www.w3.org/1999/xhtml'>%s</body></html>", xhtml);
+	/*
+	 * For backward compatibility with user expectations or for those not on
+	 * the user's roster, allow sending XHTML-IM markup.
+	 */
+	if (!jbr || !jbr->caps.info ||
+			jabber_resource_has_capability(jbr, "http://jabber.org/protocol/xhtml-im")) {
+		if (!jabber_xhtml_plain_equal(xhtml, jm->body))
+			jm->xhtml = g_strdup_printf("<html xmlns='http://jabber.org/protocol/xhtml-im'><body xmlns='http://www.w3.org/1999/xhtml'>%s</body></html>", xhtml);
+	}
 
 	g_free(xhtml);
 

mercurial