/soc/2013/ashmew2/filetransferX: 455ad2901abc: Enabling share-v1...
Ashish Gupta
ashmew2 at gmail.com
Thu Jul 11 01:40:28 EDT 2013
Changeset: 455ad2901abce1110250454b5641ac34e4c7a9f3
Author: Ashish Gupta <ashmew2 at gmail.com>
Date: 2013-07-11 11:10 +0530
Branch: filetransferX
URL: https://hg.pidgin.im/soc/2013/ashmew2/filetransferX/rev/455ad2901abc
Description:
Enabling share-v1 ext
diffstat:
.hgignore | 4 ----
libpurple/protocols/jabber/disco.c | 8 +++++++-
libpurple/protocols/jabber/jabber.c | 10 ++++++++--
libpurple/protocols/jabber/presence.c | 11 +++++++----
4 files changed, 22 insertions(+), 11 deletions(-)
diffs (120 lines):
diff --git a/.hgignore b/.hgignore
--- a/.hgignore
+++ b/.hgignore
@@ -42,7 +42,6 @@ config.status
config.sub
configure$
depcomp
-doc/*
doc/finch.1$
doc/html
doc/pidgin.1$
@@ -114,7 +113,4 @@ po/stamp-it
stamp-h1
win32-install-dir(\.release)?
\#.*\#
-.*\.patch
-.*.json
-.*.yml
test-driver
diff --git a/libpurple/protocols/jabber/disco.c b/libpurple/protocols/jabber/disco.c
--- a/libpurple/protocols/jabber/disco.c
+++ b/libpurple/protocols/jabber/disco.c
@@ -142,6 +142,10 @@ void jabber_disco_info_parse(JabberStrea
xmlnode_set_attrib(feature, "var", feat->namespace);
}
}
+ } else if (g_str_equal(node, CAPS0115_NODE "#" "share-v1")) {
+
+ xmlnode *feature = xmlnode_new_child(query, "feature");
+ xmlnode_set_attrib(feature, "var", "http://google.com/xmpp/protocol/share/v1");
#ifdef USE_VV
} else if (g_str_equal(node, CAPS0115_NODE "#" "voice-v1")) {
/*
@@ -180,7 +184,9 @@ void jabber_disco_info_parse(JabberStrea
xmlnode *feature = xmlnode_new_child(query, "feature");
xmlnode_set_attrib(feature, "var", NS_GOOGLE_CAMERA);
#endif
- } else {
+ }
+
+ else {
xmlnode *error, *inf;
/* XXX: gross hack, implement jabber_iq_set_type or something */
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
@@ -1975,6 +1975,8 @@ void jabber_rem_deny(PurpleConnection *g
void jabber_add_feature(const char *namespace, JabberFeatureEnabled cb) {
JabberFeature *feat;
+ purple_debug_info("jabber", "Inside jabber-add-feature");
+
g_return_if_fail(namespace != NULL);
feat = g_new0(JabberFeature,1);
@@ -3858,7 +3860,7 @@ jabber_do_init(void)
jabber_add_feature(NS_SI_FILE_TRANSFER, 0);
jabber_add_feature(NS_XHTML_IM, 0);
jabber_add_feature(NS_PING, 0);
-
+
/* Buzz/Attention */
jabber_add_feature(NS_ATTENTION, jabber_buzz_isenabled);
@@ -3867,7 +3869,10 @@ jabber_do_init(void)
/* Jingle features! */
jabber_add_feature(JINGLE, 0);
-
+ jabber_add_feature(JINGLE_APP_FT, 0);
+ jabber_add_feature(JINGLE_TRANSPORT_S5B, 0);
+ jabber_add_feature(JINGLE_TRANSPORT_IBB, 0);
+ jabber_add_feature("http://google.com/xmpp/protocol/share/v1",0);
#ifdef USE_VV
jabber_add_feature(NS_GOOGLE_PROTOCOL_SESSION, jabber_audio_enabled);
jabber_add_feature(NS_GOOGLE_VOICE, jabber_audio_enabled);
@@ -3875,6 +3880,7 @@ jabber_do_init(void)
jabber_add_feature(NS_GOOGLE_CAMERA, jabber_video_enabled);
jabber_add_feature(JINGLE_APP_RTP, 0);
jabber_add_feature(JINGLE_APP_RTP_SUPPORT_AUDIO, jabber_audio_enabled);
+
jabber_add_feature(JINGLE_APP_RTP_SUPPORT_VIDEO, jabber_video_enabled);
jabber_add_feature(JINGLE_TRANSPORT_RAWUDP, 0);
jabber_add_feature(JINGLE_TRANSPORT_ICEUDP, 0);
diff --git a/libpurple/protocols/jabber/presence.c b/libpurple/protocols/jabber/presence.c
--- a/libpurple/protocols/jabber/presence.c
+++ b/libpurple/protocols/jabber/presence.c
@@ -357,7 +357,8 @@ xmlnode *jabber_presence_create_js(Jabbe
xmlnode_set_attrib(c, "node", CAPS0115_NODE);
xmlnode_set_attrib(c, "hash", "sha-1");
xmlnode_set_attrib(c, "ver", jabber_caps_get_own_hash(js));
-
+ xmlnode_set_attrib(c, "ext", "share-v1");
+
#ifdef USE_VV
/*
* MASSIVE HUGE DISGUSTING HACK
@@ -368,16 +369,18 @@ xmlnode *jabber_presence_create_js(Jabbe
* calls.
*
* Ditto for 'video-v1'.
+ *
+ * Ditto for 'share-v1' for supporting file transfers.
*/
audio_enabled = jabber_audio_enabled(js, NULL /* unused */);
video_enabled = jabber_video_enabled(js, NULL /* unused */);
if (audio_enabled && video_enabled)
- xmlnode_set_attrib(c, "ext", "voice-v1 camera-v1 video-v1");
+ xmlnode_set_attrib(c, "ext", "voice-v1 camera-v1 video-v1 share-v1");
else if (audio_enabled)
- xmlnode_set_attrib(c, "ext", "voice-v1");
+ xmlnode_set_attrib(c, "ext", "voice-v1 share-v1");
else if (video_enabled)
- xmlnode_set_attrib(c, "ext", "camera-v1 video-v1");
+ xmlnode_set_attrib(c, "ext", "camera-v1 video-v1 share-v1");
#endif
return presence;
More information about the Commits
mailing list