From d2044c647b2e57ec5d5a7684177cf5e2e3325714 Mon Sep 17 00:00:00 2001 From: Wim Date: Thu, 3 Jan 2019 00:07:50 +0100 Subject: Update vendor * go-telegram-bot-api/telegram-bot-api * lrstanley/girc * matterbridge/gomatrix --- vendor/github.com/lrstanley/girc/event.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'vendor/github.com/lrstanley/girc/event.go') diff --git a/vendor/github.com/lrstanley/girc/event.go b/vendor/github.com/lrstanley/girc/event.go index 0b40b40b..69f82148 100644 --- a/vendor/github.com/lrstanley/girc/event.go +++ b/vendor/github.com/lrstanley/girc/event.go @@ -516,7 +516,8 @@ const ( // Source represents the sender of an IRC event, see RFC1459 section 2.3.1. // | [ '!' ] [ '@' ] type Source struct { - // Name is the nickname, server name, or service name. + // Name is the nickname, server name, or service name, in its original + // non-rfc1459 form. Name string `json:"name"` // Ident is commonly known as the "user". Ident string `json:"ident"` @@ -525,6 +526,12 @@ type Source struct { Host string `json:"host"` } +// ID is the nickname, server name, or service name, in it's converted +// and comparable) form. +func (s *Source) ID() string { + return ToRFC1459(s.Name) +} + // Equals compares two Sources for equality. func (s *Source) Equals(ss *Source) bool { if s == nil && ss == nil { @@ -533,7 +540,7 @@ func (s *Source) Equals(ss *Source) bool { if s != nil && ss == nil || s == nil && ss != nil { return false } - if s.Name != ss.Name || s.Ident != ss.Ident || s.Host != ss.Host { + if s.ID() != ss.ID() || s.Ident != ss.Ident || s.Host != ss.Host { return false } return true -- cgit v1.2.3