Skip to content

Commit

Permalink
feat: show ongoing calls in archived conversations
Browse files Browse the repository at this point in the history
- hidden feature: show only if 'notify about calls' is truthy

Signed-off-by: Maksim Sukharev <[email protected]>
  • Loading branch information
Antreesy committed Sep 24, 2024
1 parent 845ae7b commit 16a002b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/LeftSidebar/LeftSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ import { talkBroadcastChannel } from '../../services/talkBroadcastChannel.js'
import { useFederationStore } from '../../stores/federation.ts'
import { useTalkHashStore } from '../../stores/talkHash.js'
import CancelableRequest from '../../utils/cancelableRequest.js'
import { hasUnreadMentions, filterFunction } from '../../utils/conversation.js'
import { hasUnreadMentions, hasCall, filterFunction } from '../../utils/conversation.js'
import { requestTabLeadership } from '../../utils/requestTabLeadership.js'
const isFederationEnabled = getTalkConfig('local', 'federation', 'enabled')
Expand Down Expand Up @@ -551,7 +551,7 @@ export default {
validConversationsCount++
}
return conversationIsValid
|| conversation.hasCall
|| hasCall(conversation)
|| conversation.token === this.token
})
// return empty if it only includes the current conversation without any flags
Expand Down
10 changes: 10 additions & 0 deletions src/utils/conversation.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@ export function hasUnreadMentions(conversation) {
&& (conversation.type === CONVERSATION.TYPE.ONE_TO_ONE || conversation.type === CONVERSATION.TYPE.ONE_TO_ONE_FORMER))
}

/**
* check if the conversation has ongoing call
*
* @param {object} conversation conversation object
* @return {boolean}
*/
export function hasCall(conversation) {
return conversation.hasCall && (!isArchived(conversation) || conversation.notificationCalls === PARTICIPANT.NOTIFY_CALLS.ON)
}

/**
* check if the conversation is archived
*
Expand Down

0 comments on commit 16a002b

Please sign in to comment.