mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-28 08:39:20 +00:00
do not change nature of an existing chatroom
This commit is contained in:
parent
55f2cdc3db
commit
2b893c53be
4 changed files with 11 additions and 15 deletions
|
|
@ -59,17 +59,13 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
- (void)viewWillAppear:(BOOL)animated {
|
||||
[super viewWillAppear:animated];
|
||||
|
||||
if (_room) {
|
||||
_nameLabel.text = linphone_chat_room_get_subject(_room)
|
||||
? [NSString stringWithUTF8String:linphone_chat_room_get_subject(_room)]
|
||||
: @"";
|
||||
}
|
||||
|
||||
_nameLabel.text = _room && 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_state(_room) == LinphoneChatRoomStateCreated)
|
||||
? linphone_chat_room_get_me(_room)
|
||||
: NULL;
|
||||
|
||||
_imAdmin = me
|
||||
? linphone_participant_is_admin(me)
|
||||
: false;
|
||||
|
|
@ -81,7 +77,6 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
CGFloat height = _quitButton.hidden
|
||||
? self.view.frame.size.height - _tableView.frame.origin.y
|
||||
: _quitButton.frame.origin.y - _tableView.frame.origin.y - 10;
|
||||
|
||||
[_tableView setFrame:CGRectMake(
|
||||
_tableView.frame.origin.x,
|
||||
_tableView.frame.origin.y,
|
||||
|
|
|
|||
|
|
@ -373,12 +373,12 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
|
||||
- (void)updateSuperposedButtons {
|
||||
[_backToCallButton update];
|
||||
_infoButton.hidden = (linphone_chat_room_get_nb_participants(_chatRoom) == 1) || !_backToCallButton.hidden || _tableController.tableView.isEditing;
|
||||
_infoButton.hidden = (strcmp(linphone_chat_room_get_subject(_chatRoom) ?: "dummy subject", "dummy subject") == 0) || !_backToCallButton.hidden || _tableController.tableView.isEditing;
|
||||
_callButton.hidden = !_backToCallButton.hidden || !_infoButton.hidden || _tableController.tableView.isEditing;
|
||||
}
|
||||
|
||||
- (void)updateParticipantLabel {
|
||||
if (linphone_chat_room_get_nb_participants(_chatRoom) == 1) {
|
||||
if (strcmp(linphone_chat_room_get_subject(_chatRoom) ?: "dummy subject", "dummy subject") == 0) {
|
||||
_particpantsLabel.hidden = TRUE;
|
||||
} else {
|
||||
_particpantsLabel.hidden = FALSE;
|
||||
|
|
|
|||
|
|
@ -64,14 +64,15 @@
|
|||
return;
|
||||
}
|
||||
|
||||
if(linphone_chat_room_get_nb_participants(chatRoom) > 1) {
|
||||
_addressLabel.text = [NSString stringWithUTF8String:linphone_chat_room_get_subject(chatRoom) ? linphone_chat_room_get_subject(chatRoom) : "dummy subject"];
|
||||
const char *subject = linphone_chat_room_get_subject(chatRoom) ?: "dummy subject";
|
||||
if (strcmp(subject, "dummy subject") != 0) {
|
||||
_addressLabel.text = [NSString stringWithUTF8String:subject];
|
||||
[_avatarImage setImage:[UIImage imageNamed:@"chat_group_avatar.png"] bordered:NO withRoundedRadius:YES];
|
||||
} else {
|
||||
if(linphone_chat_room_get_participants(chatRoom) != NULL) {
|
||||
if (linphone_chat_room_get_participants(chatRoom) != NULL) {
|
||||
LinphoneParticipant *participant = linphone_chat_room_get_participants(chatRoom)->data;
|
||||
const LinphoneAddress *addr = linphone_participant_get_address(participant);
|
||||
if(addr) {
|
||||
if (addr) {
|
||||
[ContactDisplay setDisplayNameLabel:_addressLabel forAddress:addr];
|
||||
[_avatarImage setImage:[FastAddressBook imageForAddress:addr] bordered:NO withRoundedRadius:YES];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit b0bf790f6ba4fefbe08105c711290c73be2ab80f
|
||||
Subproject commit e536ded32d85483e834f541ef3986a6ae13bf618
|
||||
Loading…
Add table
Reference in a new issue