From 50f9d34211d74cbcb5b693c4866b9e2866e6b855 Mon Sep 17 00:00:00 2001
From: Kegan Dougal <kegan@matrix.org>
Date: Thu, 16 Jul 2015 11:30:34 +0100
Subject: [PATCH] Only display video elements in video calls.

---
 src/CallHandler.js                         | 4 +++-
 src/controllers/molecules/voip/CallView.js | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/CallHandler.js b/src/CallHandler.js
index 029b89174a..5285be1825 100644
--- a/src/CallHandler.js
+++ b/src/CallHandler.js
@@ -102,7 +102,9 @@ function _setCallListeners(call) {
 }
 
 function _setCallState(call, roomId, status) {
-    console.log("_setState >>> %s >>> %s >> %s", call, roomId, status);
+    console.log(
+        "Call state in %s changed to %s (%s)", roomId, status, (call ? call.state : "-")
+    );
     calls[roomId] = call;
     if (call) {
         call.call_state = status;
diff --git a/src/controllers/molecules/voip/CallView.js b/src/controllers/molecules/voip/CallView.js
index 16cd398d33..485782e943 100644
--- a/src/controllers/molecules/voip/CallView.js
+++ b/src/controllers/molecules/voip/CallView.js
@@ -49,7 +49,7 @@ module.exports = {
             return;
         }
         var call = CallHandler.getCall(payload.room_id);
-        if (call) {
+        if (call && call.type === "video") {
             this.getVideoView().getLocalVideoElement().style.display = "initial";
             this.getVideoView().getRemoteVideoElement().style.display = "initial";
             call.setLocalVideoElement(this.getVideoView().getLocalVideoElement());