kangarko / ChatControl-Red

Issue tracker and documentation for the next generation ChatControl Red, the most advanced chat management plugin.
44 stars 22 forks source link

Suggestion: If formatting for sender's message will be fully empty, do not even send empty line to users #2572

Closed TheJoshue closed 5 months ago

TheJoshue commented 5 months ago

Summary

So basically i have conditions that if some player do not have permission (sender), checked for every format part, it will not send it

However what happens is that it does send fully empty line to users when player tries to talk, can you make possible to check if empty line will be sent to cancel/return event? Thanks.

What would happen if we didn't implement this feature? Why not having this feature is a problem?

image This will be solved (empty line is actually a user's message who does not met sender conditions for every part)

kangarko commented 5 months ago

Hey! This is not the intended way to use formats for chat, you would need to have a message to be formatted or rework your formats in a different way.

TheJoshue commented 5 months ago

Hey! This is not the intended way to use formats for chat, you would need to have a message to be formatted or rework your formats in a different way.

Man, i really need this, i already asked you for /exclude command and you told me that it won't be implemented to not cram up things codewise which i perfectly understand Now i managed to do it (almost...), i only need to not even send empty message if all format parts are "" (nothing, not even space, empty) is empty, what is this hurting performance if you add i really don't understand...

To be clear what i am talking about, it is at https://github.com/kangarko/ChatControl-Red/issues/2497 (i know it is still open but i doubt anyone would create addon for closed source plugin, and this is SO small thing that as i said managed to do it via chat formatting and conditions, i only need sender placeholder which you mentioned in other github issue that you'll add, and this - to not send message if it is empty)

And just to not be someone who only wants this, i can share my formats and conditions and show you how i managed to do it, sharing it publicly so anyone who uses CHCRED can use it; of course if/after this gets implemented aswell as sender placeholder.

I really hope you'll rethink.....

kangarko commented 5 months ago

Thanks, implemented.

I have responded to the other suggestion with a possible solution.

TheJoshue commented 5 months ago

Thanks, implemented.

Thank you so much! I am glad you actually listen when something reasonable is suggested, i will test if all parts are empty does it not send and let know if there are any issues, very thanks

I have responded to the other suggestion with a possible solution.

Sorry, i cannot see anywhere, where is that? i checked all responses from you, couldn't find what you're talking about; at which gh-issue at least?

TheJoshue commented 5 months ago

@kangarko just wanted to tell you that i think something is broken.

I think you should recheck code and latest changes you did to formats and conditions you can try any chat format but make sure to have condition (receiver/sender condition) to first part in the list for that format, and try to send message - it won't send anything But if the first part doesn't have any conditions, it simply sends some message, everything after that part even with conditions - sometimes send sometimes not

Something has happened, i am far less experienced than you but my guess would be that you checked if the part is empty and not the whole format / you checked if the format is empty somewhere in the middle while building format from parts rather than checking if it is empty in the end? Not sure how helpful this is, but i am sure something has gone wrong in this latest 10.24.4 because it worked correctly on previous version.

TheJoshue commented 5 months ago

I downgraded to 10.24.3 and it works correctly, i can confirm; will wait for your investigation.

kangarko commented 4 months ago

Can you send me the format .yml file that appears broken?

TheJoshue commented 4 months ago

Ok here it is @kangarko

First apply this and reload plugin

New_Line_Per_Part: false
Parts:
  test_part0:
    Message: 'test_part0 '
  test_part1:
    Receiver_Condition: '"{player_name}" == "{player_name}"'
    Message: 'test_part1 '
  test_part2:
    Message: 'test_part2 '

it should output this: image

After you do this, please modify this file i provided you to match this (comment out test_part0 and test_part2)

New_Line_Per_Part: false
Parts:
  #test_part0:
  #  Message: 'test_part0 '
  test_part1:
    Receiver_Condition: '"{player_name}" == "{player_name}"'
    Message: 'test_part1 '
  #test_part2:
  #  Message: 'test_part2 '

And now try sending a message - it will not send at all

kangarko commented 4 months ago

Thanks, will be fixed in the next version.

TheJoshue commented 4 months ago

Can confirm it is working correctly in CHCRED-10.24.5. Many thanks again!

I'll reply if there are any issues after more thorough usage.