XMPPFramework - 获取重复消息
我正在使用适用于 iOS 的 XMPPFramework。
我的问题是,当我加入一个房间,然后离开它,然后再次加入它时,我会收到来自该房间的消息,或者该房间内的私人消息两次,如果我离开它并再次加入它,我会收到 3 次,依此类推。
有人告诉我,我可能会注册多个代表而不是删除它们,但如果我这样做,我就是不小心这样做了,而且我不太确定这是在哪里发生的。 谁能帮忙看看这是哪里发生的吗?也许一个例子可以帮助我在代码中找到它。
谢谢。
I'm using the XMPPFramework for iOS.
My problem is that when I join a room, then leave it, and join it again I get messages from that room, or private messages within that room twice, If I leave it and join it again I receive then 3 times, and so on.
I've been told that I might be registering multiple delegates and not removing them, but If I'm doing that I'm doing it accidentally and I'm not really sure where is this happening.
Could anyone help finding where is this happening? Maybe an example would help me finding it in my code.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
以防万一有人想知道。
离开房间的正确方法是执行这组函数:
Just in case someone likes to know.
The right way to leave a room is to do this set of functions:
我认为 RemoteTimestamp 值有问题。我通过在文件中添加解决方法解决了该问题:
Extensions/XEP-0045/CoreDataStorage/XMPPRoomCoreDataStorage.m
之前:
之后:
I thing there is a problem with remoteTimestamp value. I solve the problem by add workaround in file:
Extensions/XEP-0045/CoreDataStorage/XMPPRoomCoreDataStorage.m
before:
after: