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

Validity checks #4

Closed
2 tasks done
deavmi opened this issue Nov 6, 2022 · 10 comments · Fixed by #32
Closed
2 tasks done

Validity checks #4

deavmi opened this issue Nov 6, 2022 · 10 comments · Fixed by #32
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@deavmi
Copy link
Owner

deavmi commented Nov 6, 2022

textPass(ref string)

We should add two modes:

  • Hardcore mode
    • Throws an exception on invalid message
  • Easy mode
    • This will fix up messages for you and send them

Invalid can mean containing a CR or LF basically. So this would be an easy check.

What about Message's encode()?

Currently it does the same but on error throws an exception. Are we sure we want that behaviour?

@deavmi deavmi added bug Something isn't working enhancement New feature or request labels Nov 6, 2022
@deavmi deavmi self-assigned this Nov 6, 2022
@deavmi
Copy link
Owner Author

deavmi commented Jun 17, 2023

Look at:

  • Strip any \n in messages sent and \r

@deavmi deavmi mentioned this issue Jun 21, 2023
@deavmi deavmi linked a pull request Jun 30, 2023 that will close this issue
@deavmi
Copy link
Owner Author

deavmi commented Jul 4, 2023

Been working on this now today and last few days.

@deavmi
Copy link
Owner Author

deavmi commented Jul 4, 2023

Leaving it running on Contabo to see how it fairs - doubt there are any bugs :)

@deavmi
Copy link
Owner Author

deavmi commented Jul 5, 2023

Gonna continue watching.

Only disconnects I had was a misconfigured release hook being handled by gitea-irc-bot's /commit handler causing it to crash and therefore birchwood IRCBot to exit. So not birchwood related....

@deavmi
Copy link
Owner Author

deavmi commented Jul 6, 2023

Added some unit tests

@deavmi
Copy link
Owner Author

deavmi commented Jul 6, 2023

Gonna continue watching.

Only disconnects I had was a misconfigured release hook being handled by gitea-irc-bot's /commit handler causing it to crash and therefore birchwood IRCBot to exit. So not birchwood related....

This seems fine ✔️

Honestly, a better test is with botty - so I will test with that tonight

@deavmi
Copy link
Owner Author

deavmi commented Jul 6, 2023

I have confirmed it works with botty and does strip ✔️

@deavmi
Copy link
Owner Author

deavmi commented Jul 6, 2023

Going to finish up and merge soon

@deavmi
Copy link
Owner Author

deavmi commented Jul 6, 2023

Added unit tests to test ChecksMode.EASY and ChecksMode.HARDCORE at the Message-level.

ChecksMode.EASY is confirmed at the Client level via Botty's stripping. I haven't tested the ChecksMode.HARDCORE in this case but it isn't default so it is fine and also, it probably works. Will add a test for it here.

@deavmi
Copy link
Owner Author

deavmi commented Jul 6, 2023

Okay, merging this now.

@deavmi deavmi closed this as completed Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant