feat(paroxysm): don't print error messages for question marks

If someone sends a message containing just question marks / spaces,
provided it has 2 question marks before it, paroxysm would attempt to
fetch an entry for the remainder of the question marks, and usually
fail. This fixes that oversight, and silences the "never heard of it"
message in such cases.

Joke entries created for such question mark cases will still fire,
though.

Change-Id: I44ef823a55c32869ab5f47ffc733ea566e23bb41
Reviewed-on: https://cl.tvl.fyi/c/depot/+/3161
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
Reviewed-by: grfn <grfn@gws.fyi>
Reviewed-by: tazjin <mail@tazj.in>
Reviewed-by: cynthia <cynthia@tvl.fyi>
This commit is contained in:
eta 2021-05-27 00:38:58 +01:00
parent 7c16a71156
commit 4286574b3b

View file

@ -301,8 +301,12 @@ impl App {
}
}
None => {
self.client
.send_notice(target, format!("\x02{}\x0f: never heard of it", subj))?;
// If someone just posts "??????????", don't spam the channel with
// an error message (but do allow joke entries to appear if set).
if !subj.chars().all(|c| c == '?' || c == ' ') {
self.client
.send_notice(target, format!("\x02{}\x0f: never heard of it", subj))?;
}
}
}
Ok(())