Stop sending audio when placing a call on hold. Fixes #13032.

Tue, 28 Dec 2010 11:03:37 +0000

author
Jakub Adam <jakub.adam@ktknet.cz>
date
Tue, 28 Dec 2010 11:03:37 +0000
changeset 31278
3314c614763c
parent 31277
6d9302a0f369
child 31279
c0104df45b93

Stop sending audio when placing a call on hold. Fixes #13032.


committer: John Bailey <rekkanoryo@rekkanoryo.org>

ChangeLog file | annotate | diff | comparison | revisions
libpurple/media/backend-fs2.c file | annotate | diff | comparison | revisions
--- a/ChangeLog	Tue Dec 28 10:49:46 2010 +0000
+++ b/ChangeLog	Tue Dec 28 11:03:37 2010 +0000
@@ -1,6 +1,9 @@
 Pidgin and Finch: The Pimpin' Penguin IM Clients That're Good for the Soul
 
 version 2.7.10 (??/??/????):
+	libpurple:
+	* Stop sending audio when placing a call on hold (Jakub Adam) (#13032)
+
 	Pidgin:
 	* Support using the Page Up and Page Down keys on the numeric keypad in
 	  the conversation window.  (Ryan Flegel) (#13127)
--- 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);

mercurial