From 40ee5e8405753191d0be8ba6f768a9a45001e21c Mon Sep 17 00:00:00 2001 From: delthas Date: Fri, 1 May 2020 19:03:34 +0200 Subject: [PATCH] Fix not properly marshaling self in single-server mode In single-server mode, we don't need to add a /network suffix when marshaling, but we still need to replace our nick with the downstream nick. --- downstream.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/downstream.go b/downstream.go index 46573c0..10a12be 100644 --- a/downstream.go +++ b/downstream.go @@ -155,15 +155,15 @@ func isOurNick(net *network, nick string) bool { // This involves adding a "/" suffix if the entity isn't the current // user. func (dc *downstreamConn) marshalEntity(net *network, name string) string { + if isOurNick(net, name) { + return dc.nick + } if dc.network != nil { if dc.network != net { panic("soju: tried to marshal an entity for another network") } return name } - if isOurNick(net, name) { - return dc.nick - } return name + "/" + net.GetName() }