From c3f9d8e41bf2d23f676a10ec4579434a94b1fc39 Mon Sep 17 00:00:00 2001 From: Emmanuel ROHEE Date: Mon, 8 Sep 2014 10:28:07 +0200 Subject: BF: Made notification work again (forgot to renamed "offline" to "unavailable") --- webclient/room/room-controller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'webclient/room') diff --git a/webclient/room/room-controller.js b/webclient/room/room-controller.js index c738b490e2..1c496d7213 100644 --- a/webclient/room/room-controller.js +++ b/webclient/room/room-controller.js @@ -63,7 +63,7 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput']) if (window.Notification) { // Show notification when the user is idle - if (matrixService.presence.offline === mPresence.getState()) { + if (matrixService.presence.unavailable === mPresence.getState()) { var notification = new window.Notification( ($scope.members[event.user_id].displayname || event.user_id) + " (" + ($scope.room_alias || $scope.room_id) + ")", // FIXME: don't leak room_ids here -- cgit 1.4.1 From 24f0bb4af5c2863c13c015f4a091ff0c84960a67 Mon Sep 17 00:00:00 2001 From: Emmanuel ROHEE Date: Mon, 8 Sep 2014 11:09:14 +0200 Subject: Revert "BF: Made notification work again (forgot to renamed "offline" to "unavailable")" This reverts commit c3f9d8e41bf2d23f676a10ec4579434a94b1fc39. --- webclient/room/room-controller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'webclient/room') diff --git a/webclient/room/room-controller.js b/webclient/room/room-controller.js index 1c496d7213..c738b490e2 100644 --- a/webclient/room/room-controller.js +++ b/webclient/room/room-controller.js @@ -63,7 +63,7 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput']) if (window.Notification) { // Show notification when the user is idle - if (matrixService.presence.unavailable === mPresence.getState()) { + if (matrixService.presence.offline === mPresence.getState()) { var notification = new window.Notification( ($scope.members[event.user_id].displayname || event.user_id) + " (" + ($scope.room_alias || $scope.room_id) + ")", // FIXME: don't leak room_ids here -- cgit 1.4.1 From ef0304beff82ad985033405e7230a327a91fc796 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Sat, 6 Sep 2014 10:13:38 -0700 Subject: disable broken event dup suppression, and fix echo for /me --- .../components/matrix/event-handler-service.js | 11 ++++++-- webclient/room/room-controller.js | 30 ++++++++++++---------- 2 files changed, 25 insertions(+), 16 deletions(-) (limited to 'webclient/room') diff --git a/webclient/components/matrix/event-handler-service.js b/webclient/components/matrix/event-handler-service.js index cd4f2ccf28..d2bb31053f 100644 --- a/webclient/components/matrix/event-handler-service.js +++ b/webclient/components/matrix/event-handler-service.js @@ -79,7 +79,8 @@ angular.module('eventHandlerService', []) initRoom(event.room_id); if (isLiveEvent) { - if (event.user_id === matrixService.config().user_id) { + if (event.user_id === matrixService.config().user_id && + (event.content.msgtype === "m.text" || event.content.msgtype === "m.emote") ) { // assume we've already echoed it // FIXME: track events by ID and ungrey the right message to show it's been delivered } @@ -162,11 +163,17 @@ angular.module('eventHandlerService', []) NAME_EVENT: NAME_EVENT, handleEvent: function(event, isLiveEvent) { + // FIXME: event duplication suppression is all broken as the code currently expect to handles + // events multiple times to get their side-effects... +/* if (eventMap[event.event_id]) { console.log("discarding duplicate event: " + JSON.stringify(event)); return; } - + else { + eventMap[event.event_id] = 1; + } +*/ if (event.type.indexOf('m.call.') === 0) { handleCallEvent(event, isLiveEvent); } diff --git a/webclient/room/room-controller.js b/webclient/room/room-controller.js index c738b490e2..e69adb9b46 100644 --- a/webclient/room/room-controller.js +++ b/webclient/room/room-controller.js @@ -302,7 +302,9 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput']) scrollToBottom(true); var promise; - var isCmd = false; + var cmd; + var args; + var echo = false; // Check for IRC style commands first var line = $scope.textInput; @@ -311,17 +313,16 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput']) line = line.replace(/\s+$/, ""); if (line[0] === "/" && line[1] !== "/") { - isCmd = true; - var bits = line.match(/^(\S+?)( +(.*))?$/); - var cmd = bits[1]; - var args = bits[3]; + cmd = bits[1]; + args = bits[3]; console.log("cmd: " + cmd + ", args: " + args); switch (cmd) { case "/me": promise = matrixService.sendEmoteMessage($scope.room_id, args); + echo = true; break; case "/nick": @@ -453,17 +454,20 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput']) } // By default send this as a message unless it's an IRC-style command - if (!promise && !isCmd) { - var message = $scope.textInput; - $scope.textInput = ""; - + if (!promise && !cmd) { + // Make the request + promise = matrixService.sendTextMessage($scope.room_id, line); + echo = true; + } + + if (echo) { // Echo the message to the room // To do so, create a minimalist fake text message event and add it to the in-memory list of room messages var echoMessage = { content: { - body: message, + body: (cmd === "/me" ? args : line), hsob_ts: new Date().getTime(), // fake a timestamp - msgtype: "m.text" + msgtype: (cmd === "/me" ? "m.emote" : "m.text"), }, room_id: $scope.room_id, type: "m.room.message", @@ -472,11 +476,9 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput']) // echo_msg_state: "messagePending" // Add custom field to indicate the state of this fake message to HTML }; + $scope.textInput = ""; $rootScope.events.rooms[$scope.room_id].messages.push(echoMessage); scrollToBottom(); - - // Make the request - promise = matrixService.sendTextMessage($scope.room_id, message); } if (promise) { -- cgit 1.4.1 From dc1f202eca5e58eae243f5a1214d1acda5cbccd5 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Sat, 6 Sep 2014 10:26:30 -0700 Subject: fix desktop notifs, which were broken in eab463fd --- webclient/components/matrix/presence-service.js | 2 +- webclient/room/room-controller.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'webclient/room') diff --git a/webclient/components/matrix/presence-service.js b/webclient/components/matrix/presence-service.js index 952c8ec8a9..b487e3d3bd 100644 --- a/webclient/components/matrix/presence-service.js +++ b/webclient/components/matrix/presence-service.js @@ -24,7 +24,7 @@ angular.module('mPresence', []) .service('mPresence', ['$timeout', 'matrixService', function ($timeout, matrixService) { // Time in ms after that a user is considered as unavailable/away - var UNAVAILABLE_TIME = 5 * 60000; // 5 mins + var UNAVAILABLE_TIME = 3 * 60000; // 3 mins // The current presence state var state = undefined; diff --git a/webclient/room/room-controller.js b/webclient/room/room-controller.js index e69adb9b46..c702917fef 100644 --- a/webclient/room/room-controller.js +++ b/webclient/room/room-controller.js @@ -62,8 +62,8 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput']) scrollToBottom(); if (window.Notification) { - // Show notification when the user is idle - if (matrixService.presence.offline === mPresence.getState()) { + // Show notification when the window is hidden, or the user is idle + if (document.hidden || matrixService.presence.unavailable === mPresence.getState()) { var notification = new window.Notification( ($scope.members[event.user_id].displayname || event.user_id) + " (" + ($scope.room_alias || $scope.room_id) + ")", // FIXME: don't leak room_ids here -- cgit 1.4.1 From a0a609e8afad550be86bf47828315d727214026f Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Sat, 6 Sep 2014 17:48:16 -0700 Subject: fix embarassing bug where in-progress messages get vaped when the previous one gets delivered --- webclient/room/room-controller.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'webclient/room') diff --git a/webclient/room/room-controller.js b/webclient/room/room-controller.js index c702917fef..c8ca771b25 100644 --- a/webclient/room/room-controller.js +++ b/webclient/room/room-controller.js @@ -485,7 +485,9 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput']) promise.then( function() { console.log("Request successfully sent"); - $scope.textInput = ""; + if (!echo) { + $scope.textInput = ""; + } /* if (echoMessage) { // Remove the fake echo message from the room messages -- cgit 1.4.1 From 324020d5fe212badfbd38137adc8dcecfdc15980 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Mon, 8 Sep 2014 15:36:52 -0700 Subject: Display the room topic in the room, underneath the name of the room. --- webclient/app.css | 21 +++++++++++++++------ .../components/matrix/event-handler-service.js | 11 +++++++++++ webclient/room/room.html | 9 +++++++-- 3 files changed, 33 insertions(+), 8 deletions(-) (limited to 'webclient/room') diff --git a/webclient/app.css b/webclient/app.css index 19fae632ff..7c367df421 100755 --- a/webclient/app.css +++ b/webclient/app.css @@ -220,12 +220,6 @@ a:active { color: #000; } height: 100%; } -#roomName { - float: right; - font-size: 16px; - margin-top: 15px; -} - #roomHeader { margin: auto; padding-left: 20px; @@ -282,6 +276,21 @@ a:active { color: #000; } float: right; } +#roomName { + font-size: 16px; + text-align: right; +} + +#roomTopic { + text-align: right; + font-size: 13px; +} + +.roomHeaderInfo { + float: right; + margin-top: 15px; +} + /*** Participant list ***/ #usersTableWrapper { diff --git a/webclient/components/matrix/event-handler-service.js b/webclient/components/matrix/event-handler-service.js index 173055a61b..a14e515999 100644 --- a/webclient/components/matrix/event-handler-service.js +++ b/webclient/components/matrix/event-handler-service.js @@ -148,6 +148,14 @@ angular.module('eventHandlerService', []) $rootScope.events.rooms[event.room_id][event.type] = event; $rootScope.$broadcast(NAME_EVENT, event, isLiveEvent); }; + + var handleRoomTopic = function(event, isLiveEvent) { + console.log("handleRoomTopic " + isLiveEvent); + + initRoom(event.room_id); + + $rootScope.events.rooms[event.room_id][event.type] = event; + }; var handleCallEvent = function(event, isLiveEvent) { $rootScope.$broadcast(CALL_EVENT, event, isLiveEvent); @@ -204,6 +212,9 @@ angular.module('eventHandlerService', []) case 'm.room.name': handleRoomName(event, isLiveEvent); break; + case 'm.room.topic': + handleRoomTopic(event, isLiveEvent); + break; default: console.log("Unable to handle event type " + event.type); console.log(JSON.stringify(event, undefined, 4)); diff --git a/webclient/room/room.html b/webclient/room/room.html index 5bd2cc92d5..4be2482f96 100644 --- a/webclient/room/room.html +++ b/webclient/room/room.html @@ -2,8 +2,13 @@
[matrix] -
- {{ room_id | mRoomName }} +
+
+ {{ room_id | mRoomName }} +
+
+ {{ events.rooms[room_id]['m.room.topic'].content.topic }} +
-- cgit 1.4.1 From 6bdb23449a7b4f5ca0426ec6c942332b245eec30 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Mon, 8 Sep 2014 18:40:34 -0700 Subject: Add ability to set topic by double-clicking on the topic text then hitting enter. --- webclient/app.css | 5 +++++ .../components/matrix/event-handler-service.js | 1 + webclient/components/matrix/matrix-service.js | 19 ++++++++++++++++ webclient/room/room-controller.js | 25 ++++++++++++++++++++++ webclient/room/room.html | 10 ++++++++- 5 files changed, 59 insertions(+), 1 deletion(-) (limited to 'webclient/room') diff --git a/webclient/app.css b/webclient/app.css index 2f969641b4..9667f3fd22 100755 --- a/webclient/app.css +++ b/webclient/app.css @@ -297,9 +297,14 @@ a:active { color: #000; } font-size: 13px; } +.roomTopicInput { + width: 100%; +} + .roomHeaderInfo { float: right; margin-top: 15px; + width: 50%; } /*** Participant list ***/ diff --git a/webclient/components/matrix/event-handler-service.js b/webclient/components/matrix/event-handler-service.js index 8232e3b4b0..5a3e92186e 100644 --- a/webclient/components/matrix/event-handler-service.js +++ b/webclient/components/matrix/event-handler-service.js @@ -149,6 +149,7 @@ angular.module('eventHandlerService', []) $rootScope.$broadcast(NAME_EVENT, event, isLiveEvent); }; + // TODO: Can this just be a generic "I am a room state event, can haz store?" var handleRoomTopic = function(event, isLiveEvent) { console.log("handleRoomTopic live="+isLiveEvent); diff --git a/webclient/components/matrix/matrix-service.js b/webclient/components/matrix/matrix-service.js index 6864726ba4..62aff091d4 100644 --- a/webclient/components/matrix/matrix-service.js +++ b/webclient/components/matrix/matrix-service.js @@ -235,6 +235,25 @@ angular.module('matrixService', []) return doRequest("GET", path, undefined, {}); }, + + setTopic: function(room_id, topic) { + var data = { + topic: topic + }; + return this.sendStateEvent(room_id, "m.room.topic", data); + }, + + + sendStateEvent: function(room_id, eventType, content, state_key) { + var path = "/rooms/$room_id/state/"+eventType; + if (state_key !== undefined) { + path += "/" + state_key; + } + room_id = encodeURIComponent(room_id); + path = path.replace("$room_id", room_id); + + return doRequest("PUT", path, undefined, content); + }, sendEvent: function(room_id, eventType, txn_id, content) { // The REST path spec diff --git a/webclient/room/room-controller.js b/webclient/room/room-controller.js index c8ca771b25..10ff12a96b 100644 --- a/webclient/room/room-controller.js +++ b/webclient/room/room-controller.js @@ -42,6 +42,31 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput']) $scope.imageURLToSend = ""; $scope.userIDToInvite = ""; + // vars and functions for updating the topic + $scope.topic = { + isEditing: false, + newTopicText: "", + editTopic: function() { + if ($scope.topic.isEditing) { + console.log("Warning: Already editing topic."); + return; + } + $scope.topic.newTopicText = $rootScope.events.rooms[$scope.room_id]['m.room.topic'].content.topic; + $scope.topic.isEditing = true; + }, + updateTopic: function() { + console.log("Updating topic to "+$scope.topic.newTopicText); + matrixService.setTopic($scope.room_id, $scope.topic.newTopicText); + $scope.topic.isEditing = false; + }, + cancelEdit: function() { + $scope.topic.isEditing = false; + } + }; + + + + var scrollToBottom = function(force) { console.log("Scrolling to bottom"); diff --git a/webclient/room/room.html b/webclient/room/room.html index 4be2482f96..0fe45499e0 100644 --- a/webclient/room/room.html +++ b/webclient/room/room.html @@ -7,7 +7,15 @@ {{ room_id | mRoomName }}
- {{ events.rooms[room_id]['m.room.topic'].content.topic }} +
+ {{ events.rooms[room_id]['m.room.topic'].content.topic | limitTo: 200}} +
+ +
+ +
+
-- cgit 1.4.1 From e8f19b4c0d774bd6f1942aa4557ad0be728b9a4f Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Mon, 8 Sep 2014 18:59:26 -0700 Subject: Display a 'Set Topic' button if there is no topic or it's a 0-len string. --- webclient/app.css | 10 +++++++++- webclient/room/room-controller.js | 9 ++++++++- webclient/room/room.html | 22 +++++++++++++--------- 3 files changed, 30 insertions(+), 11 deletions(-) (limited to 'webclient/room') diff --git a/webclient/app.css b/webclient/app.css index 9667f3fd22..0160b4deef 100755 --- a/webclient/app.css +++ b/webclient/app.css @@ -280,7 +280,6 @@ a:active { color: #000; } color: #888; font-size: 12px; padding-right: 5px; - float: right; width: 15em; overflow: hidden; white-space: nowrap; @@ -301,6 +300,15 @@ a:active { color: #000; } width: 100%; } +.roomTopicSection { + float: right; + width: 100%; +} + +.roomTopicSetNew { + float: right; +} + .roomHeaderInfo { float: right; margin-top: 15px; diff --git a/webclient/room/room-controller.js b/webclient/room/room-controller.js index 10ff12a96b..68845df7d1 100644 --- a/webclient/room/room-controller.js +++ b/webclient/room/room-controller.js @@ -51,7 +51,14 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput']) console.log("Warning: Already editing topic."); return; } - $scope.topic.newTopicText = $rootScope.events.rooms[$scope.room_id]['m.room.topic'].content.topic; + var topicEvent = $rootScope.events.rooms[$scope.room_id]['m.room.topic']; + if (topicEvent) { + $scope.topic.newTopicText = topicEvent.content.topic; + } + else { + $scope.topic.newTopicText = ""; + } + $scope.topic.isEditing = true; }, updateTopic: function() { diff --git a/webclient/room/room.html b/webclient/room/room.html index 0fe45499e0..01f0c4ee33 100644 --- a/webclient/room/room.html +++ b/webclient/room/room.html @@ -6,16 +6,20 @@
{{ room_id | mRoomName }}
-
-
- {{ events.rooms[room_id]['m.room.topic'].content.topic | limitTo: 200}} +
+ +
+
+ {{ events.rooms[room_id]['m.room.topic'].content.topic | limitTo: 200}} +
+
+ +
- -
- -
-
-- cgit 1.4.1 From 16b40cbede292ae0faa073d18b5ff2175a531744 Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 9 Sep 2014 11:45:36 +0100 Subject: Show call invites in the message table --- webclient/components/matrix/event-handler-service.js | 3 +++ webclient/room/room.html | 4 ++++ 2 files changed, 7 insertions(+) (limited to 'webclient/room') diff --git a/webclient/components/matrix/event-handler-service.js b/webclient/components/matrix/event-handler-service.js index 5a3e92186e..94ac91db5e 100644 --- a/webclient/components/matrix/event-handler-service.js +++ b/webclient/components/matrix/event-handler-service.js @@ -172,6 +172,9 @@ angular.module('eventHandlerService', []) var handleCallEvent = function(event, isLiveEvent) { $rootScope.$broadcast(CALL_EVENT, event, isLiveEvent); + if (event.type == 'm.call.invite') { + $rootScope.events.rooms[event.room_id].messages.push(event); + } }; return { diff --git a/webclient/room/room.html b/webclient/room/room.html index 01f0c4ee33..5debeaba7c 100644 --- a/webclient/room/room.html +++ b/webclient/room/room.html @@ -97,6 +97,10 @@ + + Outgoing Call + Incoming Call +
-- cgit 1.4.1 From 332986ba4329625d33c7957f0f4959825417e5aa Mon Sep 17 00:00:00 2001 From: Emmanuel ROHEE Date: Tue, 9 Sep 2014 14:18:08 +0200 Subject: BF: prevent joined messages to be displayed twice when joining a room. Do this by synchronizing the m.room.member joined event from the events stream and the start of the pagination --- webclient/room/room-controller.js | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'webclient/room') diff --git a/webclient/room/room-controller.js b/webclient/room/room-controller.js index 68845df7d1..f81c3df7d2 100644 --- a/webclient/room/room-controller.js +++ b/webclient/room/room-controller.js @@ -32,7 +32,8 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput']) first_pagination: true, // this is toggled off when the first pagination is done can_paginate: true, // this is toggled off when we run out of items paginating: false, // used to avoid concurrent pagination requests pulling in dup contents - stream_failure: undefined // the response when the stream fails + stream_failure: undefined, // the response when the stream fails + waiting_for_joined_event: false // true when the join request is pending. Back to false once the corresponding m.room.member event is received }; $scope.members = {}; $scope.autoCompleting = false; @@ -113,8 +114,15 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput']) $scope.$on(eventHandlerService.MEMBER_EVENT, function(ngEvent, event, isLive) { if (isLive) { - scrollToBottom(); - updateMemberList(event); + if ($scope.state.waiting_for_joined_event) { + // The user has successfully joined the room, we can getting data for this room + $scope.state.waiting_for_joined_event = false; + onInit3(); + } + else { + scrollToBottom(); + updateMemberList(event); + } } }); @@ -628,10 +636,14 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput']) // Do we to join the room before starting? if (needsToJoin) { + $scope.state.waiting_for_joined_event = true; matrixService.join($scope.room_id).then( function() { + // onInit3 will be called once the joined m.room.member event is received from the events stream + // This avoids to get the joined information twice in parallel: + // - one from the events stream + // - one from the pagination because the pagination window covers this event ts console.log("Joined room "+$scope.room_id); - onInit3(); }, function(reason) { console.log("Can't join room: " + JSON.stringify(reason)); -- cgit 1.4.1 From 1ef51e79393b98ecf874dce298892f32570dcdd4 Mon Sep 17 00:00:00 2001 From: Emmanuel ROHEE Date: Tue, 9 Sep 2014 16:46:30 +0200 Subject: Improved room page loading flow: do pagination only when the members list is available. Killed an unexpected pagination trigger when the page load: paginateMore --- webclient/room/room-controller.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'webclient/room') diff --git a/webclient/room/room-controller.js b/webclient/room/room-controller.js index f81c3df7d2..59f64061cd 100644 --- a/webclient/room/room-controller.js +++ b/webclient/room/room-controller.js @@ -30,7 +30,7 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput']) events_from: "END", // when to start the event stream from. earliest_token: "END", // stores how far back we've paginated. first_pagination: true, // this is toggled off when the first pagination is done - can_paginate: true, // this is toggled off when we run out of items + can_paginate: false, // this is toggled off when we are not ready yet to paginate or when we run out of items paginating: false, // used to avoid concurrent pagination requests pulling in dup contents stream_failure: undefined, // the response when the stream fails waiting_for_joined_event: false // true when the join request is pending. Back to false once the corresponding m.room.member event is received @@ -679,13 +679,15 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput']) // Arm list timing update timer updateMemberListPresenceAge(); + + // Start pagination + $scope.state.can_paginate = true; + paginate(MESSAGES_PER_PAGINATION); }, function(error) { $scope.feedback = "Failed get member list: " + error.data.error; } ); - - paginate(MESSAGES_PER_PAGINATION); }; $scope.inviteUser = function(user_id) { -- cgit 1.4.1 From 253c327252a3455aa5ce3a3147e19406a4d67615 Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 9 Sep 2014 17:37:50 +0100 Subject: Don't play an engaged tone if we hang up locally. --- webclient/app-controller.js | 2 +- webclient/components/matrix/matrix-call.js | 11 ++++++++--- webclient/room/room-controller.js | 10 +++++++++- 3 files changed, 18 insertions(+), 5 deletions(-) (limited to 'webclient/room') diff --git a/webclient/app-controller.js b/webclient/app-controller.js index 20b5076727..4a57f66ef0 100644 --- a/webclient/app-controller.js +++ b/webclient/app-controller.js @@ -118,7 +118,7 @@ angular.module('MatrixWebClientController', ['matrixService', 'mPresence', 'even angular.element('#ringAudio')[0].pause(); angular.element('#ringbackAudio')[0].pause(); angular.element('#callendAudio')[0].play(); - } else if (newVal == 'ended' && oldVal == 'invite_sent') { + } else if (newVal == 'ended' && oldVal == 'invite_sent' && $rootScope.currentCall.hangupParty == 'remote') { angular.element('#ringAudio')[0].pause(); angular.element('#ringbackAudio')[0].pause(); angular.element('#busyAudio')[0].play(); diff --git a/webclient/components/matrix/matrix-call.js b/webclient/components/matrix/matrix-call.js index ae20b7650e..aae00a3f77 100644 --- a/webclient/components/matrix/matrix-call.js +++ b/webclient/components/matrix/matrix-call.js @@ -58,12 +58,13 @@ angular.module('MatrixCall', []) this.didConnect = false; } - MatrixCall.prototype.placeCall = function() { + MatrixCall.prototype.placeCall = function(config) { self = this; matrixPhoneService.callPlaced(this); - navigator.getUserMedia({audio: true, video: false}, function(s) { self.gotUserMediaForInvite(s); }, function(e) { self.getUserMediaFailed(e); }); - self.state = 'wait_local_media'; + navigator.getUserMedia({audio: config.audio, video: config.video}, function(s) { self.gotUserMediaForInvite(s); }, function(e) { self.getUserMediaFailed(e); }); + this.state = 'wait_local_media'; this.direction = 'outbound'; + this.config = config; }; MatrixCall.prototype.initWithInvite = function(msg) { @@ -105,6 +106,8 @@ angular.module('MatrixCall', []) this.stopAllMedia(); this.peerConn.close(); + this.hangupParty = 'local'; + var content = { version: 0, call_id: this.call_id, @@ -285,6 +288,7 @@ angular.module('MatrixCall', []) self = this; $rootScope.$apply(function() { self.state = 'ended'; + this.hangupParty = 'remote'; self.stopAllMedia(); this.peerConn.close(); self.onHangup(); @@ -300,6 +304,7 @@ angular.module('MatrixCall', []) MatrixCall.prototype.onHangupReceived = function() { this.state = 'ended'; + this.hangupParty = 'remote'; this.stopAllMedia(); this.peerConn.close(); this.onHangup(); diff --git a/webclient/room/room-controller.js b/webclient/room/room-controller.js index 59f64061cd..3d75ef5499 100644 --- a/webclient/room/room-controller.js +++ b/webclient/room/room-controller.js @@ -756,7 +756,15 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput']) var call = new MatrixCall($scope.room_id); call.onError = $rootScope.onCallError; call.onHangup = $rootScope.onCallHangup; - call.placeCall(); + call.placeCall({audio: true, video: false}); + $rootScope.currentCall = call; + }; + + $scope.startVideoCall = function() { + var call = new MatrixCall($scope.room_id); + call.onError = $rootScope.onCallError; + call.onHangup = $rootScope.onCallHangup; + call.placeCall({audio: true, video: true}); $rootScope.currentCall = call; }; -- cgit 1.4.1 From b63dd9506ea286f8bdaffd213fa79a382933eb35 Mon Sep 17 00:00:00 2001 From: Emmanuel ROHEE Date: Wed, 10 Sep 2014 12:01:00 +0200 Subject: Improved requests: pagination is done from the data received in initialSync --- .../components/matrix/event-handler-service.js | 28 ++++++++++++++++++---- .../components/matrix/event-stream-service.js | 9 ++++++- webclient/room/room-controller.js | 16 ++++++------- 3 files changed, 38 insertions(+), 15 deletions(-) (limited to 'webclient/room') diff --git a/webclient/components/matrix/event-handler-service.js b/webclient/components/matrix/event-handler-service.js index 94ac91db5e..24d634a28b 100644 --- a/webclient/components/matrix/event-handler-service.js +++ b/webclient/components/matrix/event-handler-service.js @@ -55,6 +55,11 @@ angular.module('eventHandlerService', []) $rootScope.events.rooms[room_id] = {}; $rootScope.events.rooms[room_id].messages = []; $rootScope.events.rooms[room_id].members = {}; + + // Pagination information + $rootScope.events.rooms[room_id].pagination = { + earliest_token: "END" // how far back we've paginated + } } }; @@ -187,17 +192,21 @@ angular.module('eventHandlerService', []) NAME_EVENT: NAME_EVENT, handleEvent: function(event, isLiveEvent) { - // FIXME: event duplication suppression is all broken as the code currently expect to handles - // events multiple times to get their side-effects... -/* + // Avoid duplicated events + // Needed for rooms where initialSync has not been done. + // In this case, we do not know where to start pagination. So, it starts from the END + // and we can have the same event (ex: joined, invitation) coming from the pagination + // AND from the event stream. + // FIXME: This workaround should be no more required when /initialSync on a particular room + // will be available (as opposite to the global /initialSync done at startup) if (eventMap[event.event_id]) { - console.log("discarding duplicate event: " + JSON.stringify(event)); + console.log("discarding duplicate event: " + JSON.stringify(event, undefined, 4)); return; } else { eventMap[event.event_id] = 1; } -*/ + if (event.type.indexOf('m.call.') === 0) { handleCallEvent(event, isLiveEvent); } @@ -247,6 +256,15 @@ angular.module('eventHandlerService', []) } }, + // Handle messages from /initialSync or /messages + handleRoomMessages: function(room_id, messages, isLiveEvents) { + this.handleEvents(messages.chunk); + + // Store how far back we've paginated + // This assumes the paginations requests are contiguous and in reverse chronological order + $rootScope.events.rooms[room_id].pagination.earliest_token = messages.end; + }, + handleInitialSyncDone: function(initialSyncData) { console.log("# handleInitialSyncDone"); initialSyncDeferred.resolve(initialSyncData); diff --git a/webclient/components/matrix/event-stream-service.js b/webclient/components/matrix/event-stream-service.js index 1bc850a8fa..d7ccc63e89 100644 --- a/webclient/components/matrix/event-stream-service.js +++ b/webclient/components/matrix/event-stream-service.js @@ -112,9 +112,16 @@ angular.module('eventStreamService', []) var rooms = response.data.rooms; for (var i = 0; i < rooms.length; ++i) { var room = rooms[i]; + // console.log("got room: " + room.room_id); if ("state" in room) { - eventHandlerService.handleEvents(room.state, false); + //eventHandlerService.handleEvents(room.state, false); + } + + if ("messages" in room) { + eventHandlerService.handleRoomMessages(room.room_id, room.messages, false); + + console.log(room.messages.start + " - " + room.messages.end); } } diff --git a/webclient/room/room-controller.js b/webclient/room/room-controller.js index 3d75ef5499..9bb0d8e2d4 100644 --- a/webclient/room/room-controller.js +++ b/webclient/room/room-controller.js @@ -27,8 +27,6 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput']) $scope.state = { user_id: matrixService.config().user_id, - events_from: "END", // when to start the event stream from. - earliest_token: "END", // stores how far back we've paginated. first_pagination: true, // this is toggled off when the first pagination is done can_paginate: false, // this is toggled off when we are not ready yet to paginate or when we run out of items paginating: false, // used to avoid concurrent pagination requests pulling in dup contents @@ -159,12 +157,15 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput']) else { $scope.state.paginating = true; } - // console.log("paginateBackMessages from " + $scope.state.earliest_token + " for " + numItems); + + console.log("paginateBackMessages from " + $rootScope.events.rooms[$scope.room_id].pagination.earliest_token + " for " + numItems); var originalTopRow = $("#messageTable>tbody>tr:first")[0]; - matrixService.paginateBackMessages($scope.room_id, $scope.state.earliest_token, numItems).then( + + // Paginate events from the point in cache + matrixService.paginateBackMessages($scope.room_id, $rootScope.events.rooms[$scope.room_id].pagination.earliest_token, numItems).then( function(response) { - eventHandlerService.handleEvents(response.data.chunk, false); - $scope.state.earliest_token = response.data.end; + + eventHandlerService.handleRoomMessages($scope.room_id, response.data, false); if (response.data.chunk.length < MESSAGES_PER_PAGINATION) { // no more messages to paginate. this currently never gets turned true again, as we never // expire paginated contents in the current implementation. @@ -659,9 +660,6 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput']) var onInit3 = function() { console.log("onInit3"); - - // TODO: We should be able to keep them - eventHandlerService.resetRoomMessages($scope.room_id); // Make recents highlight the current room $scope.recentsSelectedRoomID = $scope.room_id; -- cgit 1.4.1 From 81ecaf945d7cbb21547664c4de03747e71c8084b Mon Sep 17 00:00:00 2001 From: Emmanuel ROHEE Date: Wed, 10 Sep 2014 17:37:51 +0200 Subject: BF: Made /op work when providing no power value. 50 is used as default in this case --- webclient/room/room-controller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'webclient/room') diff --git a/webclient/room/room-controller.js b/webclient/room/room-controller.js index 9bb0d8e2d4..2af11edf32 100644 --- a/webclient/room/room-controller.js +++ b/webclient/room/room-controller.js @@ -460,7 +460,7 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput']) var powerLevel = 50; // default power level for op if (matches) { var user_id = matches[1]; - if (matches.length === 4) { + if (matches.length === 4 && undefined !== matches[3]) { powerLevel = parseInt(matches[3]); } if (powerLevel !== NaN) { -- cgit 1.4.1 From 6d18b52931dd46fb8ba3a680cc9519d4988815af Mon Sep 17 00:00:00 2001 From: Emmanuel ROHEE Date: Wed, 10 Sep 2014 17:40:34 +0200 Subject: Clean previous request feedback when doing a new request --- webclient/room/room-controller.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'webclient/room') diff --git a/webclient/room/room-controller.js b/webclient/room/room-controller.js index 2af11edf32..171d4c0d99 100644 --- a/webclient/room/room-controller.js +++ b/webclient/room/room-controller.js @@ -523,6 +523,9 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput']) } if (promise) { + // Reset previous feedback + $scope.feedback = ""; + promise.then( function() { console.log("Request successfully sent"); -- cgit 1.4.1 From 5a06f5c5fcac58ecd36c0a3c186ed8639767dbe3 Mon Sep 17 00:00:00 2001 From: Emmanuel ROHEE Date: Wed, 10 Sep 2014 18:24:03 +0200 Subject: Reenabled transparent echo message. It turns to opaque without flickering now. --- .../components/matrix/event-handler-service.js | 34 ++++++++++++++++++++-- webclient/room/room-controller.js | 25 +++++----------- 2 files changed, 40 insertions(+), 19 deletions(-) (limited to 'webclient/room') diff --git a/webclient/components/matrix/event-handler-service.js b/webclient/components/matrix/event-handler-service.js index 38b7bd6b6d..277faa6f77 100644 --- a/webclient/components/matrix/event-handler-service.js +++ b/webclient/components/matrix/event-handler-service.js @@ -86,8 +86,15 @@ angular.module('eventHandlerService', []) if (isLiveEvent) { if (event.user_id === matrixService.config().user_id && (event.content.msgtype === "m.text" || event.content.msgtype === "m.emote") ) { - // assume we've already echoed it - // FIXME: track events by ID and ungrey the right message to show it's been delivered + // Assume we've already echoed it. So, there is a fake event in the messages list of the room + // Replace this fake event by the true one + var index = getRoomEventIndex(event.room_id, event.event_id); + if (index) { + $rootScope.events.rooms[event.room_id].messages[index] = event; + } + else { + $rootScope.events.rooms[event.room_id].messages.push(event); + } } else { $rootScope.events.rooms[event.room_id].messages.push(event); @@ -190,6 +197,29 @@ angular.module('eventHandlerService', []) } }; + /** + * Get the index of the event in $rootScope.events.rooms[room_id].messages + * @param {type} room_id the room id + * @param {type} event_id the event id to look for + * @returns {Number | undefined} the index. undefined if not found. + */ + var getRoomEventIndex = function(room_id, event_id) { + var index; + + var room = $rootScope.events.rooms[room_id]; + if (room) { + for (var i = 0; i < room.messages.length; i++) { + var message = room.messages[i]; + console.log(message.event_id); + if (event_id === message.event_id) { + index = i; + break; + } + } + } + return index; + } + return { ROOM_CREATE_EVENT: ROOM_CREATE_EVENT, MSG_EVENT: MSG_EVENT, diff --git a/webclient/room/room-controller.js b/webclient/room/room-controller.js index 171d4c0d99..0000fcfc61 100644 --- a/webclient/room/room-controller.js +++ b/webclient/room/room-controller.js @@ -513,8 +513,7 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput']) room_id: $scope.room_id, type: "m.room.message", user_id: $scope.state.user_id, - // FIXME: re-enable echo_msg_state when we have a nice way to turn the field off again - // echo_msg_state: "messagePending" // Add custom field to indicate the state of this fake message to HTML + echo_msg_state: "messagePending" // Add custom field to indicate the state of this fake message to HTML }; $scope.textInput = ""; @@ -527,25 +526,17 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput']) $scope.feedback = ""; promise.then( - function() { + function(response) { console.log("Request successfully sent"); - if (!echo) { - $scope.textInput = ""; - } -/* - if (echoMessage) { - // Remove the fake echo message from the room messages - // It will be replaced by the one acknowledged by the server - // ...except this causes a nasty flicker. So don't swap messages for now. --matthew - // var index = $rootScope.events.rooms[$scope.room_id].messages.indexOf(echoMessage); - // if (index > -1) { - // $rootScope.events.rooms[$scope.room_id].messages.splice(index, 1); - // } + if (echo) { + // Mark this fake message event with its allocated event_id + // When the true message event will come from the events stream (in handleMessage), + // we will be able to replace the fake one by the true one + echoMessage.event_id = response.data.event_id; } else { $scope.textInput = ""; - } -*/ + } }, function(error) { $scope.feedback = "Request failed: " + error.data.error; -- cgit 1.4.1 From 7a153b5c94bbd4f1778a2d32ee5c090967c5cb83 Mon Sep 17 00:00:00 2001 From: Emmanuel ROHEE Date: Wed, 10 Sep 2014 18:29:52 +0200 Subject: Show echoed emote with transparency --- webclient/room/room.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'webclient/room') diff --git a/webclient/room/room.html b/webclient/room/room.html index 5debeaba7c..054b876f81 100644 --- a/webclient/room/room.html +++ b/webclient/room/room.html @@ -93,7 +93,10 @@ - + + -- cgit 1.4.1 From 7e7eb0efc14733b576942af4590683c8b749e94e Mon Sep 17 00:00:00 2001 From: Emmanuel ROHEE Date: Thu, 11 Sep 2014 11:31:24 +0200 Subject: Show room topic change in the chat history and in the recents --- .../components/matrix/event-handler-service.js | 25 ++++++++++++++++++---- webclient/recents/recents-controller.js | 5 +++++ webclient/recents/recents.html | 4 ++++ webclient/room/room.html | 5 +++++ 4 files changed, 35 insertions(+), 4 deletions(-) (limited to 'webclient/room') diff --git a/webclient/components/matrix/event-handler-service.js b/webclient/components/matrix/event-handler-service.js index b19ec27a9d..002a9fbd5d 100644 --- a/webclient/components/matrix/event-handler-service.js +++ b/webclient/components/matrix/event-handler-service.js @@ -35,6 +35,7 @@ angular.module('eventHandlerService', []) var POWERLEVEL_EVENT = "POWERLEVEL_EVENT"; var CALL_EVENT = "CALL_EVENT"; var NAME_EVENT = "NAME_EVENT"; + var TOPIC_EVENT = "TOPIC_EVENT"; var initialSyncDeferred = $q.defer(); @@ -170,24 +171,39 @@ angular.module('eventHandlerService', []) }; // TODO: Can this just be a generic "I am a room state event, can haz store?" - var handleRoomTopic = function(event, isLiveEvent) { + var handleRoomTopic = function(event, isLiveEvent, isStateEvent) { console.log("handleRoomTopic live="+isLiveEvent); initRoom(event.room_id); + // Add topic changes as if they were a room message + if (!isStateEvent) { + if (isLiveEvent) { + $rootScope.events.rooms[event.room_id].messages.push(event); + } + else { + $rootScope.events.rooms[event.room_id].messages.unshift(event); + } + } + // live events always update, but non-live events only update if the // ts is later. + var latestData = true; if (!isLiveEvent) { var eventTs = event.ts; var storedEvent = $rootScope.events.rooms[event.room_id][event.type]; if (storedEvent) { if (storedEvent.ts > eventTs) { // ignore it, we have a newer one already. - return; + latestData = false; } } } - $rootScope.events.rooms[event.room_id][event.type] = event; + if (latestData) { + $rootScope.events.rooms[event.room_id][event.type] = event; + } + + $rootScope.$broadcast(TOPIC_EVENT, event, isLiveEvent); }; var handleCallEvent = function(event, isLiveEvent) { @@ -229,6 +245,7 @@ angular.module('eventHandlerService', []) POWERLEVEL_EVENT: POWERLEVEL_EVENT, CALL_EVENT: CALL_EVENT, NAME_EVENT: NAME_EVENT, + TOPIC_EVENT: TOPIC_EVENT, handleEvent: function(event, isLiveEvent, isStateEvent) { // Avoid duplicated events @@ -279,7 +296,7 @@ angular.module('eventHandlerService', []) handleRoomName(event, isLiveEvent); break; case 'm.room.topic': - handleRoomTopic(event, isLiveEvent); + handleRoomTopic(event, isLiveEvent, isStateEvent); break; default: console.log("Unable to handle event type " + event.type); diff --git a/webclient/recents/recents-controller.js b/webclient/recents/recents-controller.js index 5cf74cad4e..8ce0969164 100644 --- a/webclient/recents/recents-controller.js +++ b/webclient/recents/recents-controller.js @@ -68,6 +68,11 @@ angular.module('RecentsController', ['matrixService', 'matrixFilter', 'eventHand $rootScope.rooms[event.room_id] = event; } }); + $rootScope.$on(eventHandlerService.TOPIC_EVENT, function(ngEvent, event, isLive) { + if (isLive) { + $rootScope.rooms[event.room_id].lastMsg = event; + } + }); }; /** diff --git a/webclient/recents/recents.html b/webclient/recents/recents.html index d6bea52cbe..6976bab879 100644 --- a/webclient/recents/recents.html +++ b/webclient/recents/recents.html @@ -76,6 +76,10 @@
+
+ {{ room.lastMsg.user_id | mUserDisplayName: room.room_id }} changed the topic to: {{ room.lastMsg.content.topic }} +
+
Call diff --git a/webclient/room/room.html b/webclient/room/room.html index 054b876f81..dba6586e00 100644 --- a/webclient/room/room.html +++ b/webclient/room/room.html @@ -113,6 +113,11 @@ ng-click="$parent.fullScreenImageURL = msg.content.url"/>
+ + + {{ members[msg.user_id].displayname || msg.user_id }} changed the topic to: {{ msg.content.topic }} + + -- cgit 1.4.1 From af44e9556d7f2aab93b96f11eef02d23cb65ac8e Mon Sep 17 00:00:00 2001 From: Emmanuel ROHEE Date: Thu, 11 Sep 2014 11:49:59 +0200 Subject: BF: made input autofocus work when opening the room topic input --- webclient/room/room-controller.js | 5 +++++ webclient/room/room.html | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'webclient/room') diff --git a/webclient/room/room-controller.js b/webclient/room/room-controller.js index 0000fcfc61..94c7688907 100644 --- a/webclient/room/room-controller.js +++ b/webclient/room/room-controller.js @@ -58,6 +58,11 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput']) $scope.topic.newTopicText = ""; } + // Force focus to the input + $timeout(function() { + angular.element('.roomTopicInput').focus(); + }, 0); + $scope.topic.isEditing = true; }, updateTopic: function() { diff --git a/webclient/room/room.html b/webclient/room/room.html index dba6586e00..587b0057a6 100644 --- a/webclient/room/room.html +++ b/webclient/room/room.html @@ -16,8 +16,7 @@ {{ events.rooms[room_id]['m.room.topic'].content.topic | limitTo: 200}}
- +
-- cgit 1.4.1 From 14a9652324a1dbfec55b83ae4fbfb7ee3bf1f3da Mon Sep 17 00:00:00 2001 From: Emmanuel ROHEE Date: Thu, 11 Sep 2014 11:53:37 +0200 Subject: Room topic: if the request fails, show the error in the feedback --- webclient/room/room-controller.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'webclient/room') diff --git a/webclient/room/room-controller.js b/webclient/room/room-controller.js index 94c7688907..fe3821eb45 100644 --- a/webclient/room/room-controller.js +++ b/webclient/room/room-controller.js @@ -67,7 +67,14 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput']) }, updateTopic: function() { console.log("Updating topic to "+$scope.topic.newTopicText); - matrixService.setTopic($scope.room_id, $scope.topic.newTopicText); + matrixService.setTopic($scope.room_id, $scope.topic.newTopicText).then( + function() { + }, + function(error) { + $scope.feedback = "Request failed: " + error.data.error; + } + ); + $scope.topic.isEditing = false; }, cancelEdit: function() { -- cgit 1.4.1 From cc049851d0cd76ea5cb92ca2c6f7b6a6c45e217e Mon Sep 17 00:00:00 2001 From: Emmanuel ROHEE Date: Thu, 11 Sep 2014 12:01:44 +0200 Subject: On member avatar mouseover, show user_id and power level --- webclient/room/room.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'webclient/room') diff --git a/webclient/room/room.html b/webclient/room/room.html index 587b0057a6..98423ae40b 100644 --- a/webclient/room/room.html +++ b/webclient/room/room.html @@ -37,7 +37,7 @@ {{ member.displayname || member.id.substr(0, member.id.indexOf(':')) }}
-- cgit 1.4.1 From c92740e8a905b3f19a27290410823cff9b35b945 Mon Sep 17 00:00:00 2001 From: Emmanuel ROHEE Date: Thu, 11 Sep 2014 13:43:55 +0200 Subject: Enable enter key in the invite input --- webclient/room/room.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'webclient/room') diff --git a/webclient/room/room.html b/webclient/room/room.html index 98423ae40b..2225cc7646 100644 --- a/webclient/room/room.html +++ b/webclient/room/room.html @@ -150,7 +150,7 @@
Invite a user: - + -- cgit 1.4.1 From 6b20fef52af078e6fa7343f2e9c23fcbbf6fef48 Mon Sep 17 00:00:00 2001 From: Emmanuel ROHEE Date: Thu, 11 Sep 2014 13:52:07 +0200 Subject: Invite: reset the input when the invitation has been done --- webclient/room/room-controller.js | 7 ++++--- webclient/room/room.html | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'webclient/room') diff --git a/webclient/room/room-controller.js b/webclient/room/room-controller.js index fe3821eb45..da77864017 100644 --- a/webclient/room/room-controller.js +++ b/webclient/room/room-controller.js @@ -694,12 +694,13 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput']) ); }; - $scope.inviteUser = function(user_id) { + $scope.inviteUser = function() { - matrixService.invite($scope.room_id, user_id).then( + matrixService.invite($scope.room_id, $scope.userIDToInvite).then( function() { console.log("Invited."); - $scope.feedback = "Invite sent successfully"; + $scope.feedback = "Invite successfully sent to " + $scope.userIDToInvite; + $scope.userIDToInvite = ""; }, function(reason) { $scope.feedback = "Failure: " + reason; diff --git a/webclient/room/room.html b/webclient/room/room.html index 2225cc7646..b00d632292 100644 --- a/webclient/room/room.html +++ b/webclient/room/room.html @@ -150,8 +150,8 @@
Invite a user: - - + + -- cgit 1.4.1 From 806c49a690b5db15030bb5e8d14c5f9983e875d4 Mon Sep 17 00:00:00 2001 From: Emmanuel ROHEE Date: Thu, 11 Sep 2014 15:46:24 +0200 Subject: Added support of copy/paste of multi lines content --- webclient/app.css | 5 +++++ webclient/room/room.html | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'webclient/room') diff --git a/webclient/app.css b/webclient/app.css index 2564ce3286..71af550679 100755 --- a/webclient/app.css +++ b/webclient/app.css @@ -257,6 +257,7 @@ a:active { color: #000; } #mainInput { width: 100%; + resize: none; } .blink { @@ -514,6 +515,10 @@ a:active { color: #000; } text-align: left ! important; } +.bubble .message { + /* Break lines when encountering CR+LF */ + white-space: pre; +} .bubble .messagePending { opacity: 0.3 } diff --git a/webclient/room/room.html b/webclient/room/room.html index b00d632292..530545da53 100644 --- a/webclient/room/room.html +++ b/webclient/room/room.html @@ -97,6 +97,7 @@ ng-bind-html="'* ' + (members[msg.user_id].displayname || msg.user_id) + ' ' + msg.content.body | linky:'_blank'"/> @@ -138,7 +139,7 @@ {{ state.user_id }} - +