- Fix setUser method in PNInstallation

This commit is contained in:
giuseppenuc committed 2016-05-02 10:41:10 +02:00
1 parent c2c6e9a299
commit 0c37caed5c
3 files changed
+8 -6

No files matched your search

+5 -5
View File
@@ -131,16 +131,16 @@ static bool isFirstAccess = YES;
}
- (void) setUser:(PNUser *)user {
if (!self.user) {
self.user = user;
if (!_user) {
_user = nil;
[[NSNotificationCenter defaultCenter] postNotificationName:PNObjectLocalNotificationPNInstallationUserNew object:nil];
}
else if(self.user.objID != user.objID) {
self.user = user;
else if(_user.objID != user.objID) {
_user = user;
[[NSNotificationCenter defaultCenter] postNotificationName:PNObjectLocalNotificationPNInstallationUserChange object:nil];
}
else if (user == nil){
self.user = nil;
_user = nil;
[[NSNotificationCenter defaultCenter] postNotificationName:PNObjectLocalNotificationPNInstallationUserDelete object:nil];
}
}