From 7be7e79c7837cef25e81aa16035b909db47168f9 Mon Sep 17 00:00:00 2001 From: Alex Bramley Date: Thu, 20 Oct 2011 00:23:54 +0100 Subject: [PATCH] Oops, missed a bit. --- state/tracker.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/state/tracker.go b/state/tracker.go index 77f9c55..8c8062f 100644 --- a/state/tracker.go +++ b/state/tracker.go @@ -72,9 +72,15 @@ func (st *stateTracker) GetNick(n string) *Nick { func (st *stateTracker) ReNick(old, neu string) { if nk, ok := st.nicks[old]; ok { if _, ok := st.nicks[neu]; !ok { - st.nicks[old] = nil, false nk.Nick = neu + st.nicks[old] = nil, false st.nicks[neu] = nk + for ch, _ := range nk.chans { + // We also need to update the lookup maps of all the channels + // the nick is on, to keep things in sync. + ch.lookup[old] = nil, false + ch.lookup[neu] = nk + } } else { logging.Warn("StateTracker.ReNick(): %s already exists.", neu) }