refactor: clean up encryption/decryption

This commit is contained in:
2025-03-07 17:43:15 -05:00
parent 14e3781e05
commit 73e7e17da4
2 changed files with 12 additions and 12 deletions

View File

@@ -24,12 +24,11 @@ impl CommandSource {
.chunks(if self.ncr_options.is_some() { 150 } else { 236 })
.map(|chars| chars.iter().collect::<String>())
{
if let (Some(options), Ok(encrypt)) = (
&self.ncr_options,
self.state.lua.globals().get::<Function>("ncr_encrypt"),
) && let Ok(encrypted) = encrypt.call::<String>((options, prepend_header(&chunk)))
if let Some(options) = &self.ncr_options
&& let Ok(encrypt) = self.state.lua.globals().get::<Function>("ncr_encrypt")
&& let Ok(ciphertext) = encrypt.call::<String>((options, prepend_header(&chunk)))
{
chunk = encrypted;
chunk = ciphertext;
}
self.client.chat(
&(if self.message.is_whisper()