[Telepathy-commits] [telepathy-gabble/master] make locally created streams bidirectional by default
Senko Rasic
senko.rasic at collabora.co.uk
Tue Feb 17 04:04:45 PST 2009
---
src/jingle-content.c | 12 ++++++++++++
src/media-channel.c | 11 ++++++++++-
2 files changed, 22 insertions(+), 1 deletions(-)
diff --git a/src/jingle-content.c b/src/jingle-content.c
index fa46c8c..70b3f6e 100644
--- a/src/jingle-content.c
+++ b/src/jingle-content.c
@@ -58,6 +58,7 @@ enum
PROP_SENDERS,
PROP_STATE,
PROP_DISPOSITION,
+ PROP_LOCALLY_CREATED,
LAST_PROPERTY
};
@@ -186,6 +187,9 @@ gabble_jingle_content_get_property (GObject *object,
case PROP_DISPOSITION:
g_value_set_string (value, priv->disposition);
break;
+ case PROP_LOCALLY_CREATED:
+ g_value_set_boolean (value, priv->created_by_us);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
@@ -340,6 +344,14 @@ gabble_jingle_content_class_init (GabbleJingleContentClass *cls)
G_PARAM_STATIC_BLURB);
g_object_class_install_property (object_class, PROP_DISPOSITION, param_spec);
+ param_spec = g_param_spec_boolean ("locally-created", "Locally created",
+ "True if the content was created by the "
+ "local client.",
+ FALSE,
+ G_PARAM_READABLE |
+ G_PARAM_STATIC_NAME |
+ G_PARAM_STATIC_BLURB);
+ g_object_class_install_property (object_class, PROP_LOCALLY_CREATED, param_spec);
/* signal definitions */
diff --git a/src/media-channel.c b/src/media-channel.c
index 176e6c4..581e74e 100644
--- a/src/media-channel.c
+++ b/src/media-channel.c
@@ -2320,8 +2320,10 @@ create_stream_from_content (GabbleMediaChannel *chan, GabbleJingleContent *c)
gchar *name;
guint id;
gchar *object_path;
+ gboolean locally_created;
- g_object_get (c, "name", &name, "media-type", &type, NULL);
+ g_object_get (c, "name", &name, "media-type", &type,
+ "locally-created", &locally_created, NULL);
if (G_OBJECT_TYPE (c) != GABBLE_TYPE_JINGLE_MEDIA_RTP)
{
@@ -2347,6 +2349,13 @@ create_stream_from_content (GabbleMediaChannel *chan, GabbleJingleContent *c)
"media-type", mtype,
NULL);
+ if (locally_created)
+ {
+ g_object_set (stream, "combined-direction",
+ MAKE_COMBINED_DIRECTION (TP_MEDIA_STREAM_DIRECTION_BIDIRECTIONAL,
+ 0), NULL);
+ }
+
DEBUG ("%p: created new MediaStream %p for content '%s'", chan, stream, name);
/* we will own the only reference to this stream */
--
1.5.6.5
More information about the telepathy-commits
mailing list