diff options
author | Joas Schilling <213943+nickvergessen@users.noreply.github.com> | 2020-10-23 10:54:33 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-23 10:54:33 +0300 |
commit | 6aef7f5ed5f4db526a81d9b47f5aa2a6a1c16d5a (patch) | |
tree | 0d29434fcf968f6e4a95497ae9ab529a42b08b65 | |
parent | 4a1090df93d24626377de43f2f34ba2dd4fa3e64 (diff) | |
parent | 3b5386e4c60a3133569345e4082637d7d67bb08a (diff) |
Merge pull request #4442 from nextcloud/backport/4374/stable20
[stable20] Only show the conflict warning when the session was in a call
-rw-r--r-- | lib/Controller/RoomController.php | 4 | ||||
-rw-r--r-- | src/App.vue | 10 | ||||
-rw-r--r-- | src/views/SessionConflictView.vue | 10 |
3 files changed, 21 insertions, 3 deletions
diff --git a/lib/Controller/RoomController.php b/lib/Controller/RoomController.php index af8d6a9e9..ab28622d1 100644 --- a/lib/Controller/RoomController.php +++ b/lib/Controller/RoomController.php @@ -1229,8 +1229,8 @@ class RoomController extends AEnvironmentAwareController { } if ($previousSession instanceof Participant && $previousSession->getSessionId() !== '0') { - // Previous session was active - if ($force === false) { + if ($force === false && $previousSession->getInCallFlags() !== Participant::FLAG_DISCONNECTED) { + // Previous session was active in the call, show a warning return new DataResponse([ 'sessionId' => $previousSession->getSessionId(), 'inCall' => $previousSession->getInCallFlags(), diff --git a/src/App.vue b/src/App.vue index 61d69f37e..cb20685a2 100644 --- a/src/App.vue +++ b/src/App.vue @@ -369,7 +369,11 @@ export default { this.$store.dispatch('setWindowVisibility', !document.hidden) if (this.windowIsVisible) { // Remove the potential "*" marker for unread chat messages - this.setPageTitle(this.getConversationName(this.token), false) + let title = this.getConversationName(this.token) + if (window.document.title.indexOf(t('spreed', 'Duplicate session')) === 0) { + title = t('spreed', 'Duplicate session') + } + this.setPageTitle(title, false) } else { // Copy the last message map to the saved version, // this will be our reference to check if any chat got a new @@ -388,6 +392,10 @@ export default { // On the first load we store the current page title "Talk - Nextcloud", // so we can append it every time again this.defaultPageTitle = window.document.title + // Coming from a "Duplicate session - Talk - …" page? + if (this.defaultPageTitle.indexOf(' - ' + t('spreed', 'Talk') + ' - ') !== -1) { + this.defaultPageTitle = this.defaultPageTitle.substring(this.defaultPageTitle.indexOf(' - ' + t('spreed', 'Talk') + ' - ') + 3) + } // When a conversation is opened directly, the "Talk - " part is // missing from the title if (this.defaultPageTitle.indexOf(t('spreed', 'Talk') + ' - ') !== 0) { diff --git a/src/views/SessionConflictView.vue b/src/views/SessionConflictView.vue index 4b5974608..9e22b434d 100644 --- a/src/views/SessionConflictView.vue +++ b/src/views/SessionConflictView.vue @@ -11,5 +11,15 @@ <script> export default { name: 'SessionConflictView', + + mounted() { + this.setPageTitle() + }, + + methods: { + setPageTitle() { + window.document.title = t('spreed', 'Duplicate session') + ' - ' + window.document.title + }, + }, } </script> |