From c27708bb9bfdbdf1e9555eecf43763e536fb51fe Mon Sep 17 00:00:00 2001 From: mappu Date: Mon, 4 Jun 2018 19:17:14 +1200 Subject: [PATCH] suppress log messages for system-messages-from-hub --- NTFServer.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/NTFServer.go b/NTFServer.go index c56062a..5963ded 100644 --- a/NTFServer.go +++ b/NTFServer.go @@ -287,9 +287,14 @@ func (this *NTFServer) HandleHubMessage(msg upstreamMessage) { switch msg.evt.EventType { - case libnmdc.EVENT_SYSTEM_MESSAGE_FROM_CONN, libnmdc.EVENT_CONNECTION_STATE_CHANGED: + case libnmdc.EVENT_SYSTEM_MESSAGE_FROM_CONN, libnmdc.EVENT_SYSTEM_MESSAGE_FROM_HUB: + // This includes "want to register your nick?" and chat-catchup messages + // Don't mirror them into telegram log.Printf("Hub(%s): * %s", msg.hubNick, msg.evt.Message) + case libnmdc.EVENT_CONNECTION_STATE_CHANGED: + log.Printf("Hub(%s): * Connection %s", msg.evt.StateChange.String()) + case libnmdc.EVENT_PRIVATE: err := this.DirectMessageTelegramUser(msg.telegramUserId, fmt.Sprintf("PM from user '%s': %s", msg.evt.Nick, msg.evt.Message)) if err != nil {