Wizard: never use == for NSNumber comparaison, it will compare pointers and this is actually broken on iOS 8. Instead use isEqual method

This commit is contained in:
Gautier Pelloux-Prayer 2015-09-07 16:58:40 +02:00
parent db84eae27f
commit a76f80c7a0
2 changed files with 7 additions and 7 deletions

View file

@ -64,9 +64,10 @@
// also append transient upload messages because they are not in history yet!
for (FileTransferDelegate *ftd in [[LinphoneManager instance] fileTransferDelegates]) {
if (linphone_chat_room_get_peer_address(linphone_chat_message_get_chat_room(ftd.message)) ==
linphone_chat_room_get_peer_address(chatRoom) &&
linphone_chat_message_is_outgoing(ftd.message)) {
const LinphoneAddress *ftd_peer =
linphone_chat_room_get_peer_address(linphone_chat_message_get_chat_room(ftd.message));
const LinphoneAddress *peer = linphone_chat_room_get_peer_address(chatRoom);
if (linphone_address_equal(ftd_peer, peer) && linphone_chat_message_is_outgoing(ftd.message)) {
LOGI(@"Appending transient upload message %p", ftd.message);
self->messageList = ms_list_append(self->messageList, linphone_chat_message_ref(ftd.message));
}

View file

@ -944,9 +944,8 @@ static UICompositeViewDescription *compositeDescription = nil;
otherButtonTitles:nil, nil];
[errorView show];
} else if ([response object] != nil) { // Don't handle if not object: HTTP/Communication Error
NSString *value = [response object];
if ([[request method] isEqualToString:@"check_account"]) {
if ([value integerValue] == 1) {
if ([response.object isEqualToNumber:[NSNumber numberWithInt:1]]) {
UIAlertView *errorView =
[[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Check issue", nil)
message:NSLocalizedString(@"Username already exists", nil)
@ -962,7 +961,7 @@ static UICompositeViewDescription *compositeDescription = nil;
[self createAccount:identity password:password email:email];
}
} else if ([[request method] isEqualToString:@"create_account_with_useragent"]) {
if ([value integerValue] == 0) {
if ([response.value isEqualToNumber:[NSNumber numberWithInt:0]]) {
NSString *username = [WizardViewController findTextField:ViewElement_Username view:contentView].text;
NSString *password = [WizardViewController findTextField:ViewElement_Password view:contentView].text;
[self changeView:validateAccountView back:FALSE animation:TRUE];
@ -978,7 +977,7 @@ static UICompositeViewDescription *compositeDescription = nil;
[errorView show];
}
} else if ([[request method] isEqualToString:@"check_account_validated"]) {
if ([value integerValue] == 1) {
if ([response.object isEqualToNumber:[NSNumber numberWithInt:1]]) {
NSString *username = [WizardViewController findTextField:ViewElement_Username view:contentView].text;
NSString *password = [WizardViewController findTextField:ViewElement_Password view:contentView].text;
[self addProxyConfig:username password:password domain:nil withTransport:nil];