From c985b88559017d219c10dfa3d5f8b074cdd5c0f1 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Mon, 6 Apr 2020 18:45:30 +0200 Subject: [PATCH] Fix NOTICE log formatting ZNC uses hyphens instead of angle brackets [1]. [1]: https://github.com/znc/znc/blob/82c4ad8362c6b2f4406770c54a5e10a40fdba548/modules/log.cpp#L495 --- logger.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/logger.go b/logger.go index 3b4fd54..b6504e6 100644 --- a/logger.go +++ b/logger.go @@ -102,7 +102,9 @@ func formatMessage(msg *irc.Message) string { return fmt.Sprintf("*** Quits: %s (%s@%s) (%s)", msg.Prefix.Name, msg.Prefix.User, msg.Prefix.Host, reason) case "MODE": return fmt.Sprintf("*** %s sets mode: %s", msg.Prefix.Name, strings.Join(msg.Params[1:], " ")) - case "PRIVMSG", "NOTICE": + case "NOTICE": + return fmt.Sprintf("-%s- %s", msg.Prefix.Name, msg.Params[1]) + case "PRIVMSG": return fmt.Sprintf("<%s> %s", msg.Prefix.Name, msg.Params[1]) default: return ""