mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 11:08:06 +00:00
fix reply message in basic chat rooms
This commit is contained in:
parent
3fd3286f94
commit
00144598db
2 changed files with 12 additions and 8 deletions
|
|
@ -529,7 +529,9 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
|
||||
LinphoneChatMessage *msg = rootMessage;
|
||||
BOOL basic = [ChatConversationView isBasicChatRoom:_chatRoom];
|
||||
if (!basic && message && message.length > 0) {
|
||||
const LinphoneAccountParams *params = linphone_account_get_params(linphone_core_get_default_account(LC));
|
||||
BOOL cpimEnabled = linphone_account_params_cpim_in_basic_chat_room_enabled(params);
|
||||
if ((!basic || cpimEnabled) && message && message.length > 0) {
|
||||
linphone_chat_message_add_utf8_text_content(msg, message.UTF8String);
|
||||
}
|
||||
|
||||
|
|
@ -542,7 +544,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
linphone_chat_message_send(msg);
|
||||
}
|
||||
|
||||
if (basic && message && message.length > 0) {
|
||||
if (basic && !cpimEnabled && message && message.length > 0) {
|
||||
linphone_chat_message_send(linphone_chat_room_create_message_from_utf8(_chatRoom, message.UTF8String));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -117,10 +117,11 @@ static void file_transfer_progress_indication_send(LinphoneChatMessage *message,
|
|||
linphone_content_set_file_path(content, [[LinphoneManager imagesDirectory] stringByAppendingPathComponent:name].UTF8String);
|
||||
_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;
|
||||
const LinphoneAccountParams *params = linphone_account_get_params(linphone_core_get_default_account(LC));
|
||||
BOOL cpimEnabled = linphone_account_params_cpim_in_basic_chat_room_enabled(params);
|
||||
BOOL basic = [ChatConversationView isBasicChatRoom:linphone_chat_message_get_chat_room(_message)];
|
||||
|
||||
if (!basic && !isOneToOneChat && (_text!=nil && ![_text isEqualToString:@""]))
|
||||
if ((!basic || cpimEnabled) && (_text!=nil && ![_text isEqualToString:@""]))
|
||||
linphone_chat_message_add_utf8_text_content(_message, [_text UTF8String]);
|
||||
linphone_content_unref(content);
|
||||
|
||||
|
|
@ -132,7 +133,7 @@ static void file_transfer_progress_indication_send(LinphoneChatMessage *message,
|
|||
|
||||
LOGI(@"%p Uploading content from message %p", self, _message);
|
||||
linphone_chat_message_send(_message);
|
||||
if (basic && !isOneToOneChat && (_text!=nil && ![_text isEqualToString:@""])) {
|
||||
if (basic && !cpimEnabled && (_text!=nil && ![_text isEqualToString:@""])) {
|
||||
linphone_chat_message_send(linphone_chat_room_create_message_from_utf8(linphone_chat_message_get_chat_room(rootMessage), _text.UTF8String));
|
||||
}
|
||||
}
|
||||
|
|
@ -165,9 +166,10 @@ static void file_transfer_progress_indication_send(LinphoneChatMessage *message,
|
|||
}
|
||||
|
||||
BOOL basic = [ChatConversationView isBasicChatRoom:linphone_chat_message_get_chat_room(rootMessage)];
|
||||
const LinphoneAccountParams *params = linphone_account_get_params(linphone_core_get_default_account(LC));
|
||||
BOOL cpimEnabled = linphone_account_params_cpim_in_basic_chat_room_enabled(params);
|
||||
|
||||
|
||||
if (!basic && _text!=nil && ![_text isEqualToString:@""])
|
||||
if ((!basic || cpimEnabled) && _text!=nil && ![_text isEqualToString:@""])
|
||||
linphone_chat_message_add_utf8_text_content(_message, [_text UTF8String]);
|
||||
|
||||
// todo indication progress
|
||||
|
|
@ -176,7 +178,7 @@ static void file_transfer_progress_indication_send(LinphoneChatMessage *message,
|
|||
|
||||
LOGI(@"%p Uploading content from message %p", self, _message);
|
||||
linphone_chat_message_send(_message);
|
||||
if (basic && _text!=nil && ![_text isEqualToString:@""]) {
|
||||
if (basic && !cpimEnabled && _text!=nil && ![_text isEqualToString:@""]) {
|
||||
linphone_chat_message_send(linphone_chat_room_create_message_from_utf8(linphone_chat_message_get_chat_room(rootMessage), _text.UTF8String));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue