mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-27 07:59:20 +00:00
send invite to create chat room
This commit is contained in:
parent
7d53422e65
commit
647ca830bd
2 changed files with 43 additions and 1 deletions
|
|
@ -11,6 +11,8 @@
|
|||
#import "PhoneMainView.h"
|
||||
#import "UIChatConversationInfoTableViewCell.h"
|
||||
|
||||
#import "linphone/core.h"
|
||||
|
||||
@implementation ChatConversationInfoView
|
||||
|
||||
#pragma mark - UICompositeViewDelegate Functions
|
||||
|
|
@ -58,9 +60,48 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
_quitButton.hidden = _create;
|
||||
}
|
||||
|
||||
#pragma mark - next functions
|
||||
|
||||
- (LinphoneChatRoom *)onCreate {
|
||||
LinphoneChatRoom *room = linphone_core_create_client_group_chat_room(LC, _nameLabel.text.UTF8String);
|
||||
if(!room) {
|
||||
return;
|
||||
}
|
||||
bctbx_list_t *addresses = NULL;
|
||||
for(NSString *addr in _contacts.allKeys) {
|
||||
LinphoneAddress *linphoneAddress = linphone_address_new(addr.UTF8String);
|
||||
if (!addresses) {
|
||||
addresses = bctbx_list_new((void *)linphoneAddress);
|
||||
continue;
|
||||
}
|
||||
addresses = bctbx_list_append(addresses, (void *)linphoneAddress);
|
||||
}
|
||||
linphone_chat_room_add_participants(room, addresses);
|
||||
bctbx_list_free_with_data(addresses, (void (*)(void *))linphone_address_unref);
|
||||
return room;
|
||||
}
|
||||
|
||||
- (LinphoneChatRoom *) onValidate {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#pragma mark - Buttons responders
|
||||
|
||||
- (IBAction)onNextClick:(id)sender {
|
||||
LinphoneChatRoom *room = NULL;
|
||||
if(_create)
|
||||
room = [self onCreate];
|
||||
else
|
||||
room = [self onValidate];
|
||||
|
||||
if(!room) {
|
||||
LOGE(@"No chat room to go to.");
|
||||
return;
|
||||
}
|
||||
|
||||
ChatConversationView *view = VIEW(ChatConversationView);
|
||||
view.chatRoom = room;
|
||||
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription];
|
||||
}
|
||||
|
||||
- (IBAction)onBackClick:(id)sender {
|
||||
|
|
@ -99,6 +140,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
cell.adminLabel.enabled = FALSE;
|
||||
cell.adminImage.image = [UIImage imageNamed:@"check_unselected.png"];
|
||||
}
|
||||
cell.adminButton.hidden = _create;
|
||||
return cell;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 44507caa790ac657cd0d557de27bdff994a7e584
|
||||
Subproject commit d15d7dfc52041ee6e983e677735542cbeb63f5a8
|
||||
Loading…
Add table
Reference in a new issue