cpw.darkrain42.xmpp.bosh: 594f6978: Advertise video/voice features only when..

paul at darkrain42.org paul at darkrain42.org
Sat Apr 4 01:55:29 EDT 2009


-----------------------------------------------------------------
Revision: 594f6978ee0c7e63362aacb42ad4468135eef80c
Ancestor: 5dc57aeace93ed1e1a09fdc459155844dfc7597e
Author: paul at darkrain42.org
Date: 2009-04-04T05:50:34
Branch: im.pidgin.cpw.darkrain42.xmpp.bosh
URL: http://d.pidgin.im/viewmtn/revision/info/594f6978ee0c7e63362aacb42ad4468135eef80c

Modified files:
        libpurple/protocols/jabber/jabber.c

ChangeLog: 

Advertise video/voice features only when the UI says it has those caps

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/jabber.c	9dd11e3fda2db0f0a322507d430089320aaf400b
+++ libpurple/protocols/jabber/jabber.c	4f96c10e8c4fb4cbb55198e8d06b1a01260939b5
@@ -2730,6 +2730,24 @@ gboolean jabber_offline_message(const Pu
 }
 
 #ifdef USE_VV
+static gboolean
+feature_audio_enabled(JabberStream *js, const char *namespace)
+{
+	PurpleMediaManager *manager = purple_media_manager_get();
+	PurpleMediaCaps caps = purple_media_manager_get_ui_caps(manager);
+
+	return (caps & (PURPLE_MEDIA_CAPS_AUDIO | PURPLE_MEDIA_CAPS_AUDIO_SINGLE_DIRECTION));
+}
+
+static gboolean
+feature_video_enabled(JabberStream *js, const char *namespace)
+{
+	PurpleMediaManager *manager = purple_media_manager_get();
+	PurpleMediaCaps caps = purple_media_manager_get_ui_caps(manager);
+
+	return (caps & (PURPLE_MEDIA_CAPS_VIDEO | PURPLE_MEDIA_CAPS_VIDEO_SINGLE_DIRECTION));
+}
+
 typedef struct {
 	PurpleConnection *pc;
 	gchar *who;
@@ -3161,13 +3179,15 @@ jabber_init_plugin(PurplePlugin *plugin)
 	jabber_add_feature("urn:xmpp:ping", 0);
 
 	/* Jingle features! */
-	jabber_add_feature("http://www.google.com/xmpp/protocol/session", 0);
-	jabber_add_feature("http://www.google.com/xmpp/protocol/voice/v1", 0);
 	jabber_add_feature(JINGLE, 0);
-	jabber_add_feature(JINGLE_APP_RTP_SUPPORT_AUDIO, 0);
-	jabber_add_feature(JINGLE_APP_RTP_SUPPORT_VIDEO, 0);
 	jabber_add_feature(JINGLE_TRANSPORT_RAWUDP, 0);
 	jabber_add_feature(JINGLE_TRANSPORT_ICEUDP, 0);
+#ifdef USE_VV
+	jabber_add_feature("http://www.google.com/xmpp/protocol/session", feature_audio_enabled);
+	jabber_add_feature("http://www.google.com/xmpp/protocol/voice/v1", feature_audio_enabled);
+	jabber_add_feature(JINGLE_APP_RTP_SUPPORT_AUDIO, feature_audio_enabled);
+	jabber_add_feature(JINGLE_APP_RTP_SUPPORT_VIDEO, feature_video_enabled);
+#endif
 
 	/* IPC functions */
 	purple_plugin_ipc_register(plugin, "contact_has_feature", PURPLE_CALLBACK(jabber_ipc_contact_has_feature),


More information about the Commits mailing list