From 00bcc849a5a5b0988c3fe15208375751f56791ab Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 11 Apr 2017 10:40:02 +0200 Subject: [PATCH] Update the URL when creating a room Signed-off-by: Joas Schilling --- js/rooms.js | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/js/rooms.js b/js/rooms.js index 87a63a431..45d3c156e 100644 --- a/js/rooms.js +++ b/js/rooms.js @@ -22,39 +22,36 @@ showCamera: function() { $('.videoView').removeClass('hidden'); }, + _createRoomSuccessHandle: function(data) { + OC.Util.History.pushState({ + token: data.token + }, OC.generateUrl('/call/' + data.token)); + this.join(data.token); + }, createOneToOneVideoCall: function(recipientUserId) { - var self = this; console.log(recipientUserId); $.ajax({ url: OC.generateUrl('/apps/spreed/api/oneToOne'), type: 'PUT', data: 'targetUserName='+recipientUserId, - success: function(data) { - self.join(data.token); - } + success: _.bind(this._createRoomSuccessHandle, this) }); }, createGroupVideoCall: function(groupId) { - var self = this; console.log(groupId); $.ajax({ url: OC.generateUrl('/apps/spreed/api/group'), type: 'PUT', data: 'targetGroupName='+groupId, - success: function(data) { - self.join(data.token); - } + success: _.bind(this._createRoomSuccessHandle, this) }); }, createPublicVideoCall: function() { - var self = this; console.log("Creating a new public room."); $.ajax({ url: OC.generateUrl('/apps/spreed/api/public'), type: 'PUT', - success: function(data) { - self.join(data.token); - } + success: _.bind(this._createRoomSuccessHandle, this) }); }, join: function(token) {