如何让客户了解 Smack 中新的 HostedRoom?
我正在与 Openfire 和 Smack 合作,目前正在创建新的系统 MultiUserChat 房间。如何告诉客户端服务器上已创建(删除)了新的系统空间? (我需要客户修改他们的花名册)
I am working with Openfire and Smack, currently creating new system MultiUserChat rooms. How I tell clients that new system room had been created(deleted) on the server? (I need clients to modify their's Rosters)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是一个“挑战”。服务器不会向客户端发送消息来通知新房间 - 例如用户的状态消息。客户有责任探索服务(如“会议”)并寻找新房间。
因此,适用于所有可能客户的通用解决方案是行不通的。如果您自己开发客户端,则可以实现额外的通知服务。这需要实现一个 openfire 插件,该插件侦听“房间修改”事件并向您的客户端发送一条自定义消息,该消息将响应更新房间列表。
It's a 'challenge'. A server doesn't send a message to the clients to inform about new rooms - like the presence messages for users. It's the clients responsibility to explore the service (like 'conference') and look for new rooms.
So a general solution for all possible clients will not work. If you developed the client by yourself, you could implement an additional notification service. That would require implementing an openfire plugin, that listens to 'room modification' events and sends a custom message to your clients that will react with updating the room list.