我创建了一个基于openfire的Messenger。我可以连接并设置在线/离线状态,并且 openfire 控制台也会更改,但我的其他设备有问题。
其他设备(其他用户)获取有关更改我的状态的信息,并且这些信息对他们可见。
我的设备(同一用户的第二台和第三台设备)没有看到状态更改,并且全部都在线。如果我登录到第四台设备,信息会发送到我在线的其他设备(其他用户),尽管我在第一台设备上的状态仍然设置为离开。
是否有任何插件可以允许更新给定用户的所有设备上的状态?
最佳答案
这应该由服务器按照 Server Processing of Outbound Initial Presence 完成
The user's server MUST also broadcast initial presence from the user's newly available resource to all of the user's available resources, including the resource that generated the presence notification in the first place (i.e., an entity is implicitly subscribed to its own presence).
因此,每次您连接自己的设备(即相同的用户名/JID)并发送状态时,您的服务器都必须将该状态广播到所有已连接的设备(相同的 JID)。
看起来有类似的问题报告 OF-454Openfire does not send user presence information to all resources of the user但它被标记为已修复:修复版本:4.0.0
如果您使用集群,请确保您的节点可以正常通信。
关于java - 如何更改所有设备的用户 session 状态(离开、dnd 等),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55849000/