mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-28 16:49:20 +00:00
Fixed issue in From and To when receiving a message
This commit is contained in:
parent
28e77ff2e6
commit
64e0f9b826
1 changed files with 10 additions and 4 deletions
|
|
@ -404,7 +404,8 @@ LinphoneReason ChatRoomPrivate::messageReceived (SalOp *op, const SalMessage *sa
|
|||
content->setBody(salMsg->text ? salMsg->text : "");
|
||||
msg->addContent(content);
|
||||
|
||||
msg->setToAddress( op->get_to() ? op->get_to() : linphone_core_get_identity(core));
|
||||
msg->setToAddress(op->get_to() ? op->get_to() : linphone_core_get_identity(core));
|
||||
msg->setFromAddress(peerAddress);
|
||||
msg->getPrivate()->setTime(salMsg->time);
|
||||
msg->getPrivate()->setState(ChatMessage::State::Delivered);
|
||||
msg->getPrivate()->setDirection(ChatMessage::Direction::Incoming);
|
||||
|
|
@ -543,7 +544,11 @@ void ChatRoom::compose () {
|
|||
}
|
||||
|
||||
shared_ptr<ChatMessage> ChatRoom::createFileTransferMessage (const LinphoneContent *initialContent) {
|
||||
L_D();
|
||||
shared_ptr<ChatMessage> chatMessage = createMessage();
|
||||
|
||||
chatMessage->setToAddress(d->peerAddress);
|
||||
chatMessage->setFromAddress(linphone_core_get_identity(d->core));
|
||||
|
||||
chatMessage->getPrivate()->setDirection(ChatMessage::Direction::Outgoing);
|
||||
chatMessage->getPrivate()->setFileTransferInformation(linphone_content_copy(initialContent));
|
||||
|
|
@ -552,6 +557,7 @@ shared_ptr<ChatMessage> ChatRoom::createFileTransferMessage (const LinphoneConte
|
|||
}
|
||||
|
||||
shared_ptr<ChatMessage> ChatRoom::createMessage (const string &message) {
|
||||
L_D();
|
||||
shared_ptr<ChatMessage> chatMessage = createMessage();
|
||||
|
||||
shared_ptr<Content> content = make_shared<Content>();
|
||||
|
|
@ -559,15 +565,15 @@ shared_ptr<ChatMessage> ChatRoom::createMessage (const string &message) {
|
|||
content->setBody(message);
|
||||
chatMessage->addContent(content);
|
||||
|
||||
chatMessage->setToAddress(d->peerAddress);
|
||||
chatMessage->setFromAddress(linphone_core_get_identity(d->core));
|
||||
|
||||
return chatMessage;
|
||||
}
|
||||
|
||||
shared_ptr<ChatMessage> ChatRoom::createMessage () {
|
||||
L_D();
|
||||
shared_ptr<ChatMessage> chatMessage = make_shared<ChatMessage>(static_pointer_cast<ChatRoom>(shared_from_this()));
|
||||
chatMessage->getPrivate()->setTime(ms_time(0));
|
||||
chatMessage->setToAddress(d->peerAddress);
|
||||
chatMessage->setFromAddress(linphone_core_get_identity(d->core));
|
||||
return chatMessage;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue