On joining a cluster, generate appropriate join presences to reconcile the MUC participant visibility
When a node is temporarily disconnected from a cluster, the state of MUC membership local to any node will have been reconciled according to reachability and leave presences sent (see OF-2229, OF-2230).
On rejoining the cluster (or joining for the first time) caches will be updated (dealt with in another task) that reconciles the cluster’s view of who is in the room. Join presences need to be sent so that all participants share that full list of occupants.
Join presences for all MUC participants on both sides need to be sent across the “join boundary” between the joining node. That is to say, if a 3rd node joins a cluster, then all occupants on the first 2 nodes require a join presence from all occupants on the 3rd AND all occupants on the 3rd node need a join presence from all occupants on the first 2 nodes.
Any user receiving a duplicate join presence for another occupant that they already regard as “present” should be avoided.
This could be the responsibility of the joining node:
Broadcast a join presence for all local users to all other nodes in the cluster
Iterate the clustered cache to get list of non-node-local occupants and broadcast join presence for each to local node only
Alternatively, this could be the responsibility of all nodes
Joining node broadcasts a join presence for all local users to all other nodes in the cluster
Existing nodes broadcast a join presence for their local users to the joining node