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

When I purge a chat message, the whole chat gets reset #7

Closed
chrisyroid opened this issue Jan 26, 2022 · 1 comment
Closed

When I purge a chat message, the whole chat gets reset #7

chrisyroid opened this issue Jan 26, 2022 · 1 comment

Comments

@chrisyroid
Copy link

chrisyroid commented Jan 26, 2022

First of all, great work. I'm having a problem though with the chat box getting cleared completely when I purge a message.

The problem seems to be:

if (obj.detail.command === "CLEARCHAT") { $('#log').empty(); }

Which completely deletes the chat instead of purging an individual message.

@jhoooooo
Copy link
Owner

jhoooooo commented Jan 30, 2022

Hello.

Never notice that both /clear and /timeout uses same command id. I will update the themes later during Chinese New Year holidays.

This code should fix the issue. Will test further as I update the themes.

if (obj.detail.command === "CLEARCHAT" && typeof obj.detail.tags["ban-duration"] == "undefined") {
        $('#log').empty();
    }

Edit: Wait this does not fix all issues. Will try to find other solution.
Edit 2: This should fix it, I think ??

if (obj.detail.command === "CLEARCHAT" && typeof obj.detail.tags["ban-duration"] == "undefined" && typeof obj.detail.body == "undefined") {
        $('#log').empty();
    }

Edit 3: Doesn't need ban duration.

if (obj.detail.command === "CLEARCHAT" && typeof obj.detail.body == "undefined") {
        $('#log').empty();
    }

@jhoooooo jhoooooo pinned this issue Jan 30, 2022
@jhoooooo jhoooooo closed this as completed Feb 2, 2022
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

No branches or pull requests

2 participants