Created
October 28, 2010 11:56
-
-
Save benlangfeld/651194 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (BOOL)_didReceiveVCard:(TNStropheStanza)aStanza | |
{ | |
var aVCard = [aStanza firstChildWithName:@"vCard"]; | |
if (aVCard) | |
{ | |
_vCard = aVCard; | |
if ((_nickname == _nodeName) && ([aVCard firstChildWithName:@"NAME"])) | |
_nickname = [[aVCard firstChildWithName:@"NAME"] text]; | |
var photoNode; | |
if (photoNode = [aVCard firstChildWithName:@"PHOTO"]) | |
{ | |
var contentType = [[photoNode firstChildWithName:@"TYPE"] text], | |
data = [[photoNode firstChildWithName:@"BINVAL"] text]; | |
_avatar = [TNBase64Image base64ImageWithContentType:contentType andData:data]; | |
[CPTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(_fireVCardReceivedNotification) userInfo:nil repeats:NO]; | |
} | |
else | |
[self _fireVCardReceivedNotification]; | |
} | |
return YES; | |
} | |
- (BOOL)_fireVCardReceivedNotification | |
{ | |
[[CPNotificationCenter defaultCenter] postNotificationName:TNStropheContactVCardReceivedNotification object:self]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment