Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ignore push for a thread if it's currently visible to user #7641

Merged
merged 3 commits into from
Nov 28, 2022

Conversation

fedrunov
Copy link
Contributor

Type of change

  • Feature
  • Bugfix
  • Technical
  • Other :

Content

we don't show push notification for a room which is currently observed by the user, but we should also take in account which thread timeline user observes

Motivation and context

closes #7634

@fedrunov fedrunov requested a review from bmarty November 25, 2022 11:06
Copy link
Member

@bmarty bmarty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!
Just a few remarks, but no blockers.

@@ -142,11 +143,6 @@ class VectorPushHandler @Inject constructor(
pushData.roomId ?: return
pushData.eventId ?: return

// If the room is currently displayed, we will not show a notification, so no need to get the Event faster
if (notificationDrawerManager.shouldIgnoreMessageEventInRoom(pushData.roomId)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we do not have the threadId in the pushData, true?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't :(

* Should be called when the application is currently opened and showing timeline for the given threadId.
* Used to ignore events related to that thread (no need to display notification) and clean any existing notification on this room.
*/
fun setCurrentThread(threadId: String?) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe merge with the method setCurrentRoom, just adding the parameter threadId: String? to it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

user can switch between different threads in the same rooms, so i think it's better to separate changing room and changing thread

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 3 Code Smells

28.6% 28.6% Coverage
0.0% 0.0% Duplication

@fedrunov fedrunov merged commit 46fc0ac into develop Nov 28, 2022
@fedrunov fedrunov deleted the feature/nfe/current_thread_push_notification branch November 28, 2022 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Do not show push notification for thread, when thread timeline is observed by user
2 participants