mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 11:08:06 +00:00
Option to schedule meeting from group chat
This commit is contained in:
parent
8894132986
commit
d96228ef44
2 changed files with 39 additions and 14 deletions
|
|
@ -1781,7 +1781,14 @@ void on_chat_room_conference_alert(LinphoneChatRoom *cr, const LinphoneEventLog
|
|||
[self onToggleMenu:nil];
|
||||
BOOL isEncrypted = ![ChatConversationView isBasicChatRoom:_chatRoom];
|
||||
|
||||
if (indexPath.row == 0) {
|
||||
int firstIndex = isOneToOne ? 0 : 1;
|
||||
|
||||
if (!isOneToOne && indexPath.row == 0) { //Schedule meeting
|
||||
[ConferenceViewModelBridge scheduleFromGroupChatWithCChatRoom:_chatRoom];
|
||||
[PhoneMainView.instance popToView:ConferenceSchedulingView.compositeViewDescription];
|
||||
}
|
||||
|
||||
if (indexPath.row == firstIndex) {
|
||||
if (isOneToOne) {
|
||||
[self addOrGoToContact:linphone_chat_room_get_peer_address(_chatRoom)];
|
||||
} else {
|
||||
|
|
@ -1789,27 +1796,27 @@ void on_chat_room_conference_alert(LinphoneChatRoom *cr, const LinphoneEventLog
|
|||
}
|
||||
}
|
||||
|
||||
if (isEncrypted && indexPath.row == 1) {
|
||||
if (isEncrypted && indexPath.row == 1+firstIndex) {
|
||||
[self goToDeviceListView];
|
||||
}
|
||||
|
||||
BOOL canEphemeral = [self canAdminEphemeral:_chatRoom];
|
||||
if (canEphemeral && indexPath.row == 2) {
|
||||
if (canEphemeral && indexPath.row == 2+firstIndex) {
|
||||
EphemeralSettingsView *view = VIEW(EphemeralSettingsView);
|
||||
view.room = _chatRoom;
|
||||
[PhoneMainView.instance popToView:view.compositeViewDescription];
|
||||
}
|
||||
if ((!isEncrypted && indexPath.row == 1) || (isEncrypted && indexPath.row == 3)) {
|
||||
if ((!isEncrypted && indexPath.row == 1+firstIndex) || (isEncrypted && indexPath.row == 3+firstIndex)) {
|
||||
[self toggleMuteConversation];
|
||||
}
|
||||
|
||||
if ((!isEncrypted && indexPath.row == 2) || (isEncrypted && indexPath.row == 4)) {
|
||||
if ((!isEncrypted && indexPath.row == 2+firstIndex) || (isEncrypted && indexPath.row == 4+firstIndex)) {
|
||||
[_tableController onEditClick:nil];
|
||||
[self onEditionChangeClick:nil];
|
||||
}
|
||||
|
||||
if ((isEncrypted && ((!canEphemeral && indexPath.row == 4)||(canEphemeral && indexPath.row == 5)))
|
||||
|| (!isEncrypted && indexPath.row == 3)) {
|
||||
if ((isEncrypted && ((!canEphemeral && indexPath.row == 4+firstIndex)||(canEphemeral && indexPath.row == 5+firstIndex)))
|
||||
|| (!isEncrypted && indexPath.row == 3+firstIndex)) {
|
||||
[self showAddressAndIdentityPopup];
|
||||
}
|
||||
}
|
||||
|
|
@ -1832,13 +1839,23 @@ void on_chat_room_conference_alert(LinphoneChatRoom *cr, const LinphoneEventLog
|
|||
if ([self canAdminEphemeral:_chatRoom])
|
||||
++nbRows;
|
||||
|
||||
if (!isOneToOne) // schedule meeting
|
||||
++nbRows;
|
||||
|
||||
return nbRows;
|
||||
}
|
||||
|
||||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
UITableViewCell *cell = [[UITableViewCell alloc] init];
|
||||
|
||||
if (indexPath.row == 0) {
|
||||
int firstIndex = isOneToOne ? 0 : 1;
|
||||
|
||||
if (!isOneToOne && indexPath.row == 0) {
|
||||
cell.imageView.image = [LinphoneUtils resizeImage:[UIImage imageNamed:@"menu_voip_meeting_schedule"] newSize:CGSizeMake(25, 25)];
|
||||
cell.textLabel.text = NSLocalizedString(@"Schedule a meeting",nil);
|
||||
}
|
||||
|
||||
if (indexPath.row == firstIndex) {
|
||||
if (isOneToOne) {
|
||||
Contact *contact = [FastAddressBook getContactWithAddress:linphone_chat_room_get_peer_address(_chatRoom)];
|
||||
if (contact == nil) {
|
||||
|
|
@ -1854,18 +1871,18 @@ void on_chat_room_conference_alert(LinphoneChatRoom *cr, const LinphoneEventLog
|
|||
}
|
||||
}
|
||||
|
||||
if (isEncrypted && indexPath.row == 1) {
|
||||
if (isEncrypted && indexPath.row == 1+firstIndex) {
|
||||
cell.imageView.image = [LinphoneUtils resizeImage:[UIImage imageNamed:@"menu_security_default.png"] newSize:CGSizeMake(20, 25)];
|
||||
cell.textLabel.text = NSLocalizedString(@"Conversation's devices",nil);
|
||||
}
|
||||
|
||||
bool canEphemeral = [self canAdminEphemeral:_chatRoom];
|
||||
if (canEphemeral && indexPath.row == 2) {
|
||||
if (canEphemeral && indexPath.row == 2+firstIndex) {
|
||||
cell.imageView.image = [LinphoneUtils resizeImage:[UIImage imageNamed:@"ephemeral_messages_default.png"] newSize:CGSizeMake(20, 25)];
|
||||
cell.textLabel.text = NSLocalizedString(@"Ephemeral messages",nil);
|
||||
}
|
||||
|
||||
if ((isEncrypted && indexPath.row == 3) || (!isEncrypted && indexPath.row == 1)) {
|
||||
if ((isEncrypted && indexPath.row == 3+firstIndex) || (!isEncrypted && indexPath.row == 1+firstIndex)) {
|
||||
if ([self isConversationMuted]) {
|
||||
cell.imageView.image = [LinphoneUtils resizeImage:[UIImage imageNamed:@"menu_notifications_off.png"] newSize:CGSizeMake(20, 25)];
|
||||
cell.textLabel.text = NSLocalizedString(@"NOT IMPLEMENTED",nil);
|
||||
|
|
@ -1875,13 +1892,13 @@ void on_chat_room_conference_alert(LinphoneChatRoom *cr, const LinphoneEventLog
|
|||
}
|
||||
}
|
||||
|
||||
if ((isEncrypted && indexPath.row == 4) || (!isEncrypted && indexPath.row == 2)) {
|
||||
if ((isEncrypted && indexPath.row == 4+firstIndex) || (!isEncrypted && indexPath.row == 2+firstIndex)) {
|
||||
cell.imageView.image = [LinphoneUtils resizeImage:[UIImage imageNamed:@"delete_default.png"] newSize:CGSizeMake(20, 25)];
|
||||
cell.textLabel.text = NSLocalizedString(@"Delete messages",nil);
|
||||
}
|
||||
|
||||
if ((isEncrypted && ((!canEphemeral && indexPath.row == 4)||(canEphemeral && indexPath.row == 5)))
|
||||
|| (!isEncrypted && indexPath.row == 3)) {
|
||||
if ((isEncrypted && ((!canEphemeral && indexPath.row == 4+firstIndex)||(canEphemeral && indexPath.row == 5+firstIndex)))
|
||||
|| (!isEncrypted && indexPath.row == 3+firstIndex)) {
|
||||
cell.imageView.image = [LinphoneUtils resizeImage:[UIImage imageNamed:@"chat_group_informations.png"] newSize:CGSizeMake(25, 25)];
|
||||
cell.textLabel.text = NSLocalizedString(@"Show address and identity",nil);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -498,6 +498,14 @@ class ConferenceViewModel {
|
|||
VoipDialog.toast(message: message)
|
||||
}
|
||||
|
||||
@objc static func scheduleFromGroupChat(cChatRoom: OpaquePointer ) {
|
||||
ConferenceSchedulingViewModel.shared.reset()
|
||||
ChatRoom.getSwiftObject(cObject: cChatRoom).participants.forEach {
|
||||
ConferenceSchedulingViewModel.shared.selectedAddresses.value?.append($0.address!)
|
||||
}
|
||||
ConferenceSchedulingViewModel.shared.scheduleForLater.value = true
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue