From 07fc5bd7faddb661e14c6ca20332bd0b66dd1c37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Tempel?= Date: Mon, 10 Dec 2018 16:56:11 +0100 Subject: [PATCH] getSourceDirs: Don't always return empty list for own user Otherwise changes of ones own nick are not displayed in the appropriate channels. Therefore: Only return an empty list if the user didn't join any channels yet. See also: https://github.com/lrstanley/girc/pull/27 --- hii.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hii.go b/hii.go index de1761b..8b023d0 100644 --- a/hii.go +++ b/hii.go @@ -247,12 +247,14 @@ func getCmdChan(event *girc.Event) (string, bool) { func getSourceDirs(client *girc.Client, event *girc.Event) ([]*string, error) { var names []*string - if event.Source == nil || event.Source.Name == client.GetNick() { + if event.Source == nil { return names, nil } user := client.LookupUser(event.Source.Name) - if user == nil { + if user == nil && client.GetNick() == event.Source.Name { + return names, nil // User didn't join any channels yet + } else if user == nil { return names, fmt.Errorf("user %q doesn't exist", event.Source.Name) }