summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaksim Sukharev <antreesy.web@gmail.com>2023-08-15 16:07:24 +0200
committerGitHub <noreply@github.com>2023-08-15 16:07:24 +0200
commita17633246c5f701c82aff26d665fd923e921249b (patch)
tree23d76633f59ab84bc2a5f2c0b5ee2cac362454d7
parent10c4934e3853975c6ed633b91e1496370741adf3 (diff)
parent94636b300ca7e0fd7ff90b88c8d095c0d9fd5ae6 (diff)
Merge pull request #10205 from nextcloud/backport/10201/stable27
[stable27] Simplify tracking of total counted time
-rw-r--r--src/components/RightSidebar/Participants/ParticipantsList/Participant/Participant.vue8
-rw-r--r--src/store/participantsStore.js18
2 files changed, 14 insertions, 12 deletions
diff --git a/src/components/RightSidebar/Participants/ParticipantsList/Participant/Participant.vue b/src/components/RightSidebar/Participants/ParticipantsList/Participant/Participant.vue
index 6a161e3f4..791ad2cd7 100644
--- a/src/components/RightSidebar/Participants/ParticipantsList/Participant/Participant.vue
+++ b/src/components/RightSidebar/Participants/ParticipantsList/Participant/Participant.vue
@@ -40,7 +40,7 @@
disable-tooltip
:show-user-status="showUserStatus && !isSearched"
:preloaded-user-status="preloadedUserStatus"
- :highlighted="isParticipantSpeaking"
+ :highlighted="isSpeakingStatusAvailable && isParticipantSpeaking"
:offline="isOffline" />
<!-- Participant's data -->
@@ -349,8 +349,12 @@ export default {
return text
},
+ isSpeakingStatusAvailable() {
+ return this.isInCall && !!this.participant.inCall && !!this.timeSpeaking
+ },
+
statusMessage() {
- if (this.isInCall && this.participant.inCall && this.timeSpeaking) {
+ if (this.isSpeakingStatusAvailable) {
return this.isParticipantSpeaking
? '💬 ' + t('spreed', '{time} talking …', { time: formattedTime(this.timeSpeaking, true) })
: '💬 ' + t('spreed', '{time} talking time', { time: formattedTime(this.timeSpeaking, true) })
diff --git a/src/store/participantsStore.js b/src/store/participantsStore.js
index 1bd09bce1..e12dce55f 100644
--- a/src/store/participantsStore.js
+++ b/src/store/participantsStore.js
@@ -348,8 +348,8 @@ const mutations = {
* property to an existing participant, as the participant would be reset
* when the participants are purged whenever they are fetched again.
* Similarly, "addParticipant" can not be called either to add a participant
- * if it was not fetched yet but the signaling reported it as being speaking,
- * as the attendeeId would be unknown.
+ * if it was not fetched yet but the call model reported it as being
+ * speaking, as the attendeeId would be unknown.
*
* @param {object} state - current store state.
* @param {object} data - the wrapping object.
@@ -369,15 +369,13 @@ const mutations = {
const currentTimestamp = Date.now()
const currentSpeakingState = state.speaking[token][sessionId].speaking
- // when speaking has stopped, update the total talking time
- if (currentSpeakingState && !speaking && state.speaking[token][sessionId].lastTimestamp) {
- state.speaking[token][sessionId].totalCountedTime += (currentTimestamp - state.speaking[token][sessionId].lastTimestamp)
- }
-
- // don't change state for consecutive identical signals
- if (currentSpeakingState !== speaking) {
- state.speaking[token][sessionId].speaking = speaking
+ if (!currentSpeakingState && speaking) {
+ state.speaking[token][sessionId].speaking = true
state.speaking[token][sessionId].lastTimestamp = currentTimestamp
+ } else if (currentSpeakingState && !speaking) {
+ // when speaking has stopped, update the total talking time
+ state.speaking[token][sessionId].speaking = false
+ state.speaking[token][sessionId].totalCountedTime += (currentTimestamp - state.speaking[token][sessionId].lastTimestamp)
}
},