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
Roster doesn't update correctly upon removing user from contacts list #9
Comments
Well, today I rechecked and find out the deletion still lurking around and upon re-added again the status won't update ONLY if target user go offline, so here the working code now, hope this help any1 facing the same problem. NSArray *sortedResources = [[self allResources] sortedArrayUsingSelector:@selector(compare:)];
|
I think this may have been the same issue as #186 , could you recheck to see if the XMPPRoster now works as expected? |
Im going to close this as I believe it has been fixed, if not we can reopen it. |
Every time client get presence update this method got called and without the code which I commented below, upon removing user, the removed ( unsubscribed user ) still available, with the code uncommented, it works, but I was wondering will there is an update which create new section for pending user ( instead of throw all in offline section ? ). Thanks in advance.
{
XMPPResourceCoreDataStorageObject *resource;
resource = (XMPPResourceCoreDataStorageObject *)[self resourceForJID:[presence from]];
if ([[presence type] isEqualToString:@"unavailable"]
// || [[presence type] isEqualToString:@"unsubscribed"]
// || [[presence type] isEqualToString:@"unsubscribe"]
{
if (resource)
{
[self removeResourcesObject:resource];
//[[self managedObjectContext] deleteObject:resource];
[[self managedObjectContext] processPendingChanges];
}
}
else
{
if(resource)
{
[resource updateWithPresence:presence];
}
else
{
XMPPResourceCoreDataStorageObject *newResource;
newResource = [XMPPResourceCoreDataStorageObject insertInManagedObjectContext:[self managedObjectContext]
withPresence:presence
streamBareJidStr:streamBareJidStr];
[self addResourcesObject:newResource];
}
}
[self recalculatePrimaryResource];
}
The text was updated successfully, but these errors were encountered: