Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Briar Desktop
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
briar
Briar Desktop
Commits
4cc590ae
Verified
Commit
4cc590ae
authored
2 years ago
by
Sebastian
Browse files
Options
Downloads
Patches
Plain Diff
Update message counters when deleting contact or forum
parent
94d2a3b7
No related branches found
No related tags found
1 merge request
!323
Update message counters when deleting contact or forum
Pipeline
#13927
passed
2 years ago
Stage: test
Changes
1
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
briar-desktop/src/main/kotlin/org/briarproject/briar/desktop/ui/MessageCounterImpl.kt
+14
-0
14 additions, 0 deletions
...n/org/briarproject/briar/desktop/ui/MessageCounterImpl.kt
with
14 additions
and
0 deletions
briar-desktop/src/main/kotlin/org/briarproject/briar/desktop/ui/MessageCounterImpl.kt
+
14
−
0
View file @
4cc590ae
...
...
@@ -21,10 +21,12 @@ package org.briarproject.briar.desktop.ui
import
org.briarproject.bramble.api.Multiset
import
org.briarproject.bramble.api.contact.ContactId
import
org.briarproject.bramble.api.contact.ContactManager
import
org.briarproject.bramble.api.contact.event.ContactRemovedEvent
import
org.briarproject.bramble.api.event.EventBus
import
org.briarproject.bramble.api.lifecycle.LifecycleManager.LifecycleState.RUNNING
import
org.briarproject.bramble.api.lifecycle.event.LifecycleEvent
import
org.briarproject.bramble.api.sync.GroupId
import
org.briarproject.bramble.api.sync.event.GroupRemovedEvent
import
org.briarproject.briar.api.conversation.ConversationManager
import
org.briarproject.briar.api.conversation.event.ConversationMessageReceivedEvent
import
org.briarproject.briar.api.forum.ForumManager
...
...
@@ -84,6 +86,11 @@ constructor(
informListeners
(
PrivateMessage
,
false
)
}
is
ContactRemovedEvent
->
{
countPrivateMessages
.
removeAll
(
e
.
contactId
)
informListeners
(
PrivateMessage
,
false
)
}
is
ForumPostReceivedEvent
->
{
countForumPosts
.
add
(
e
.
groupId
)
informListeners
(
Forum
,
true
)
...
...
@@ -93,6 +100,13 @@ constructor(
countForumPosts
.
removeCount
(
e
.
groupId
,
e
.
numMarkedRead
)
informListeners
(
Forum
,
false
)
}
is
GroupRemovedEvent
->
{
if
(
e
.
group
.
clientId
==
ForumManager
.
CLIENT_ID
)
{
countForumPosts
.
removeAll
(
e
.
group
.
id
)
informListeners
(
Forum
,
false
)
}
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment