this fix was stupidly missing yesterday.

This commit is contained in:
fiatjaf
2024-08-14 08:29:28 -03:00
parent 753a1191b9
commit 5ae4d1194a

View File

@@ -87,7 +87,7 @@ func (rl *Relay) removeListenerId(ws *WebSocket, id string) {
// so its .index reflects its new position on srl.listeners
movedSpecs := rl.clients[moved.ws]
idx := slices.IndexFunc(movedSpecs, func(ls listenerSpec) bool {
return ls.index == movedFromIndex
return ls.index == movedFromIndex && ls.subrelay == srl
})
movedSpecs[idx].index = spec.index
rl.clients[moved.ws] = movedSpecs