From 2cf4e5cc273202b82b06dc0479c9dfcd54dd2d74 Mon Sep 17 00:00:00 2001 From: Noah Petherbridge Date: Sat, 25 Nov 2023 18:36:38 -0800 Subject: [PATCH] Logging bugfix --- pkg/handlers.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/handlers.go b/pkg/handlers.go index 29757f0..849cb62 100644 --- a/pkg/handlers.go +++ b/pkg/handlers.go @@ -221,7 +221,11 @@ func (s *Server) OnMessage(sub *Subscriber, msg messages.Message) { } // Log this conversation? - if IsLoggingUsername(sub) { + if IsLoggingUsername(sub) && IsLoggingUsername(rcpt) { + // Both sides are logged, copy it to both logs. + LogMessage(sub, rcpt.Username, sub.Username, msg) + LogMessage(rcpt, sub.Username, sub.Username, msg) + } else if IsLoggingUsername(sub) { // The sender of this message is being logged. LogMessage(sub, rcpt.Username, sub.Username, msg) } else if IsLoggingUsername(rcpt) {