Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the method: - (XMPPUserCoreDataStorageObject *)myUserForXMPPStream:(XMPPStream *)stream managedObjectContext:(NSMangedObjectContext *)moc is unuseful? #404

Open
jackywpy opened this issue Jul 15, 2014 · 5 comments

Comments

@jackywpy
Copy link

I call this method to get a XMPPUserCoreDataSorageObject, result is nil; I find this method wants to get myuser from rosters through myJID, but the roster doesn't contain myJID, so, is it unuseful?

@ObjColumnist
Copy link
Collaborator

I can't see a reason for it myself.

@vitalyster
Copy link
Contributor

You can add yourself to roster, and this method should work. I think better implementation will return XMPPUser instance in both cases, even I have myself in roster or not.

@jackywpy
Copy link
Author

@vitalyster @ObjColumnist How to add myself to roster?In logic, myself should not be in roster, right?

@vitalyster
Copy link
Contributor

@jackywpy as any other contact - send subscription request to your own JID and then approve it

@ObjColumnist
Copy link
Collaborator

This appears to be blocked by the XMPPFramework:

if ([myJID isEqualToJID:jid options:XMPPJIDCompareBare])
{
// You don't need to add yourself to the roster.
// XMPP will automatically send you presence from all resources signed in under your username.
//
// E.g. If you sign in with robbiehanson@deusty.com/home you'll automatically
// receive presence from robbiehanson@deusty.com/work
XMPPLogInfo(@"%@: %@ - Ignoring request to add myself to my own roster", [self class], THIS_METHOD);
return;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants