mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 11:08:06 +00:00
fix can not send message in one-to-one chatroom when has been left
This commit is contained in:
parent
6e1904e9f5
commit
59e4034633
2 changed files with 19 additions and 7 deletions
|
|
@ -103,6 +103,7 @@
|
|||
- (void)update;
|
||||
- (void)openFileWithURL:(NSURL *)url;
|
||||
- (void)clearMessageView;
|
||||
- (void)configureMessageField;
|
||||
|
||||
- (void)showFileDownloadError;
|
||||
- (NSURL *)getICloudFileUrl:(NSString *)name;
|
||||
|
|
|
|||
|
|
@ -269,10 +269,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
_addressLabel.text = [NSString stringWithUTF8String:linphone_chat_room_get_subject(_chatRoom) ?: LINPHONE_DUMMY_SUBJECT];
|
||||
|
||||
[self updateParticipantLabel];
|
||||
|
||||
_messageField.editable = !linphone_chat_room_has_been_left(_chatRoom);
|
||||
_pictureButton.enabled = !linphone_chat_room_has_been_left(_chatRoom);
|
||||
_messageView.userInteractionEnabled = !linphone_chat_room_has_been_left(_chatRoom);
|
||||
[self configureMessageField];
|
||||
[_tableController setChatRoom:_chatRoom];
|
||||
|
||||
_chatView.hidden = NO;
|
||||
|
|
@ -283,6 +280,22 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
[self shareFile];
|
||||
}
|
||||
|
||||
- (void)configureMessageField {
|
||||
LinphoneChatRoomCapabilitiesMask capabilities = linphone_chat_room_get_capabilities(_chatRoom);
|
||||
if (capabilities & LinphoneChatRoomCapabilitiesOneToOne) {
|
||||
_messageField.editable = TRUE;
|
||||
_pictureButton.enabled = TRUE;
|
||||
_messageView.userInteractionEnabled = TRUE;
|
||||
if (linphone_chat_room_has_been_left(_chatRoom)) {
|
||||
linphone_chat_room_add_participant(_chatRoom, linphone_participant_get_address(linphone_chat_room_get_me(_chatRoom)));
|
||||
}
|
||||
} else {
|
||||
_messageField.editable = !linphone_chat_room_has_been_left(_chatRoom);
|
||||
_pictureButton.enabled = !linphone_chat_room_has_been_left(_chatRoom);
|
||||
_messageView.userInteractionEnabled = !linphone_chat_room_has_been_left(_chatRoom);
|
||||
}
|
||||
}
|
||||
|
||||
- (void)shareFile {
|
||||
NSString* groupName = [NSString stringWithFormat:@"group.%@.linphoneExtension",[[NSBundle mainBundle] bundleIdentifier]];
|
||||
|
||||
|
|
@ -999,9 +1012,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
|
||||
void on_chat_room_state_changed(LinphoneChatRoom *cr, LinphoneChatRoomState newState) {
|
||||
ChatConversationView *view = (__bridge ChatConversationView *)linphone_chat_room_cbs_get_user_data(linphone_chat_room_get_current_callbacks(cr));
|
||||
view.messageField.editable = !linphone_chat_room_has_been_left(cr);
|
||||
view.pictureButton.enabled = !linphone_chat_room_has_been_left(cr);
|
||||
view.messageView.userInteractionEnabled = !linphone_chat_room_has_been_left(cr);
|
||||
[view configureMessageField];
|
||||
}
|
||||
|
||||
void on_chat_room_subject_changed(LinphoneChatRoom *cr, const LinphoneEventLog *event_log) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue