summaryrefslogtreecommitdiff
path: root/libpurple/media
diff options
context:
space:
mode:
authorMichael Ruprecht <maiku@pidgin.im>2009-10-27 18:34:46 +0000
committerMichael Ruprecht <maiku@pidgin.im>2009-10-27 18:34:46 +0000
commit3d84e94263b728a4962c2fd318023271e70af68b (patch)
tree5d3ca378b514577a6f8dad80ac43fb148447e5eb /libpurple/media
parent07717c0b6b22047a8a0aacf569c2310ae96c60ec (diff)
downloadpidgin-3d84e94263b728a4962c2fd318023271e70af68b.tar.gz
Move odd direction changing functionality to the Fs2 media backend.
Diffstat (limited to 'libpurple/media')
-rw-r--r--libpurple/media/backend-fs2.c16
-rw-r--r--libpurple/media/media.c11
2 files changed, 15 insertions, 12 deletions
diff --git a/libpurple/media/backend-fs2.c b/libpurple/media/backend-fs2.c
index 09112ff289..739d7074d7 100644
--- a/libpurple/media/backend-fs2.c
+++ b/libpurple/media/backend-fs2.c
@@ -1416,6 +1416,7 @@ purple_media_backend_fs2_add_stream(PurpleMediaBackend *self,
PurpleMediaBackendFs2 *backend = PURPLE_MEDIA_BACKEND_FS2(self);
PurpleMediaBackendFs2Private *priv =
PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(backend);
+ PurpleMediaBackendFs2Stream *stream;
if (priv->conference == NULL && !_init_conference(backend)) {
purple_debug_error("backend-fs2",
@@ -1438,8 +1439,19 @@ purple_media_backend_fs2_add_stream(PurpleMediaBackend *self,
return FALSE;
}
- if (_get_stream(backend, sess_id, who) == NULL &&
- !_create_stream(backend, sess_id, who, type,
+ stream = _get_stream(backend, sess_id, who);
+
+ if (stream != NULL) {
+ FsStreamDirection type_direction =
+ _session_type_to_fs_stream_direction(type);
+
+ if (_session_type_to_fs_stream_direction(
+ stream->session->type) != type_direction) {
+ /* change direction */
+ g_object_set(stream->stream, "direction",
+ type_direction, NULL);
+ }
+ } else if (!_create_stream(backend, sess_id, who, type,
initiator, transmitter, num_params, params)) {
purple_debug_error("backend-fs2",
"Error creating the stream.\n");
diff --git a/libpurple/media/media.c b/libpurple/media/media.c
index 2d11c3ffdc..3fe528cd69 100644
--- a/libpurple/media/media.c
+++ b/libpurple/media/media.c
@@ -1230,9 +1230,7 @@ purple_media_add_stream(PurpleMedia *media, const gchar *sess_id,
participant = purple_media_backend_fs2_get_participant(
PURPLE_MEDIA_BACKEND_FS2(media->priv->backend), who);
- stream = purple_media_get_stream(media, sess_id, who);
-
- if (!stream) {
+ if (purple_media_get_stream(media, sess_id, who) == NULL) {
FsStream *fsstream = NULL;
fsstream = purple_media_backend_fs2_get_stream(
@@ -1249,13 +1247,6 @@ purple_media_add_stream(PurpleMedia *media, const gchar *sess_id,
g_signal_emit(media, purple_media_signals[STATE_CHANGED],
0, PURPLE_MEDIA_STATE_NEW,
session->id, who);
- } else {
- if (purple_media_to_fs_stream_direction(stream->session->type)
- != type_direction) {
- /* change direction */
- g_object_set(stream->stream, "direction",
- type_direction, NULL);
- }
}
return TRUE;