Smack MamManager在获取存档消息时抛出异常

时间:2017-08-02 09:09:06

标签: java android chat openfire smack

我正在尝试使用this文档

中所述的以下代码获取存档消息
try {
            MamManager mamManager = MamManager.getInstanceFor(connection);
            boolean isSupported = mamManager.isSupportedByServer();
            if (isSupported) {
                MamManager.MamQueryResult mamQueryResult = mamManager.queryArchive(500);
                List<Forwarded> forwardedMessages = mamQueryResult.forwardedMessages;
                Forwarded d = forwardedMessages.get(0);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }

但它正在执行org.jivesoftware.smack.XMPPException$XMPPErrorException: XMPPError: feature-not-implemented - cancel函数时抛出queryArchive()异常。有谁知道如何解决这个问题?任何帮助将不胜感激。

1 个答案:

答案 0 :(得分:0)

将openfire服务器更新到最新版本(4.1.5)后,此问题现已解决