2

i'm implementing in my app xmppFramework, now i'm working to block/unblock contacts(iq, messages, presence in/out).

This is the piece of code i use to block:

[_privacy addDelegate:self delegateQueue: dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)];

XMPPJID *jid = [XMPPJID jidWithString:_jidToLock];

[_roster unsubscribePresenceFromUser:jid];
[_roster revokePresencePermissionFromUser:jid];
[_roster removeUser:jid];

DDXMLElement *element = [XMPPPrivacy privacyItemWithType:@"jid" value:[jid bare] action:@"deny" order:1];

[_privacy setActiveListName:kDefaultPrivacyListName];
[_privacy setListWithName:kDefaultPrivacyListName items:[NSArray arrayWithObjects: element, nil]];

this works fine, in fact if I send an sms to blocked contact he is not receiving sms.

The problem is that if he text me i receive message, and if i close/reopen app seems that every contact is unblocked... any suggestions?

alessioarsuffi
  • 561
  • 5
  • 16

0 Answers0