diff --git a/skins/base/views/molecules/RoomHeader.js b/skins/base/views/molecules/RoomHeader.js
index 1708bd1c39..62f2448456 100644
--- a/skins/base/views/molecules/RoomHeader.js
+++ b/skins/base/views/molecules/RoomHeader.js
@@ -33,18 +33,6 @@ module.exports = React.createClass({
var callButtons;
if (this.state) {
switch (this.state.call_state) {
- case "ringing":
- callButtons = (
-
- );
- break;
case "ringback":
case "connected":
callButtons = (
diff --git a/skins/base/views/molecules/voip/IncomingCallBox.js b/skins/base/views/molecules/voip/IncomingCallBox.js
new file mode 100644
index 0000000000..95263fb6c2
--- /dev/null
+++ b/skins/base/views/molecules/voip/IncomingCallBox.js
@@ -0,0 +1,56 @@
+/*
+Copyright 2015 OpenMarket Ltd
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+'use strict';
+
+var React = require('react');
+var classNames = require('classnames');
+var IncomingCallBoxController = require(
+ "../../../../../src/controllers/molecules/voip/IncomingCallBox"
+);
+
+module.exports = React.createClass({
+ displayName: 'IncomingCallBox',
+ mixins: [IncomingCallBoxController],
+
+ render: function() {
+ if (!this.state.incomingCallRoomId) {
+ return (
+
+ );
+ }
+ return (
+
+
+
+
+
+ General Incoming Call
+
+
+
+ Decline
+
+
+ Accept
+
+
+
+ );
+ }
+});
diff --git a/skins/base/views/organisms/LeftPanel.js b/skins/base/views/organisms/LeftPanel.js
index 8a9770da6c..f8df727d73 100644
--- a/skins/base/views/organisms/LeftPanel.js
+++ b/skins/base/views/organisms/LeftPanel.js
@@ -21,6 +21,7 @@ var ComponentBroker = require('../../../../src/ComponentBroker');
var RoomList = ComponentBroker.get('organisms/RoomList');
var DirectoryMenu = ComponentBroker.get('molecules/DirectoryMenu');
+var IncomingCallBox = ComponentBroker.get('molecules/voip/IncomingCallBox');
var RoomCreate = ComponentBroker.get('molecules/RoomCreate');
module.exports = React.createClass({
@@ -30,6 +31,7 @@ module.exports = React.createClass({
return (
+
diff --git a/src/ComponentBroker.js b/src/ComponentBroker.js
index 59f8804643..d2275ef861 100644
--- a/src/ComponentBroker.js
+++ b/src/ComponentBroker.js
@@ -101,6 +101,7 @@ require('../skins/base/views/molecules/DirectoryMenu');
require('../skins/base/views/atoms/voip/VideoFeed');
require('../skins/base/views/molecules/voip/VideoView');
require('../skins/base/views/molecules/voip/CallView');
+require('../skins/base/views/molecules/voip/IncomingCallBox');
require('../skins/base/views/molecules/voip/MCallInviteTile');
require('../skins/base/views/molecules/voip/MCallAnswerTile');
require('../skins/base/views/molecules/voip/MCallHangupTile');
diff --git a/src/controllers/molecules/RoomHeader.js b/src/controllers/molecules/RoomHeader.js
index 24f0d47abe..5bd51e44d3 100644
--- a/src/controllers/molecules/RoomHeader.js
+++ b/src/controllers/molecules/RoomHeader.js
@@ -76,12 +76,6 @@ module.exports = {
action: 'hangup',
room_id: this.props.room.roomId
});
- },
- onAnswerClick: function() {
- dis.dispatch({
- action: 'answer',
- room_id: this.props.room.roomId
- });
}
};
diff --git a/src/controllers/molecules/voip/IncomingCallBox.js b/src/controllers/molecules/voip/IncomingCallBox.js
new file mode 100644
index 0000000000..dc993936bc
--- /dev/null
+++ b/src/controllers/molecules/voip/IncomingCallBox.js
@@ -0,0 +1,66 @@
+/*
+Copyright 2015 OpenMarket Ltd
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+'use strict';
+
+var dis = require("../../../dispatcher");
+var CallHandler = require("../../../CallHandler");
+
+module.exports = {
+ componentDidMount: function() {
+ this.dispatcherRef = dis.register(this.onAction);
+ },
+
+ componentWillUnmount: function() {
+ dis.unregister(this.dispatcherRef);
+ },
+
+ getInitialState: function() {
+ return {
+ incomingCallRoomId: null
+ }
+ },
+
+ onAction: function(payload) {
+ if (payload.action !== 'call_state') {
+ return;
+ }
+ var call = CallHandler.getCall(payload.room_id);
+ if (!call || call.call_state !== 'ringing') {
+ this.setState({
+ incomingCallRoomId: null
+ });
+ return;
+ }
+ this.setState({
+ incomingCallRoomId: call.roomId
+ });
+ },
+
+ onAnswerClick: function() {
+ dis.dispatch({
+ action: 'answer',
+ room_id: this.state.incomingCallRoomId
+ });
+ },
+ onRejectClick: function() {
+ dis.dispatch({
+ action: 'hangup',
+ room_id: this.state.incomingCallRoomId
+ });
+ }
+};
+