Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
BC
public
liblinphone
Commits
64e0f9b8
Commit
64e0f9b8
authored
Oct 03, 2017
by
Sylvain Berfini
🎩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed issue in From and To when receiving a message
parent
28e77ff2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
src/chat/chat-room.cpp
src/chat/chat-room.cpp
+10
-4
No files found.
src/chat/chat-room.cpp
View file @
64e0f9b8
...
...
@@ -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
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment