mirror of https://github.com/fluffle/goirc
Oops, missed a bit.
This commit is contained in:
parent
111a23d87c
commit
7be7e79c78
|
@ -72,9 +72,15 @@ func (st *stateTracker) GetNick(n string) *Nick {
|
||||||
func (st *stateTracker) ReNick(old, neu string) {
|
func (st *stateTracker) ReNick(old, neu string) {
|
||||||
if nk, ok := st.nicks[old]; ok {
|
if nk, ok := st.nicks[old]; ok {
|
||||||
if _, ok := st.nicks[neu]; !ok {
|
if _, ok := st.nicks[neu]; !ok {
|
||||||
st.nicks[old] = nil, false
|
|
||||||
nk.Nick = neu
|
nk.Nick = neu
|
||||||
|
st.nicks[old] = nil, false
|
||||||
st.nicks[neu] = nk
|
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 {
|
} else {
|
||||||
logging.Warn("StateTracker.ReNick(): %s already exists.", neu)
|
logging.Warn("StateTracker.ReNick(): %s already exists.", neu)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue