pidgin: cec487e5: For contacts who advertise Entity Caps, ...
darkrain42 at pidgin.im
darkrain42 at pidgin.im
Sun Jul 12 01:58:27 EDT 2009
-----------------------------------------------------------------
Revision: cec487e50b3df746ae8b23771513bf85734f618d
Ancestor: 078748563cc7be3194dc98c4f09ca4172800e1d8
Author: darkrain42 at pidgin.im
Date: 2009-07-12T04:39:31
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/cec487e50b3df746ae8b23771513bf85734f618d
Modified files:
ChangeLog libpurple/protocols/jabber/buddy.c
libpurple/protocols/jabber/jabber.h
libpurple/protocols/jabber/message.c
ChangeLog:
For contacts who advertise Entity Caps, check for XHTML-IM support. Refs #4650.
For backward-compatibility (and what I, as someone who knows that
Jabber supports rich-text, would expect), continue sending it if the
contact is offline (i.e. not on the roster).
-------------- next part --------------
============================================================
--- ChangeLog 5890d8fae38029c2b0640b0688743ca26b9924ee
+++ ChangeLog b552a4c2388d1ff089f9a3a25add8e4f33d419a0
@@ -96,6 +96,8 @@ version 2.6.0 (??/??/2009):
kicked.
* Fix issues with case-sensitivity of XMPP roster and case-insensitive
Purple groups.
+ * For contacts who advertise Entity Capabilities, only send rich text
+ markup if they support it.
Yahoo!/Yahoo! JAPAN:
* P2P file transfers. (Sulabh Mahajan)
============================================================
--- libpurple/protocols/jabber/buddy.c 5c90a6cff25b3e7685dca8401c59d1d21e1691b2
+++ libpurple/protocols/jabber/buddy.c 5928f523e0288fb525fdbcf8f8514ffe643d75ff
@@ -161,7 +161,7 @@ JabberBuddyResource *jabber_buddy_track_
jbr = g_new0(JabberBuddyResource, 1);
jbr->jb = jb;
jbr->name = g_strdup(resource);
- jbr->capabilities = JABBER_CAP_XHTML;
+ jbr->capabilities = JABBER_CAP_NONE;
jbr->tz_off = PURPLE_NO_TZ_OFF;
jb->resources = g_list_append(jb->resources, jbr);
}
@@ -2244,12 +2244,6 @@ jabber_resource_has_capability(const Jab
}
}
- /* TODO: Are these messages actually useful? */
- if (node)
- purple_debug_info("jabber", "Found cap: %s\n", cap);
- else
- purple_debug_info("jabber", "Cap %s not found\n", cap);
-
return (node != NULL);
}
============================================================
--- libpurple/protocols/jabber/jabber.h 2ada4af3c96f91e0a03432690d93832c4b083d3a
+++ libpurple/protocols/jabber/jabber.h dfa369781cfaf2ddd2b50361e747ea562e60580e
@@ -24,7 +24,7 @@ typedef enum {
typedef enum {
JABBER_CAP_NONE = 0,
- JABBER_CAP_XHTML = 1 << 0,
+/* JABBER_CAP_XHTML = 1 << 0, */
JABBER_CAP_COMPOSING = 1 << 1,
JABBER_CAP_SI = 1 << 2,
JABBER_CAP_SI_FILE_XFER = 1 << 3,
============================================================
--- libpurple/protocols/jabber/message.c 3dad8a124eef4953da0be9f671d8f1dd464ead29
+++ libpurple/protocols/jabber/message.c 6655dc93ebce2376d427eb051077bad23d5c5abd
@@ -1199,9 +1199,15 @@ int jabber_message_send_im(PurpleConnect
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);
More information about the Commits
mailing list