Guest User

Untitled

a guest
Jun 20th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. - (BOOL)_didReceiveVCard:(TNStropheStanza)aStanza
  2. {
  3. var aVCard = [aStanza firstChildWithName:@"vCard"];
  4.  
  5. if (aVCard)
  6. {
  7. _vCard = aVCard;
  8.  
  9. if ((_nickname == _nodeName) && ([aVCard firstChildWithName:@"NAME"]))
  10. _nickname = [[aVCard firstChildWithName:@"NAME"] text];
  11.  
  12. var photoNode;
  13. if (photoNode = [aVCard firstChildWithName:@"PHOTO"])
  14. {
  15. var contentType = [[photoNode firstChildWithName:@"TYPE"] text],
  16. data = [[photoNode firstChildWithName:@"BINVAL"] text];
  17.  
  18. _avatar = [TNBase64Image base64ImageWithContentType:contentType andData:data];
  19. [CPTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(_fireVCardReceivedNotification) userInfo:nil repeats:NO];
  20. }
  21. else
  22. [self _fireVCardReceivedNotification];
  23. }
  24.  
  25. return YES;
  26. }
  27.  
  28. - (BOOL)_fireVCardReceivedNotification
  29. {
  30. [[CPNotificationCenter defaultCenter] postNotificationName:TNStropheContactVCardReceivedNotification object:self];
  31. }
Add Comment
Please, Sign In to add comment