diff libpurple/media/backend-fs2.c @ 31075:a202f4dcbb96

Stop sending audio when placing a call on hold. Fixes #13032. committer: John Bailey <rekkanoryo@rekkanoryo.org>
author jakub.adam@ktknet.cz
date Tue, 28 Dec 2010 11:03:37 +0000
parents 356a8d472395
children a8cc50c2279f
line wrap: on
line diff
--- a/libpurple/media/backend-fs2.c	Tue Dec 28 10:49:46 2010 +0000
+++ b/libpurple/media/backend-fs2.c	Tue Dec 28 11:03:37 2010 +0000
@@ -1129,6 +1129,21 @@
 				g_object_set(volume, "mute", active, NULL);
 			}
 		}
+	} else if (local == TRUE && (type == PURPLE_MEDIA_INFO_HOLD ||
+			type == PURPLE_MEDIA_INFO_UNHOLD)) {
+		gboolean active = (type == PURPLE_MEDIA_INFO_HOLD);
+		GList *streams = get_streams(self, sid, name);
+		for (; streams; streams =
+				g_list_delete_link(streams, streams)) {
+			PurpleMediaBackendFs2Stream *stream = streams->data;
+			if (stream->session->type & PURPLE_MEDIA_SEND_AUDIO) {
+				g_object_set(stream->stream, "direction",
+						session_type_to_fs_stream_direction(
+						stream->session->type & ((active) ?
+						~PURPLE_MEDIA_SEND_AUDIO :
+						PURPLE_MEDIA_AUDIO)), NULL);
+			}
+		}
 	} else if (local == TRUE && (type == PURPLE_MEDIA_INFO_PAUSE ||
 			type == PURPLE_MEDIA_INFO_UNPAUSE)) {
 		gboolean active = (type == PURPLE_MEDIA_INFO_PAUSE);