Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liblinphone
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
10
Issues
10
List
Board
Labels
Milestones
Merge Requests
22
Merge Requests
22
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
External Wiki
External Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
BC
public
liblinphone
Commits
d6c17a16
Commit
d6c17a16
authored
Mar 05, 2018
by
Benjamin REIS
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add priority header with 'non-urgent' valu to imdn & is-composing
parent
2fb4ce6f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
69 additions
and
13 deletions
+69
-13
chat-message-p.h
src/chat/chat-message/chat-message-p.h
+3
-0
chat-message.cpp
src/chat/chat-message/chat-message.cpp
+3
-0
chat-message.h
src/chat/chat-message/chat-message.h
+1
-0
chat-room.cpp
src/chat/chat-room/chat-room.cpp
+19
-13
sip-headers.h
src/sip-tools/sip-headers.h
+43
-0
No files found.
src/chat/chat-message/chat-message-p.h
View file @
d6c17a16
...
...
@@ -160,7 +160,10 @@ private:
bool
isSecured
=
false
;
mutable
bool
isReadOnly
=
false
;
Content
internalContent
;
// TODO: to replace salCustomheaders
std
::
unordered_map
<
std
::
string
,
std
::
string
>
customHeaders
;
mutable
LinphoneErrorInfo
*
errorInfo
=
nullptr
;
SalOp
*
salOp
=
nullptr
;
SalCustomHeader
*
salCustomHeaders
=
nullptr
;
...
...
src/chat/chat-message/chat-message.cpp
View file @
d6c17a16
...
...
@@ -40,6 +40,7 @@
#include "core/core-p.h"
#include "logger/logger.h"
#include "chat/notification/imdn.h"
#include "sip-tools/sip-headers.h"
#include "ortp/b64.h"
...
...
@@ -402,7 +403,9 @@ void ChatMessagePrivate::sendImdn (Imdn::Type imdnType, LinphoneReason reason) {
if
(
reason
!=
LinphoneReasonNone
)
msg
->
getPrivate
()
->
setEncryptionPrevented
(
true
);
msg
->
setToBeStored
(
false
);
msg
->
getPrivate
()
->
addSalCustomHeader
(
PriorityHeader
::
HeaderName
,
PriorityHeader
::
NonUrgent
);
msg
->
getPrivate
()
->
send
();
}
...
...
src/chat/chat-message/chat-message.h
View file @
d6c17a16
...
...
@@ -100,6 +100,7 @@ public:
const
Content
&
getInternalContent
()
const
;
void
setInternalContent
(
const
Content
&
content
);
// TODO: to replace salCustomheaders
std
::
string
getCustomHeaderValue
(
const
std
::
string
&
headerName
)
const
;
void
addCustomHeader
(
const
std
::
string
&
headerName
,
const
std
::
string
&
headerValue
);
void
removeCustomHeader
(
const
std
::
string
&
headerName
);
...
...
src/chat/chat-room/chat-room.cpp
View file @
d6c17a16
...
...
@@ -25,6 +25,7 @@
#include "chat/chat-message/chat-message-p.h"
#include "chat/chat-room/chat-room-p.h"
#include "core/core-p.h"
#include "sip-tools/sip-headers.h"
// =============================================================================
...
...
@@ -50,7 +51,7 @@ void ChatRoomPrivate::sendChatMessage (const shared_ptr<ChatMessage> &chatMessag
dChatMessage
->
setTime
(
ms_time
(
0
));
dChatMessage
->
send
();
LinphoneChatRoom
*
cr
=
L_GET_C_BACK_PTR
(
q
);
LinphoneChatRoom
*
cr
=
L_GET_C_BACK_PTR
(
q
);
// TODO: server currently don't stock message, remove condition in the future.
if
(
!
linphone_core_conference_server_enabled
(
q
->
getCore
()
->
getCCore
()))
{
shared_ptr
<
ConferenceChatMessageEvent
>
event
=
static_pointer_cast
<
ConferenceChatMessageEvent
>
(
...
...
@@ -71,18 +72,23 @@ void ChatRoomPrivate::sendChatMessage (const shared_ptr<ChatMessage> &chatMessag
void
ChatRoomPrivate
::
sendIsComposingNotification
()
{
L_Q
();
LinphoneImNotifPolicy
*
policy
=
linphone_core_get_im_notif_policy
(
q
->
getCore
()
->
getCCore
());
if
(
linphone_im_notif_policy_get_send_is_composing
(
policy
))
{
string
payload
=
isComposingHandler
->
marshal
(
isComposing
);
if
(
!
payload
.
empty
())
{
shared_ptr
<
ChatMessage
>
chatMessage
=
createChatMessage
(
ChatMessage
::
Direction
::
Outgoing
);
chatMessage
->
setToBeStored
(
false
);
Content
*
content
=
new
Content
();
content
->
setContentType
(
ContentType
::
ImIsComposing
);
content
->
setBody
(
payload
);
chatMessage
->
addContent
(
*
content
);
chatMessage
->
getPrivate
()
->
send
();
}
}
if
(
!
linphone_im_notif_policy_get_send_is_composing
(
policy
))
return
;
string
payload
=
isComposingHandler
->
marshal
(
isComposing
);
if
(
payload
.
empty
())
return
;
Content
*
content
=
new
Content
();
content
->
setContentType
(
ContentType
::
ImIsComposing
);
content
->
setBody
(
payload
);
shared_ptr
<
ChatMessage
>
chatMessage
=
createChatMessage
(
ChatMessage
::
Direction
::
Outgoing
);
chatMessage
->
setToBeStored
(
false
);
chatMessage
->
addContent
(
*
content
);
chatMessage
->
getPrivate
()
->
addSalCustomHeader
(
PriorityHeader
::
HeaderName
,
PriorityHeader
::
NonUrgent
);
chatMessage
->
getPrivate
()
->
send
();
}
// -----------------------------------------------------------------------------
...
...
src/sip-tools/sip-headers.h
0 → 100644
View file @
d6c17a16
/*
* sip-headers.h
* Copyright (C) 2010-2018 Belledonne Communications SARL
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef _L_SIP_HEADERS_H_
#define _L_SIP_HEADERS_H_
#include "linphone/utils/general.h"
// =============================================================================
using
namespace
std
;
LINPHONE_BEGIN_NAMESPACE
namespace
PriorityHeader
{
constexpr
const
char
HeaderName
[]
=
"Priority"
;
// Values
constexpr
const
char
NonUrgent
[]
=
"non-urgent"
;
constexpr
const
char
Urgent
[]
=
"urgent"
;
constexpr
const
char
Emergency
[]
=
"emergency"
;
constexpr
const
char
Normal
[]
=
"normal"
;
}
LINPHONE_END_NAMESPACE
#endif // _L_SIP_HEADERS_H_
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