Add #nospoil for meme recommendations too. - annna - Annna the nice friendly bo… | |
git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws6… | |
Log | |
Files | |
Refs | |
Tags | |
README | |
--- | |
commit a7dc3fb90b903fbb957e7703dc77d2949136bf4f | |
parent 4b583d53ce3cd21fccac56b51ef102e72c1709f8 | |
Author: Annna Robert-Houdin <[email protected]> | |
Date: Mon, 8 Aug 2022 19:59:14 +0200 | |
Add #nospoil for meme recommendations too. | |
Diffstat: | |
M annna-message-common | 4 +++- | |
1 file changed, 3 insertions(+), 1 deletion(-) | |
--- | |
diff --git a/annna-message-common b/annna-message-common | |
@@ -34,8 +34,10 @@ regeximatch() { | |
[ "$user" = "${ircuser}" ] && exit 0 | |
uriexpansion=0 | |
+nospoil=0 | |
case "${text}" in | |
*\#nospoil*) | |
+ nospoil=1 | |
;; | |
*::*::*) | |
query=${text#**::} query=${query%%::*} | |
@@ -1094,7 +1096,7 @@ do | |
# Do not recommend memes in case we got some URI expansion and… | |
# tag is less than four utf8 chars long. | |
taglength=$(utf8expr length "${tag}") | |
- if [ $uriexpansion -eq 0 -a $taglength -gt 3 ]; | |
+ if [ $uriexpansion -eq 0 -a $taglength -gt 3 -a $nospoil -eq 0… | |
then | |
didyoumean="$(annna-meme-recommend "${tag}")" | |
if [ -n "${didyoumean}" ]; |