IMAPlatform+Friend.m 953 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. //
  2. // IMAPlatform+Friend.m
  3. // TIMChat
  4. //
  5. // Created by AlexiChen on 16/3/7.
  6. // Copyright © 2016年 AlexiChen. All rights reserved.
  7. //
  8. #import "IMAPlatform+Friend.h"
  9. // 当前好友相关的逻辑
  10. @implementation IMAPlatform (Friend)
  11. - (void)asyncDeleteFriend:(IMAUser *)user succ:(TIMFriendSucc)succ fail:(TIMFail)fail
  12. {
  13. if (user)
  14. {
  15. NSString *uid = [user userId];
  16. [[TIMFriendshipManager sharedInstance] delFriend:TIM_FRIEND_DEL_BOTH users:@[uid] succ:^(NSArray *array) {
  17. // 从本地好友中找到该人,并删除
  18. // 只会返回一个
  19. for (TIMFriendResult *res in array)
  20. {
  21. IMAUser *temp = [[IMAUser alloc] initWith:res.identifier];
  22. [self.contactMgr removeUser:temp];
  23. }
  24. if (succ)
  25. {
  26. succ(array);
  27. }
  28. } fail:fail];
  29. }
  30. }
  31. @end