fix send multiparts message in basic chatroom

This commit is contained in:
Danmei Chen 2022-02-11 14:35:46 +01:00 committed by QuentinArguillere
parent 669a64af46
commit 2e883b02a3
2 changed files with 4 additions and 4 deletions

View file

@ -782,10 +782,10 @@ static UICompositeViewDescription *compositeDescription = nil;
} else {
int i = 0;
for (i = 0; i < [_fileContext count]-1; ++i) {
[self startUploadData:[_fileContext.datasArray objectAtIndex:i] withType:[_fileContext.typesArray objectAtIndex:i] withName:[_fileContext.namesArray objectAtIndex:i] andMessage:NULL rootMessage:rootMessage];
[self startUploadData:[_fileContext.datasArray objectAtIndex:i] withType:[_fileContext.typesArray objectAtIndex:i] withName:[_fileContext.namesArray objectAtIndex:i] andMessage:NULL rootMessage:NULL];
}
if (isOneToOne) {
[self startUploadData:[_fileContext.datasArray objectAtIndex:i] withType:[_fileContext.typesArray objectAtIndex:i] withName:[_fileContext.namesArray objectAtIndex:i] andMessage:NULL rootMessage:rootMessage];
[self startUploadData:[_fileContext.datasArray objectAtIndex:i] withType:[_fileContext.typesArray objectAtIndex:i] withName:[_fileContext.namesArray objectAtIndex:i] andMessage:NULL rootMessage:NULL];
if (![[self.messageField text] isEqualToString:@""]) {
[self sendMessage:[_messageField text] withExterlBodyUrl:nil rootMessage:rootMessage];
}

View file

@ -115,10 +115,10 @@ static void file_transfer_progress_indication_send(LinphoneChatMessage *message,
linphone_content_set_subtype(content, [subtype UTF8String]);
linphone_content_set_name(content, [name UTF8String]);
linphone_content_set_file_path(content, [[LinphoneManager imagesDirectory] stringByAppendingPathComponent:name].UTF8String);
_message = rootMessage;
_message = rootMessage? : linphone_chat_room_create_empty_message(chatRoom);
linphone_chat_message_add_file_content(_message, content);
BOOL isOneToOneChat = linphone_chat_room_get_capabilities(chatRoom) & LinphoneChatRoomCapabilitiesOneToOne;
BOOL basic = [ChatConversationView isBasicChatRoom:linphone_chat_message_get_chat_room(rootMessage)];
BOOL basic = [ChatConversationView isBasicChatRoom:linphone_chat_message_get_chat_room(_message)];
if (!basic && !isOneToOneChat && (_text!=nil && ![_text isEqualToString:@""]))
linphone_chat_message_add_utf8_text_content(_message, [_text UTF8String]);