ref: a7dfe72ff378acbfc6522726f513cf1eda6df5c1 cheogram-muc-bridge/Session.hs -rw-r--r-- 5.8 KiB
Fix <<loop>> caused by accidental name shadowing
Detect presence from ghost using custom element

Instead of trying to "remember" who is a ghost based on fragile things like
which nick we asked for, which is subject to race conditions in the case of
rewriting, etc, just send an extra presence payload for a ghost that only we
generate and detect it on inbound.

This will only work if the MUC remembers the actual presence stanza it got and
sends that for all future presences from a member, which the spec doesn't seem
to specifically require, but implementations do (and need to, for things like
avatars to work).
Don't leave if just renaming
Keep knowledge of a ghost as long as possible

INSERT the ghost before we actually join them to the room. Only DELETE them
after we get the self-presence about them leaving.

Do not INSERT and join when we get presence errors or presence unavaiable!
If a ghost has leaked through, remove it
Allow specifying nickLength for a MUC
Custom tag per source and nick char filter for target
Detect ghost presence from DB instead of by looking for tag in nick
Remove stale nicks that are no longer present on other side after restart
Replace mentioned nicks with their ghost equivalent