From c45bd8c952620ab84f316298624284219e82980d Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Thu, 9 Nov 2017 11:58:43 +0100 Subject: [PATCH] adapt ChatConversationInfoView when we have left the chatroom --- Classes/ChatConversationInfoView.m | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Classes/ChatConversationInfoView.m b/Classes/ChatConversationInfoView.m index b91a87a4a..2f39690b1 100644 --- a/Classes/ChatConversationInfoView.m +++ b/Classes/ChatConversationInfoView.m @@ -59,13 +59,20 @@ static UICompositeViewDescription *compositeDescription = nil; - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; - if (_room) + if (_room) { _nameLabel.text = linphone_chat_room_get_subject(_room) ? [NSString stringWithUTF8String:linphone_chat_room_get_subject(_room)] : @""; + } + _nextButton.enabled = _nameLabel.text.length > 0 && _contacts.count > 0; - LinphoneParticipant *me = _room ? linphone_chat_room_get_me(_room) : NULL; - _imAdmin = me ? linphone_participant_is_admin(me) : false; + LinphoneParticipant *me = _room && (linphone_chat_room_get_state(_room) == LinphoneChatRoomStateCreated) + ? linphone_chat_room_get_me(_room) + : NULL; + + _imAdmin = me + ? linphone_participant_is_admin(me) + : false; _quitButton.hidden = _create || (me == NULL); _nameLabel.enabled = _create || _imAdmin; _addButton.hidden = !_create && !_imAdmin;