mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-02-01 10:49:26 +00:00
Fix “Add to contact” action for encrypted chatrooms
This commit is contained in:
parent
81688b416b
commit
9612e21162
1 changed files with 17 additions and 2 deletions
|
|
@ -1780,7 +1780,14 @@ void on_chat_room_conference_alert(LinphoneChatRoom *cr, const LinphoneEventLog
|
|||
|
||||
if (indexPath.row == 0) {
|
||||
if (isOneToOne) {
|
||||
[self addOrGoToContact:linphone_chat_room_get_peer_address(_chatRoom)];
|
||||
if (isEncrypted) {
|
||||
LinphoneAddress* contactAddress = linphone_address_clone(linphone_participant_get_address(bctbx_list_nth_data(linphone_chat_room_get_participants(_chatRoom), 0)));
|
||||
linphone_address_clean(contactAddress);
|
||||
[self addOrGoToContact:contactAddress];
|
||||
linphone_address_unref(contactAddress);
|
||||
} else {
|
||||
[self addOrGoToContact:linphone_chat_room_get_peer_address(_chatRoom)];
|
||||
}
|
||||
} else {
|
||||
[self displayGroupInfo];
|
||||
}
|
||||
|
|
@ -1838,7 +1845,15 @@ void on_chat_room_conference_alert(LinphoneChatRoom *cr, const LinphoneEventLog
|
|||
|
||||
if (indexPath.row == 0) {
|
||||
if (isOneToOne) {
|
||||
Contact *contact = [FastAddressBook getContactWithAddress:linphone_chat_room_get_peer_address(_chatRoom)];
|
||||
Contact *contact;
|
||||
if (isEncrypted) {
|
||||
LinphoneAddress * contactAddress = linphone_address_clone(linphone_participant_get_address(bctbx_list_nth_data(linphone_chat_room_get_participants(_chatRoom), 0)));
|
||||
linphone_address_clean(contactAddress);
|
||||
contact = [FastAddressBook getContactWithAddress:contactAddress];
|
||||
linphone_address_unref(contactAddress);
|
||||
} else {
|
||||
contact = [FastAddressBook getContactWithAddress:linphone_chat_room_get_peer_address(_chatRoom)];
|
||||
}
|
||||
if (contact == nil) {
|
||||
cell.imageView.image = [LinphoneUtils resizeImage:[UIImage imageNamed:@"contact_add_default.png"] newSize:CGSizeMake(20, 25)];
|
||||
cell.textLabel.text = NSLocalizedString(@"Add to contacts",nil);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue