From 20c700b18bf6d63dfe2e426e709a754ffd1023d4 Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Fri, 16 Feb 2018 17:19:32 +0100 Subject: [PATCH] refactor code --- Classes/ChatConversationView.m | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/Classes/ChatConversationView.m b/Classes/ChatConversationView.m index 86b3fb713..1e2c63dae 100644 --- a/Classes/ChatConversationView.m +++ b/Classes/ChatConversationView.m @@ -183,10 +183,8 @@ static UICompositeViewDescription *compositeDescription = nil; LinphoneParticipant *firstParticipant = participants ? (LinphoneParticipant *)participants->data : NULL; const LinphoneAddress *addr = firstParticipant ? linphone_participant_get_address(firstParticipant) : linphone_chat_room_get_peer_address(_chatRoom); [ContactDisplay setDisplayNameLabel:_addressLabel forAddress:addr]; - } else if (linphone_chat_room_get_subject(_chatRoom)) - _addressLabel.text = [NSString stringWithUTF8String:linphone_chat_room_get_subject(_chatRoom)]; - else - _addressLabel.text=@LINPHONE_DUMMY_SUBJECT; + } else + _addressLabel.text = [NSString stringWithUTF8String:linphone_chat_room_get_subject(_chatRoom) ?: LINPHONE_DUMMY_SUBJECT]; [self updateParticipantLabel]; @@ -363,11 +361,9 @@ static UICompositeViewDescription *compositeDescription = nil; animations:^{ _tableController.tableView.frame = newTableFrame; _composeIndicatorView.frame = newComposingFrame; - _composeLabel.hidden = !composingVisible; _composeIndicatorView.hidden = !composingVisible; } - completion:^(BOOL finished) { - }]; + completion:^(BOOL finished) {}]; } - (void)updateSuperposedButtons { @@ -541,7 +537,7 @@ static UICompositeViewDescription *compositeDescription = nil; view.oldContacts = [contactsArray mutableCopy]; view.admins = [admins mutableCopy]; view.oldAdmins = [admins mutableCopy]; - view.oldSubject = [NSString stringWithUTF8String:linphone_chat_room_get_subject(_chatRoom)?linphone_chat_room_get_subject(_chatRoom):LINPHONE_DUMMY_SUBJECT]; + view.oldSubject = [NSString stringWithUTF8String:linphone_chat_room_get_subject(_chatRoom) ?: LINPHONE_DUMMY_SUBJECT]; view.room = _chatRoom; [PhoneMainView.instance changeCurrentView:view.compositeViewDescription]; }