From baadfbfb57edd0aac28fcf3e77b198cf696e3ce4 Mon Sep 17 00:00:00 2001 From: Andy Spencer Date: Mon, 11 Jun 2012 01:04:41 +0000 Subject: [PATCH] fix up commands --- email.awk | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/email.awk b/email.awk index a417f9e..5aab62f 100644 --- a/email.awk +++ b/email.awk @@ -70,22 +70,43 @@ function mail_run( user, chan, ready, time) } FROM ~ OWNER && +TO == NICK && /^e?mail .* .*/ { reply("notifying " $2 " for " $3) mail_enable[$3] = $2 } +TO == NICK && /^e?mail *[^ ]*$/ { - reply("notifying " $2 " for " FROM) - mail_enable[FROM] = $2 + _user = FROM + _addr = $2 + gsub(/[^a-zA-Z0-9_+@.-]/, "", _user) + gsub(/[^a-zA-Z0-9_+@.-]/, "", _addr) + reply("notifying " _addr " for " _user) + mail_enable[_user] = _addr } +FROM ~ OWNER && +TO == NICK && +/^stfu .*/ { + reply("well fine then") + delete mail_enable[$2] + delete mail_ready[$2] +} + +TO == NICK && /^stfu$/ { reply("well fine then") delete mail_enable[FROM] delete mail_ready[FROM] } +TO == NICK && +/^who/ { + for (_user in mail_enable) + reply("\"" _user "\" <" mail_enable[_user] ">") +} + DST ~ /^#.*/ { for (_user in mail_enable) if ($0 ~ "\\<"_user"\\>") { -- 2.43.2