gpt4 book ai didi

Android Smack 4.2 : "XMPPError: feature-not-implemented - cancel" (Error)

转载 作者:行者123 更新时间:2023-11-29 01:09:23 25 4
gpt4 key购买 nike

我正在尝试从 OpenFire 中检索 Archived Messages

请注意:

  1. 我已经添加了存档消息插件。
  2. 相同的代码在本地运行良好,openfire 的服务器安装没有抛出错误。
  3. 我已经尝试了互联网上提供的所有解决方案,但都没有成功。
  4. 我可以在 openfire 面板中看到存档的消息。

下面是检索消息的代码:

public MamManager.MamQueryResult getArchivedMessages() {
//org.jivesoftware.smack.XMPPException$XMPPErrorException: XMPPError: feature-not-implemented - cancel
try {
MamManager mamManager = MamManager.getInstanceFor(connection);
boolean isSupported = mamManager.isSupportedByServer();
if (isSupported) {
MamManager.MamQueryResult mamQueryResult = mamManager.pageAfter(JidCreate.from(mUsername + SERVICE_NAME), "2r2Vf-68", 250);
List<Forwarded> forwardedMessages = mamQueryResult.forwardedMessages;
Forwarded d = forwardedMessages.get(0);
}

} catch (Exception e) {
e.printStackTrace();
}
return null;
}

除此之外,我还尝试为 smack 4.2 实现 OfflineMessageManager

下面是离线管理器的代码:

   public static void handleOfflineMessages() throws Exception {
OfflineMessageManager offlineMessageManager = new OfflineMessageManager(getConnection());

if (!offlineMessageManager.supportsFlexibleRetrieval()) {
return;
}

if (offlineMessageManager.getMessageCount() == 0) {
String d = "ss";
} else {
List<Message> msgs = offlineMessageManager.getMessages();
for (Message msg : msgs) {
BareJid fullJid = msg.getFrom().asBareJid();
String messageBody = msg.getBody();
if (messageBody != null) {

}
}
// offlineMessageManager.deleteMessages();
}

}

Note : The above method is not throwing any error my I am always getting the message count = 0. where as I am following the official Doc for this. i.e not sending presence so as to get all offline messages. but failed to do so.

this is the link for official doc : OfflineMessageManager

谁能指出我做错了什么?

最佳答案

在 OF 的插件处重新加载 监控服务
这一切

关于Android Smack 4.2 : "XMPPError: feature-not-implemented - cancel" (Error),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44329230/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com