-
-
Notifications
You must be signed in to change notification settings - Fork 259
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
Add support for handling delete_message events. #1048
Open
zee-bit
wants to merge
3
commits into
zulip:main
Choose a base branch
from
zee-bit:delete-event-action
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
zee-bit
force-pushed
the
delete-event-action
branch
from
June 6, 2021 21:58
a9f5c99
to
df95f4d
Compare
I'll add the tests tomorrow, after exploring for further corner-cases/bugs. :) |
zee-bit
force-pushed
the
delete-event-action
branch
from
June 6, 2021 22:08
df95f4d
to
e7772c2
Compare
zee-bit
force-pushed
the
delete-event-action
branch
3 times, most recently
from
June 8, 2021 14:48
7ead3e1
to
68d97ba
Compare
zulipbot
added
size: XL
[Automatic label added by zulipbot]
and removed
size: L
[Automatic label added by zulipbot]
labels
Jun 8, 2021
The _update_rendered_view function in model only supported updating the UI and the corresponding message_box for message update events. This commit adds the condition that checks for message deletion and updates the UI to remove the message_box from the view.
This adds a new event action in model that looks for delete_message events, potentially handling it by removing the message from the index, and then updates the rendered_view to handle the event dynamically without needing to switch narrows. This commit currently doesn't handle updating index and UI related to special narrows such as mentioned/starred, also doesn't handle updating unread counts. It implements the bare minimum that is required for handling such events. Tests added.
This commit extends the previous commit that added rudimentary support for handling delete_message event, and allows updating the special narrows such as mentioned/starred that were depending on message flags. This commit could be considered as a bugfix over the previous one. It also handles updating the unread count if the message was earlier unread before being deleted. Tests added and amended. Fixes one check-box in zulip#993.
zee-bit
force-pushed
the
delete-event-action
branch
from
June 9, 2021 12:52
68d97ba
to
482cabe
Compare
zee-bit
changed the title
[WIP] Add support for handling delete_message events.
Add support for handling delete_message events.
Jun 9, 2021
Heads up @zee-bit, we just merged some commits that conflict with the changes you made in this pull request! You can review this repository's recent commits to see where the conflicts occur. Please rebase your feature branch against the |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area: event handling
How events from the server are responded to
has conflicts
PR needs review
PR requires feedback to proceed
size: XL
[Automatic label added by zulipbot]
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds a new event action in model that looks for delete_message events, potentially handling it by removing the message completely from the index, and then updates the rendered_view to handle the event dynamically without needing to switch narrows.
It also looks out for messages being unread before being deleted and updates the count appropriately. Similarly, for messages that were starred before being deleted, this updates the
starred_count
too.Fixes one check-box of #993.