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

Deletion of messages after banning the author is not being reflected #48

Closed
hwanders opened this issue Jan 11, 2022 · 6 comments · Fixed by #76
Closed

Deletion of messages after banning the author is not being reflected #48

hwanders opened this issue Jan 11, 2022 · 6 comments · Fixed by #76
Assignees
Labels
help wanted Extra attention is needed high priority

Comments

@hwanders
Copy link

When a user first gets banned and then their message gets deleted, the chat view does update accordingly: the deleted message persists.

Expected behavior

A deleted message should be removed from the chat view, even if its author has been banned before.

Additional info

According to @BenDMyers, first deleting the message (and then banning the user) works fine.
Observed during maxcellw's twitch stream.

@BenDMyers
Copy link
Owner

What makes this tricky is, from what I can tell, banning a commenter for their message within Twitch doesn't seem to fire the onMessageDeleted event (or maybe it does and there's an error somewhere?)

Anyways, if there's any way to delete the message when the user is banned, we should do so, as it breaks users' assumption that "deleting" the message will delete it in the overlay view, too.

@KenAKAFrosty
Copy link
Contributor

I'll have to see what Comfy exposes to us but I'm fairly sure Twitch's API provides ban events (on mobile currently or I'd check for certain). If we listen for that event and then remove all messages with a matching sender, that should suffice, no?

@KenAKAFrosty
Copy link
Contributor

Looked closer at Comfy. I have a hunch we could check onPart event for user metadata, since banning would force them to leave. There may be some sort of boolean flag on the user for 'banned' or similar? Then if so, delete all messages with a matching sender username

@BenDMyers
Copy link
Owner

I think this issue (still open, at time of writing) on the ComfyJS repo could be helpful: instafluff/ComfyJS#23 — it seems like the tmi.js client does expose a 'ban' event, but ComfyJS isn't yet consuming it.

I think maybe the best path forward for this issue could be contributing an onBan hook to ComfyJS that we could leverage here?

@KenAKAFrosty
Copy link
Contributor

KenAKAFrosty commented Jan 12, 2022 via email

@BenDMyers BenDMyers added the help wanted Extra attention is needed label Jan 15, 2022
@BenDMyers
Copy link
Owner

@KenAKAFrosty Would you be able to look into adding the onBan hook upstream in ComfyJS?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed high priority
Projects
None yet
3 participants