pidgin.vv: 1656e035: Add initiator property to PurpleMedia.
maiku at soc.pidgin.im
maiku at soc.pidgin.im
Sun Jan 4 02:50:38 EST 2009
-----------------------------------------------------------------
Revision: 1656e035e23020316898b4fff6f70cb86c30b636
Ancestor: 969acb6b5fc9c8760509d2d08961a6fff52d08d6
Author: maiku at soc.pidgin.im
Date: 2009-01-04T05:19:54
Branch: im.pidgin.pidgin.vv
URL: http://d.pidgin.im/viewmtn/revision/info/1656e035e23020316898b4fff6f70cb86c30b636
Modified files:
libpurple/media.c libpurple/mediamanager.c
libpurple/mediamanager.h libpurple/protocols/jabber/google.c
libpurple/protocols/jabber/jingle/rtp.c
ChangeLog:
Add initiator property to PurpleMedia.
-------------- next part --------------
============================================================
--- libpurple/media.c 2595ced65e4af270169ccaae4654893660706535
+++ libpurple/media.c 71953e574bacd85f04d4aa6bdd73f469d620658d
@@ -73,6 +73,7 @@ struct _PurpleMediaPrivate
struct _PurpleMediaPrivate
{
FsConference *conference;
+ gboolean initiator;
GHashTable *sessions; /* PurpleMediaSession table */
GHashTable *participants; /* FsParticipant table */
@@ -124,6 +125,7 @@ enum {
enum {
PROP_0,
PROP_CONFERENCE,
+ PROP_INITIATOR,
};
GType
@@ -166,6 +168,13 @@ purple_media_class_init (PurpleMediaClas
FS_TYPE_CONFERENCE,
G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE));
+ g_object_class_install_property(gobject_class, PROP_INITIATOR,
+ g_param_spec_boolean("initiator",
+ "initiator",
+ "If the local user initiated the conference.",
+ FALSE,
+ G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE));
+
purple_media_signals[ERROR] = g_signal_new("error", G_TYPE_FROM_CLASS(klass),
G_SIGNAL_RUN_LAST, 0, NULL, NULL,
g_cclosure_marshal_VOID__STRING,
@@ -311,6 +320,9 @@ purple_media_set_property (GObject *obje
media->priv->conference = g_value_get_object(value);
g_object_ref(media->priv->conference);
break;
+ case PROP_INITIATOR:
+ media->priv->initiator = g_value_get_boolean(value);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -329,6 +341,9 @@ purple_media_get_property (GObject *obje
case PROP_CONFERENCE:
g_value_set_object(value, media->priv->conference);
break;
+ case PROP_INITIATOR:
+ g_value_set_boolean(value, media->priv->initiator);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
============================================================
--- libpurple/mediamanager.c 152adc89af79a4b21ef1ebbb41e0337f23e6ec65
+++ libpurple/mediamanager.c f1dc415edc2f32c733bbd11bf48002c970b479f9
@@ -140,7 +140,8 @@ purple_media_manager_create_media(Purple
purple_media_manager_create_media(PurpleMediaManager *manager,
PurpleConnection *gc,
const char *conference_type,
- const char *remote_user)
+ const char *remote_user,
+ gboolean initiator)
{
PurpleMedia *media;
FsConference *conference = FS_CONFERENCE(gst_element_factory_make(conference_type, NULL));
@@ -157,6 +158,7 @@ purple_media_manager_create_media(Purple
media = PURPLE_MEDIA(g_object_new(purple_media_get_type(),
"conference", conference,
+ "initiator", initiator,
NULL));
ret = gst_element_set_state(purple_media_get_pipeline(media), GST_STATE_PLAYING);
============================================================
--- libpurple/mediamanager.h d9f2864b11a4039f0cd102fb25337171a1573ea2
+++ libpurple/mediamanager.h 79db52a5ef9ae634c19c83a60ad368271fe4a72f
@@ -102,7 +102,8 @@ PurpleMedia *purple_media_manager_create
PurpleMedia *purple_media_manager_create_media(PurpleMediaManager *manager,
PurpleConnection *gc,
const char *conference_type,
- const char *remote_user);
+ const char *remote_user,
+ gboolean initiator);
/**
* Gets all of the media sessions.
============================================================
--- libpurple/protocols/jabber/google.c 8009b843222ef42054b47c51b021355b100eabb9
+++ libpurple/protocols/jabber/google.c ae15ea8ab72a3e9b9e8f3d063f32a90584f04f87
@@ -217,7 +217,7 @@ google_session_handle_initiate(JabberStr
}
session->media = purple_media_manager_create_media(purple_media_manager_get(), js->gc,
- "fsrtpconference", session->remote_jid);
+ "fsrtpconference", session->remote_jid, FALSE);
/* GTalk requires the NICE_COMPATIBILITY_GOOGLE param */
param.name = "compatibility-mode";
============================================================
--- libpurple/protocols/jabber/jingle/rtp.c ee8cb8290fd90351b04140e1dc5969bb9250f845
+++ libpurple/protocols/jabber/jingle/rtp.c c5871acf96f382477d7882690d5c7a00b0912789
@@ -372,7 +372,8 @@ jingle_rtp_create_media(JingleContent *c
gchar *sid = jingle_session_get_sid(session);
PurpleMedia *media = purple_media_manager_create_media(purple_media_manager_get(),
- js->gc, "fsrtpconference", remote_jid);
+ js->gc, "fsrtpconference", remote_jid,
+ jingle_session_is_initiator(session));
g_free(remote_jid);
if (!media) {
More information about the Commits
mailing list