Add #nospoil for meme recommendations too. - annna - Annna the nice friendly bot.
(HTM) git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/annna/
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) Tags
(DIR) README
---
(DIR) commit a7dc3fb90b903fbb957e7703dc77d2949136bf4f
(DIR) parent 4b583d53ce3cd21fccac56b51ef102e72c1709f8
(HTM) Author: Annna Robert-Houdin <annna@bitreich.org>
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(-)
---
(DIR) 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 if unknown
# 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}" ];