Mercurial > pidgin
comparison libpurple/protocols/jabber/jabber.c @ 26453:ecf6fd808d23
Advertise video/voice features only when the UI says it has those caps
author | Paul Aurich <paul@darkrain42.org> |
---|---|
date | Sat, 04 Apr 2009 05:50:34 +0000 |
parents | e7bbcc1e2778 |
children | 9131368ba4be |
comparison
equal
deleted
inserted
replaced
26452:5172ebcc8673 | 26453:ecf6fd808d23 |
---|---|
2728 { | 2728 { |
2729 return TRUE; | 2729 return TRUE; |
2730 } | 2730 } |
2731 | 2731 |
2732 #ifdef USE_VV | 2732 #ifdef USE_VV |
2733 static gboolean | |
2734 feature_audio_enabled(JabberStream *js, const char *namespace) | |
2735 { | |
2736 PurpleMediaManager *manager = purple_media_manager_get(); | |
2737 PurpleMediaCaps caps = purple_media_manager_get_ui_caps(manager); | |
2738 | |
2739 return (caps & (PURPLE_MEDIA_CAPS_AUDIO | PURPLE_MEDIA_CAPS_AUDIO_SINGLE_DIRECTION)); | |
2740 } | |
2741 | |
2742 static gboolean | |
2743 feature_video_enabled(JabberStream *js, const char *namespace) | |
2744 { | |
2745 PurpleMediaManager *manager = purple_media_manager_get(); | |
2746 PurpleMediaCaps caps = purple_media_manager_get_ui_caps(manager); | |
2747 | |
2748 return (caps & (PURPLE_MEDIA_CAPS_VIDEO | PURPLE_MEDIA_CAPS_VIDEO_SINGLE_DIRECTION)); | |
2749 } | |
2750 | |
2733 typedef struct { | 2751 typedef struct { |
2734 PurpleConnection *pc; | 2752 PurpleConnection *pc; |
2735 gchar *who; | 2753 gchar *who; |
2736 PurpleMediaSessionType type; | 2754 PurpleMediaSessionType type; |
2737 | 2755 |
3159 jabber_add_feature("http://jabber.org/protocol/si/profile/file-transfer", 0); | 3177 jabber_add_feature("http://jabber.org/protocol/si/profile/file-transfer", 0); |
3160 jabber_add_feature("http://jabber.org/protocol/xhtml-im", 0); | 3178 jabber_add_feature("http://jabber.org/protocol/xhtml-im", 0); |
3161 jabber_add_feature("urn:xmpp:ping", 0); | 3179 jabber_add_feature("urn:xmpp:ping", 0); |
3162 | 3180 |
3163 /* Jingle features! */ | 3181 /* Jingle features! */ |
3164 jabber_add_feature("http://www.google.com/xmpp/protocol/session", 0); | |
3165 jabber_add_feature("http://www.google.com/xmpp/protocol/voice/v1", 0); | |
3166 jabber_add_feature(JINGLE, 0); | 3182 jabber_add_feature(JINGLE, 0); |
3167 jabber_add_feature(JINGLE_APP_RTP_SUPPORT_AUDIO, 0); | |
3168 jabber_add_feature(JINGLE_APP_RTP_SUPPORT_VIDEO, 0); | |
3169 jabber_add_feature(JINGLE_TRANSPORT_RAWUDP, 0); | 3183 jabber_add_feature(JINGLE_TRANSPORT_RAWUDP, 0); |
3170 jabber_add_feature(JINGLE_TRANSPORT_ICEUDP, 0); | 3184 jabber_add_feature(JINGLE_TRANSPORT_ICEUDP, 0); |
3185 #ifdef USE_VV | |
3186 jabber_add_feature("http://www.google.com/xmpp/protocol/session", feature_audio_enabled); | |
3187 jabber_add_feature("http://www.google.com/xmpp/protocol/voice/v1", feature_audio_enabled); | |
3188 jabber_add_feature(JINGLE_APP_RTP_SUPPORT_AUDIO, feature_audio_enabled); | |
3189 jabber_add_feature(JINGLE_APP_RTP_SUPPORT_VIDEO, feature_video_enabled); | |
3190 #endif | |
3171 | 3191 |
3172 /* IPC functions */ | 3192 /* IPC functions */ |
3173 purple_plugin_ipc_register(plugin, "contact_has_feature", PURPLE_CALLBACK(jabber_ipc_contact_has_feature), | 3193 purple_plugin_ipc_register(plugin, "contact_has_feature", PURPLE_CALLBACK(jabber_ipc_contact_has_feature), |
3174 purple_marshal_BOOLEAN__POINTER_POINTER_POINTER, | 3194 purple_marshal_BOOLEAN__POINTER_POINTER_POINTER, |
3175 purple_value_new(PURPLE_TYPE_BOOLEAN), 3, | 3195 purple_value_new(PURPLE_TYPE_BOOLEAN), 3, |