summary refs log tree commit diff
path: root/webclient/room
diff options
context:
space:
mode:
authorDavid Baker <dbkr@matrix.org>2014-08-29 14:00:20 +0100
committerDavid Baker <dbkr@matrix.org>2014-08-29 14:00:20 +0100
commit4b7f6dd7fcd274d362a28182754f9b077b9c8232 (patch)
treee2b53a87b20da60932a67581c471075721dd4cab /webclient/room
parentOops, forgot a s/sendObject/sendEvent/ - make messages work again! (diff)
downloadsynapse-4b7f6dd7fcd274d362a28182754f9b077b9c8232.tar.xz
Only show voice call button if there are exactly 2 members in the room. Also hide the somewhat user unfriendly call state.
Diffstat (limited to 'webclient/room')
-rw-r--r--webclient/room/room-controller.js6
-rw-r--r--webclient/room/room.html4
2 files changed, 7 insertions, 3 deletions
diff --git a/webclient/room/room-controller.js b/webclient/room/room-controller.js
index 6232ce8ed3..09dac85d26 100644
--- a/webclient/room/room-controller.js
+++ b/webclient/room/room-controller.js
@@ -51,7 +51,7 @@ angular.module('RoomController', ['ngSanitize', 'mFileInput'])
             objDiv.scrollTop = objDiv.scrollHeight;
         }, 0);
     };
-    
+
     $scope.$on(eventHandlerService.MSG_EVENT, function(ngEvent, event, isLive) {
         if (isLive && event.room_id === $scope.room_id) {
             scrollToBottom();
@@ -88,6 +88,10 @@ angular.module('RoomController', ['ngSanitize', 'mFileInput'])
         call.onHangup = $scope.onCallHangup;
         $scope.currentCall = call;
     });
+
+    $scope.memberCount = function() {
+        return Object.keys($scope.members).length;
+    };
     
     $scope.paginateMore = function() {
         if ($scope.state.can_paginate) {
diff --git a/webclient/room/room.html b/webclient/room/room.html
index 572c52e64e..a3514c3a91 100644
--- a/webclient/room/room.html
+++ b/webclient/room/room.html
@@ -98,14 +98,14 @@
                         <button ng-click="inviteUser(userIDToInvite)">Invite</button>
                 </span>
                 <button ng-click="leaveRoom()">Leave</button>
-                <button ng-click="startVoiceCall()" ng-show="currentCall == undefined">Voice Call</button>
+                <button ng-click="startVoiceCall()" ng-show="currentCall == undefined && memberCount() == 2">Voice Call</button>
                 <div ng-show="currentCall.state == 'ringing'">
                 Incoming call from {{ currentCall.user_id }}
                 <button ng-click="answerCall()">Answer</button>
                 <button ng-click="hangupCall()">Reject</button>
                 </div>
                 <button ng-click="hangupCall()" ng-show="currentCall && currentCall.state != 'ringing'">Hang up</button>
-                {{ currentCall.state }}
+                <span style="display: none; ">{{ currentCall.state }}</span>
             </div>
         
             {{ feedback }}