XMPPFramework 服务器功能

XMPPFramework server feature

我正在尝试获取服务器功能,XMPP 配置为:

 _xmppCapabilitiesStorage = [XMPPCapabilitiesCoreDataStorage sharedInstance];
_xmppCapabilities = [[XMPPCapabilities alloc] initWithCapabilitiesStorage:_xmppCapabilitiesStorage];
_xmppCapabilities.autoFetchMyServerCapabilities = YES;

日志说:

SEND: 
<?xml version="1.0" encoding="utf-8"?>
<iq type="get" to="myserver.im" id="4FE37B35-8078-41B0-BCAF-DC6CFF04DD33">
    <query xmlns="http://jabber.org/protocol/disco#info"/>
</iq>

收到:

<?xml version="1.0" encoding="utf-8"?>
<iq xmlns="jabber:client" type="result" id="4FE37B35-8078-41B0-BCAF-DC6CFF04DD33" from="myserver.im" to="3471@myserver.im/MyChatClient">
    <query xmlns="http://jabber.org/protocol/disco#info">
        <identity category="account" type="registered"/>
        <identity category="pubsub" type="pep"/>
        <feature var="http://jabber.org/protocol/pubsub#retrieve-default"/>
        <feature var="urn:myserver:im:groupchat#sync"/>
        <feature var="http://jabber.org/protocol/pubsub#purge-nodes"/>
        <feature var="vcard-temp"/>
        <feature var="http://jabber.org/protocol/pubsub#subscribe"/>
        <feature var="http://jabber.org/protocol/pubsub#subscription-options"/>
        <feature var="http://jabber.org/protocol/pubsub#create-nodes"/>
        <feature var="http://jabber.org/protocol/pubsub#outcast-affiliation"/>
        <feature var="http://jabber.org/protocol/pubsub#get-pending"/>
        <feature var="http://jabber.org/protocol/pubsub#multi-subscribe"/>
        <feature var="http://jabber.org/protocol/pubsub#presence-notifications"/>
        <feature var="urn:myserver:im:groupchat"/>
        <feature var="urn:xmpp:ping"/>
        <feature var="jabber:iq:register"/>
        <feature var="http://jabber.org/protocol/pubsub#delete-nodes"/>
        <feature var="urn:myserver:im:filetransfer"/>
        <feature var="http://jabber.org/protocol/pubsub#config-node"/>
        <feature var="http://jabber.org/protocol/pubsub#retrieve-items"/>
        <feature var="http://jabber.org/protocol/pubsub#auto-create"/>
        <feature var="http://jabber.org/protocol/disco#items"/>
        <feature var="http://jabber.org/protocol/pubsub#item-ids"/>
        <feature var="http://jabber.org/protocol/pubsub#meta-data"/>
        <feature var="jabber:iq:roster"/>
        <feature var="urn:xmpp:mam:1"/>
        <feature var="http://jabber.org/protocol/pubsub#instant-nodes"/>
        <feature var="http://jabber.org/protocol/pubsub#modify-affiliations"/>
        <feature var="http://jabber.org/protocol/pubsub#persistent-items"/>
        <feature var="http://jabber.org/protocol/pubsub#create-and-configure"/>
        <feature var="http://jabber.org/protocol/pubsub"/>
        <feature var="http://jabber.org/protocol/pubsub#publisher-affiliation"/>
        <feature var="http://jabber.org/protocol/pubsub#access-open"/>
        <feature var="http://jabber.org/protocol/pubsub#retrieve-affiliations"/>
        <feature var="jabber:iq:version"/>
        <feature var="http://jabber.org/protocol/pubsub#retract-items"/>
        <feature var="urn:xmpp:time"/>
        <feature var="http://jabber.org/protocol/pubsub#manage-subscriptions"/>
        <feature var="jabber:iq:privacy"/>
        <feature var="jabber:iq:last"/>
        <feature var="http://jabber.org/protocol/commands"/>
        <feature var="http://jabber.org/protocol/offline"/>
        <feature var="urn:xmpp:carbons:2"/>
        <feature var="http://jabber.org/protocol/address"/>
        <feature var="http://jabber.org/protocol/pubsub#publish"/>
        <feature var="http://jabber.org/protocol/pubsub#collections"/>
        <feature var="http://jabber.org/protocol/pubsub#retrieve-subscriptions"/>
        <feature var="http://jabber.org/protocol/disco#info"/>
        <feature var="jabber:iq:private"/>
        <feature var="http://jabber.org/protocol/rsm"/>
    </query>
</iq>

稍后如何查看哪些功能确实存在?我在 XMPPCapabilitiesXMPPCapabilitiesCoreDataStorage 中没有看到任何功能列表。我错过了什么吗?例如,我想检查 <feature var="urn:myserver:im:filetransfer"/> 是否存在。 XMPPFramework 在哪里保存和保存功能列表?非常感谢任何提示。

好的,我找到了信息的存储位置:

NSManagedObjectContext *moc = [[XMPPCapabilitiesCoreDataStorage sharedInstance] mainThreadManagedObjectContext];
NSEntityDescription *entityDescription = [NSEntityDescription entityForName:@"XMPPCapsResourceCoreDataStorageObject"
                                                     inManagedObjectContext:moc];
NSFetchRequest *fetchRequest = [NSFetchRequest new];
[fetchRequest setEntity:entityDescription];
fetchRequest.fetchBatchSize = 30;
NSPredicate *filter = [NSPredicate predicateWithFormat:@"jidStr == %@", _domain];
fetchRequest.predicate = filter;
NSError *error = nil;
NSArray *features = [moc executeFetchRequest:fetchRequest error:&error];
NSArray *ch = [[[[features firstObject] caps] capabilities] children];