从被阻止的用户xmpp接收消息

时间:2015-05-14 07:13:27

标签: ios objective-c ios8 xmpp xmppframework

我在xmpp中阻止了用户 仍在接收此用户的消息

我正在将此代码用于阻止用户

[xmppPrivacy retrieveListWithName:@"Block_List"];
[xmppPrivacy setActiveListName:@"Block_List"];
NSString *strJid= @"551924b3cfc4a3a80800000e";
strJid=[strJid stringByAppendingFormat:@"@62.10.47.43"];
NSXMLElement *privacyElement = [XMPPPrivacy privacyItemWithType:@"jid" value:strJid action:@"deny" order:1];
[XMPPPrivacy blockIQs:privacyElement];
[XMPPPrivacy blockMessages:privacyElement];
[XMPPPrivacy blockPresenceIn:privacyElement];
[XMPPPrivacy blockPresenceOut:privacyElement];
NSLog(@"-------> PRIVACY ELEMENT: %@", privacyElement);
NSArray *arrayPrivacy = [[NSArray alloc] initWithObjects:privacyElement, nil];
[xmppPrivacy setListWithName:@"Block_List" items:arrayPrivacy];

我还获得了openfire的隐私列表

<item type="jid" value="551924b3cfc4a3a80800000e@62.10.47.43" action="deny" order="1"><iq/><message/><presence-in/><presence-out/></item>

它显示551924b3cfc4a3a80800000e@62.10.47.43被阻止但仍然从此用户接收消息

但是当我运行此代码时,第一次收到消息但是在应用程序重启消息接收后

0 个答案:

没有答案