Avatar Bug Fixes #46

Closed
wants to merge 11 commits into
from

Projects

None yet

2 participants

Collaborator
  • Delegate Callbacks when updating "My vCard"
  • Prevents multiple photo elements from being added to outbound presence
ObjColumnist added some commits May 10, 2012
@ObjColumnist ObjColumnist Avatar Bug Fixes
- Delegate Callbacks when updating "My vCard"
- Prevents multiple photo elements from being added to outbound presence
05271a9
@ObjColumnist ObjColumnist Prevent Multiple XMPPCapabilities being added to outbound presence 03ddd0a
@ObjColumnist ObjColumnist Removed TODO Comment
The vCard is automatically published after it has been uploaded and
verified.
40f630e
@ObjColumnist ObjColumnist Merge https://github.com/robbiehanson/XMPPFramework 77bcf72
@ObjColumnist ObjColumnist reopened this Sep 25, 2012
Contributor

Does this finally let me modify the user avatar?

Collaborator

I didn't have any problems before to be honest, but by all means feel free to download my fork and try.

Contributor

Would you help me with example code for changing user avatar / getting it?

Collaborator

To get the avatar I use:

XMPPvCardTemp *myVcardTemp = [xmppvCardTempModule_ myvCardTemp]; 
UIImage *avatarImage = [UIImage imageWithData:myVcardTemp.photo];

if(!avatarImage)
{
        NSData *avatarImageData = [xmppvCardAvatarModule_ photoDataForJID:self.myJID];
        avatarImage = [UIImage imageWithData:avatarImageData];
}

To set the avatar I do the following:

XMPPvCardTemp *myVcardTemp = [xmppvCardTempModule_ myvCardTemp];

if(!myVcardTemp){
return;
}

NSData *dataFromImage = UIImagePNGRepresentation(image); 
[myVcardTemp setPhoto:dataFromImage]; 
[xmppvCardTempModule_ updateMyvCardTemp:myVcardTemp]; 
Contributor

Thanks!

@ObjColumnist ObjColumnist added a commit that referenced this pull request Apr 28, 2013
@ObjColumnist ObjColumnist vCard Avatar Updates
Merge from Pull Request #46
3f67dc2
@davidchiles davidchiles pushed a commit to davidchiles/XMPPFramework that referenced this pull request Jan 26, 2016
@ObjColumnist ObjColumnist vCard Avatar Updates
Merge from Pull Request #46
b3056a5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment