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

Delete chat messages #4861

Merged
merged 17 commits into from
Feb 2, 2021
Merged

Delete chat messages #4861

merged 17 commits into from
Feb 2, 2021

Conversation

jakobroehrl
Copy link
Contributor

@jakobroehrl jakobroehrl commented Dec 29, 2020

Fix #774

Todo

  • Delete message content from database
  • Add a system message so the old one can be deleted/updated in stores (web ui and mobile clients)
  • Currently limited to 6h old messages
  • Show a warning if matterbridge is active
  • Write integration tests
  • Add capability
  • Adjust documentation
  • change delete possibility: Only my messages within 6 hours after sending can be deleted

@sudwhiwdh
Copy link

How will users learn what this feature/action means in a uncomplicated way, i.e. without reading any documentation before?
For example, in terms of the available time window of 15 minutes or how to deal with federated messages.

@jakobroehrl
Copy link
Contributor Author

How will users learn what this feature/action means in a uncomplicated way, i.e. without reading any documentation before?
For example, in terms of the available time window of 15 minutes

Only give the option when it's possible.

or how to deal with federated messages.

Hmm, do you have an idea. If that is a problem let's close this PR.

@sudwhiwdh
Copy link

How will users learn what this feature/action means in a uncomplicated way, i.e. without reading any documentation before?
For example, in terms of the available time window of 15 minutes

Only give the option when it's possible.

However, this still does not explain to users in which time window they can/should react with the Delete action, does it?

or how to deal with federated messages.

Hmm, do you have an idea. If that is a problem let's close this PR.

I don't know if that's a problem. What problems do you see in this case?

For me, it's definitely a matter of transparent communication so that there are no false expectations. It would be simply important for me that users understand in a comprehensible way from which server or device the message can be deleted with this action and for which people the message will still be visible after deletion.

Btw. is it technically possible to retrieve a message from a federated Nextcloud server within fifteen minutes?

@nickvergessen
Copy link
Member

So multiple things with this:

  1. Deleting gives a wrong impression when "Matterbridge" is configured for this channel, as the message is synced already to other chats where we can no longer delete the message. From my personal POV we should either show a warning on deleting that the message was federated and always will be "public" information, or not allow deleting in matterbridged conversations at all.
  2. Since the last message id of a conversation is set and the messages are downloaded by our mobile clients, deleting from the DB is not a good idea and doesn't help a lot. Instead we should only wipe the content of the message (if the database structure allows it to be empty) and at the same time we need to add a "hidden" message that the message with ID X was deleted, so the clients can remove the message from their local store as well.
  3. Regarding time restriction, we checked a bit what others do and they are a bit more "lax", Whatsapp 1 hour, Signal 3 hours, Line IM 24 hours, Telegram infinite. So we would go with 6 hours for now.

I can help with the backend if you want.

lib/Model/Message.php Outdated Show resolved Hide resolved
@nickvergessen nickvergessen added this to the 💖 Next Major (22) milestone Jan 7, 2021
@nickvergessen nickvergessen self-assigned this Jan 7, 2021
@nickvergessen nickvergessen marked this pull request as draft January 7, 2021 15:37
@nickvergessen
Copy link
Member

Converting to draft for backend work

@nickvergessen nickvergessen changed the title delete a message Delete chat messages Jan 11, 2021
@jakobroehrl
Copy link
Contributor Author

@nickvergessen Please ping me if you are ready with the backend work, I can test this, if you want.

@nickvergessen
Copy link
Member

Should be ready to play around with it, integration tests are still missing, same for capability and documentation

@jakobroehrl
Copy link
Contributor Author

I can delete, but after the page reload the deleted messaage is visible again

@nickvergessen
Copy link
Member

I forcepushed because of a rebase. make sure your pulling worked

@jakobroehrl
Copy link
Contributor Author

It's working super nice!

docs/chat.md Outdated Show resolved Hide resolved
@nickvergessen
Copy link
Member

Screenshots

Moderator User
Bildschirmfoto von 2021-01-20 15-03-24 Bildschirmfoto von 2021-01-20 15-03-39

Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
@nickvergessen
Copy link
Member

Ah, conflict from #5019
Rebased

@PVince81
Copy link
Member

PVince81 commented Feb 2, 2021

All green! Merge for 21 or hold until the 22 split ?

@nickvergessen
Copy link
Member

/backport to stable21.1

@kinimodmeyer
Copy link

Note: in a one-to-one chat both users are in fact moderators

can we not change the condition to allow this only for moderator in group chats?
sounds not 100% right when i write a important message to a employe and he can just delete them if he wants.
in group chats ppl understand that there is a "moderator/admin" who could do this.

@PVince81
Copy link
Member

@kinimodmeyer please feel free to raise a new ticket for this request

@theoneandonly-vector
Copy link

"Currently limited to 6h old messages" is there a way to change this?

@marcoambrosini
Copy link
Member

@nickvergessen @jancborchardt should this be tweakable in the admin settings?

@nickvergessen
Copy link
Member

No

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow to delete chat messages
10 participants