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

Support for Message Moderation #82

Closed
Ppjet6 opened this issue Jan 29, 2023 · 21 comments · Fixed by #97
Closed

Support for Message Moderation #82

Ppjet6 opened this issue Jan 29, 2023 · 21 comments · Fixed by #97
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@Ppjet6
Copy link
Contributor

Ppjet6 commented Jan 29, 2023

Is your feature request related to a problem? Please describe.
When undesirable messages are sent to the channel, it can help being able to retract them.

Describe the solution you'd like
https://xmpp.org/extensions/xep-0425.html

Message moderation allows a moderator a room to retract messages so that they are not shown anymore on supporting clients. It also tells servers to tombstone them so they don't reappear when fetching history next time.

As a first step, implementing support in reading (retracting a message in local history when receiving the stanza, or showing the tombstone from the archive) would be enough for joinjabber's use case.

I don't think xmpp-web has a way to attach messages (reactions, replies, etc.) to other messages at the moment so I understand if the sending part is more complex.

Describe alternatives you've considered
I don't think there is many alternatives available. Spam messages clogging the chat for example are a pain to workaround, the only available way currently is to let it slide out of screen (after having kicked out the spammer).

@Ppjet6 Ppjet6 added the enhancement New feature or request label Jan 29, 2023
@nioc
Copy link
Owner

nioc commented Jan 29, 2023

Can you link me the XEP / XML message which notify client to remove some spam messages?
We can handle it to find and remove spam in store.

@Ppjet6
Copy link
Contributor Author

Ppjet6 commented Jan 29, 2023

There's a few things that could be improved in this spec, but it works ok..

A Moderated message is a retracted message (XEP-0424) sent by a moderator through MUC.

It requires Iqs to send the command to retract as a moderator, and then messages are broadcasted to participants, so messages with this payload shouldn't come directly from participants. Whenever you see such a payload, make sure the MUC actually advertises urn:xmpp:message-moderate:0 first.

A broadcast message looks like this: https://xmpp.org/extensions/xep-0425.html#usecase-success

And then from MAM you can also get such payloads as specified here: https://xmpp.org/extensions/xep-0425.html#tombstones.
You'll need to handle XEP-0424 as above of course, and also https://xmpp.org/extensions/xep-0421.html occupant-id.

Don't hesitate to join xmpp:jdev@muc.xmpp.org?join, I and other devs should be there to answer if you have any questions.

@nioc nioc modified the milestones: 0.9.7, 0.9.8, 0.9.9 Feb 1, 2023
@nioc
Copy link
Owner

nioc commented Feb 4, 2023

Hello, I do not know how to retract a message with my usual XMPP clients (Gajim 1.3.3 on laptop, Conversation 2.12 on Android).

It there some Prosody plugin required for client show an option?
By the way, I am thinking to put some "reproducing environments" in the repo which includes docker-compose.yml and server config files. I will probably ask for your assistance to check/complete the pull request.

Without testing, I can not implement it... 😞

@nioc nioc added the question Further information is requested label Feb 4, 2023
@nioc nioc removed this from the 0.9.9 milestone Feb 4, 2023
@nioc
Copy link
Owner

nioc commented Feb 6, 2023

As I explained earlier, it would help me if you could provide the associated Prosody setup in #89.

@nioc nioc added the need repro This issue requires a specific setup to reproduce it label Feb 6, 2023
@github-actions
Copy link

github-actions bot commented Feb 8, 2023

This issue will be closed within two weeks if the requested reproduction data is not provided. Please refer to this guide.

@github-actions github-actions bot added the stale This could be dismissed soon label Feb 8, 2023
@nioc nioc added the help wanted Extra attention is needed label Feb 10, 2023
@github-actions github-actions bot removed the stale This could be dismissed soon label Feb 10, 2023
@Ppjet6
Copy link
Contributor Author

Ppjet6 commented Feb 12, 2023

prosody-moderation.tar.gz

I hope I did it as you expect. I basically pulled the mod_muc_moderation module and added it to the MUC's modules_enabled.

@nioc
Copy link
Owner

nioc commented Feb 12, 2023

Thanks a lot for this!

I will try to reproduce today. Does Gajim has the moderation function?

@Ppjet6
Copy link
Contributor Author

Ppjet6 commented Feb 12, 2023

It looks like Gajim, Conversejs, Pade and poezio (sending only) have support for this feature.

@nioc
Copy link
Owner

nioc commented Feb 12, 2023

I am a noob in thins kind of stuff and I do not find any option in Gajim to retract a message.

Here are the XMPP server functionalities see through Gajim (1.3.3):

image

I have try the room history, then history manager and delete message... but it seems to delete only on Gajim local database (I did not see anything in the websocket, neither in Prosody logs) 😞
image

image

Can you give me the procedure to retract a message in a room?

@nioc
Copy link
Owner

nioc commented Feb 12, 2023

Okay… I need to update Gajim to 1.4

Both server and client have to support this standard, and you have to be Moderator/Admin/Owner in order to be able to retract messages. Gajim 1.4 will support message moderation in both ways: by offering moderation actions for messages, and by displaying a disclaimer for message which have been moderated.

https://gajim.org/post/2021-11-29-development-news-november/

@Ppjet6
Copy link
Contributor Author

Ppjet6 commented Feb 12, 2023

If you're using Debian, there's 1.5.1 available in bullseye-backports, otherwise 1.7.1 is available on the upstream repository

@nioc
Copy link
Owner

nioc commented Feb 12, 2023

Nop Ubuntu (to get newer packages 😆).
But I move to Gajim nightly, it is fine.

@nioc
Copy link
Owner

nioc commented Feb 12, 2023

Here we are, does this UX sound good to you?
image

I was wondering if I should hide the message, but the user may wonder why his message disappeared, so reducing opacity should be better, your opinion?

@nioc
Copy link
Owner

nioc commented Feb 12, 2023

Also another question @Ppjet6, I understand that this only applies to MUC, can you confirm? I would like to use Jid resource instead of the full Jid.

@nioc nioc self-assigned this Feb 12, 2023
@nioc nioc added this to the 0.9.12 milestone Feb 12, 2023
@Ppjet6
Copy link
Contributor Author

Ppjet6 commented Feb 12, 2023

I think leaving a trail that there was a message here is good. And yes I was going to say, I would just use the nickname (resource) and not the fulljid.

The spec uses "retract" as the verb, I'm not saying it's not possible to use anything else but maybe it makes sense to keep the same terminology here? I don't know what other clients do.

@nioc
Copy link
Owner

nioc commented Feb 12, 2023

For the wording, I think Retracted is not clear for non RFC-XEP-expert users.
If Removed is not ok, I suggest Moderated.

@Ppjet6
Copy link
Contributor Author

Ppjet6 commented Feb 12, 2023

Ok, both are fine with me. moderated may be more obvious?

@nioc
Copy link
Owner

nioc commented Feb 12, 2023

Yep. New proposal:

`Moderated by ${nick} (${reason})`

With a red icon at bottom.

image

@Ppjet6
Copy link
Contributor Author

Ppjet6 commented Feb 12, 2023

The spec isn't explicit about the reason, but I would say it's optional. I would find it weird not to. I've asked around.

@nioc
Copy link
Owner

nioc commented Feb 12, 2023

I pushed in a branch, so you can review and tell me in the pull request if something is wrong.
I will add a few comments to highlight the key points.

@nioc nioc closed this as completed in #97 Feb 13, 2023
nioc added a commit that referenced this issue Feb 13, 2023
@nioc nioc removed help wanted Extra attention is needed need repro This issue requires a specific setup to reproduce it question Further information is requested labels Feb 13, 2023
@Ppjet6
Copy link
Contributor Author

Ppjet6 commented Feb 13, 2023

https://mail.jabber.org/pipermail/standards/2023-February/039164.html

Just so you know, this is a thing, and it's possible things change. I'll keep you updated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants