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
21
Merge Requests
21
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
ae935149
Commit
ae935149
authored
Feb 01, 2018
by
Ghislain MARY
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add canHandleMultipart() method on chat rooms.
parent
3f344bb5
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
67 additions
and
35 deletions
+67
-35
chat-message.cpp
src/chat/chat-message/chat-message.cpp
+1
-1
abstract-chat-room.h
src/chat/chat-room/abstract-chat-room.h
+3
-0
basic-chat-room-p.h
src/chat/chat-room/basic-chat-room-p.h
+2
-1
basic-chat-room.cpp
src/chat/chat-room/basic-chat-room.cpp
+20
-10
basic-chat-room.h
src/chat/chat-room/basic-chat-room.h
+5
-2
client-group-chat-room.cpp
src/chat/chat-room/client-group-chat-room.cpp
+8
-4
client-group-chat-room.h
src/chat/chat-room/client-group-chat-room.h
+3
-1
proxy-chat-room.cpp
src/chat/chat-room/proxy-chat-room.cpp
+10
-4
proxy-chat-room.h
src/chat/chat-room/proxy-chat-room.h
+3
-1
server-group-chat-room-stub.cpp
src/chat/chat-room/server-group-chat-room-stub.cpp
+8
-4
server-group-chat-room.h
src/chat/chat-room/server-group-chat-room.h
+3
-1
conference-interface.h
src/conference/conference-interface.h
+0
-1
conference.cpp
src/conference/conference.cpp
+0
-4
conference.h
src/conference/conference.h
+0
-1
multipart-tester.cpp
tester/multipart-tester.cpp
+1
-0
No files found.
src/chat/chat-message/chat-message.cpp
View file @
ae935149
...
...
@@ -600,7 +600,7 @@ void ChatMessagePrivate::send () {
if
(
applyModifiers
)
{
// Do not multipart or encapsulate with CPIM in an old ChatRoom to maintain backward compatibility
if
(
q
->
getChatRoom
()
->
canHandle
Cpim
())
{
if
(
q
->
getChatRoom
()
->
canHandle
Multipart
())
{
if
((
currentSendStep
&
ChatMessagePrivate
::
Step
::
Multipart
)
==
ChatMessagePrivate
::
Step
::
Multipart
)
{
lInfo
()
<<
"Multipart step already done, skipping"
;
}
else
{
...
...
src/chat/chat-room/abstract-chat-room.h
View file @
ae935149
...
...
@@ -51,6 +51,9 @@ public:
typedef
EnumMask
<
Capabilities
>
CapabilitiesMask
;
virtual
bool
canHandleCpim
()
const
=
0
;
virtual
bool
canHandleMultipart
()
const
=
0
;
virtual
const
ChatRoomId
&
getChatRoomId
()
const
=
0
;
virtual
const
IdentityAddress
&
getPeerAddress
()
const
=
0
;
...
...
src/chat/chat-room/basic-chat-room-p.h
View file @
ae935149
...
...
@@ -34,7 +34,8 @@ public:
private
:
std
::
string
subject
;
std
::
list
<
std
::
shared_ptr
<
Participant
>>
participants
;
bool
allowCpim
=
false
;
bool
cpimAllowed
=
false
;
bool
multipartAllowed
=
false
;
L_DECLARE_PUBLIC
(
BasicChatRoom
);
};
...
...
src/chat/chat-room/basic-chat-room.cpp
View file @
ae935149
...
...
@@ -43,6 +43,26 @@ BasicChatRoom::BasicChatRoom (
d
->
participants
.
push_back
(
make_shared
<
Participant
>
(
getPeerAddress
()));
}
void
BasicChatRoom
::
allowCpim
(
bool
value
)
{
L_D
();
d
->
cpimAllowed
=
value
;
}
void
BasicChatRoom
::
allowMultipart
(
bool
value
)
{
L_D
();
d
->
multipartAllowed
=
value
;
}
bool
BasicChatRoom
::
canHandleCpim
()
const
{
L_D
();
return
d
->
cpimAllowed
;
}
bool
BasicChatRoom
::
canHandleMultipart
()
const
{
L_D
();
return
d
->
multipartAllowed
;
}
BasicChatRoom
::
CapabilitiesMask
BasicChatRoom
::
getCapabilities
()
const
{
return
{
Capabilities
::
Basic
,
Capabilities
::
OneToOne
};
}
...
...
@@ -55,16 +75,6 @@ bool BasicChatRoom::canHandleParticipants () const {
return
false
;
}
bool
BasicChatRoom
::
canHandleCpim
()
const
{
L_D
();
return
d
->
allowCpim
;
}
void
BasicChatRoom
::
allowCpim
(
bool
isCpimAllowed
)
{
L_D
();
d
->
allowCpim
=
isCpimAllowed
;
}
const
IdentityAddress
&
BasicChatRoom
::
getConferenceAddress
()
const
{
lError
()
<<
"a BasicChatRoom does not have a conference address"
;
return
Utils
::
getEmptyConstRefObject
<
IdentityAddress
>
();
...
...
src/chat/chat-room/basic-chat-room.h
View file @
ae935149
...
...
@@ -33,13 +33,17 @@ class LINPHONE_PUBLIC BasicChatRoom : public ChatRoom {
friend
class
CorePrivate
;
public
:
void
allowCpim
(
bool
value
);
void
allowMultipart
(
bool
value
);
bool
canHandleCpim
()
const
override
;
bool
canHandleMultipart
()
const
override
;
CapabilitiesMask
getCapabilities
()
const
override
;
bool
hasBeenLeft
()
const
override
;
const
IdentityAddress
&
getConferenceAddress
()
const
override
;
bool
canHandleParticipants
()
const
override
;
bool
canHandleCpim
()
const
override
;
void
addParticipant
(
const
IdentityAddress
&
addr
,
const
CallSessionParams
*
params
,
bool
hasMedia
)
override
;
void
addParticipants
(
const
std
::
list
<
IdentityAddress
>
&
addresses
,
const
CallSessionParams
*
params
,
bool
hasMedia
)
override
;
...
...
@@ -61,7 +65,6 @@ public:
void
join
()
override
;
void
leave
()
override
;
void
allowCpim
(
bool
isCpimAllowed
);
protected
:
explicit
BasicChatRoom
(
BasicChatRoomPrivate
&
p
,
const
std
::
shared_ptr
<
Core
>
&
core
,
const
ChatRoomId
&
chatRoomId
);
...
...
src/chat/chat-room/client-group-chat-room.cpp
View file @
ae935149
...
...
@@ -205,6 +205,14 @@ shared_ptr<Core> ClientGroupChatRoom::getCore () const {
return
ChatRoom
::
getCore
();
}
bool
ClientGroupChatRoom
::
canHandleCpim
()
const
{
return
true
;
}
bool
ClientGroupChatRoom
::
canHandleMultipart
()
const
{
return
true
;
}
ClientGroupChatRoom
::
CapabilitiesMask
ClientGroupChatRoom
::
getCapabilities
()
const
{
L_D
();
return
d
->
capabilities
;
...
...
@@ -218,10 +226,6 @@ bool ClientGroupChatRoom::canHandleParticipants () const {
return
RemoteConference
::
canHandleParticipants
();
}
bool
ClientGroupChatRoom
::
canHandleCpim
()
const
{
return
true
;
}
const
IdentityAddress
&
ClientGroupChatRoom
::
getConferenceAddress
()
const
{
return
RemoteConference
::
getConferenceAddress
();
}
...
...
src/chat/chat-room/client-group-chat-room.h
View file @
ae935149
...
...
@@ -57,13 +57,15 @@ public:
std
::
shared_ptr
<
Core
>
getCore
()
const
;
bool
canHandleCpim
()
const
override
;
bool
canHandleMultipart
()
const
override
;
CapabilitiesMask
getCapabilities
()
const
override
;
bool
hasBeenLeft
()
const
override
;
const
IdentityAddress
&
getConferenceAddress
()
const
override
;
bool
canHandleParticipants
()
const
override
;
bool
canHandleCpim
()
const
override
;
void
deleteFromDb
()
override
;
...
...
src/chat/chat-room/proxy-chat-room.cpp
View file @
ae935149
...
...
@@ -298,13 +298,19 @@ const IdentityAddress &ProxyChatRoom::getConferenceAddress () const {
// -----------------------------------------------------------------------------
bool
ProxyChatRoom
::
canHandle
Participants
()
const
{
bool
ProxyChatRoom
::
canHandle
Cpim
()
const
{
L_D
();
return
d
->
chatRoom
->
canHandle
Participants
();
return
d
->
chatRoom
->
canHandle
Cpim
();
}
bool
ProxyChatRoom
::
canHandleCpim
()
const
{
return
true
;
bool
ProxyChatRoom
::
canHandleMultipart
()
const
{
L_D
();
return
d
->
chatRoom
->
canHandleMultipart
();
}
bool
ProxyChatRoom
::
canHandleParticipants
()
const
{
L_D
();
return
d
->
chatRoom
->
canHandleParticipants
();
}
void
ProxyChatRoom
::
addParticipant
(
...
...
src/chat/chat-room/proxy-chat-room.h
View file @
ae935149
...
...
@@ -75,8 +75,10 @@ public:
const
IdentityAddress
&
getConferenceAddress
()
const
override
;
bool
canHandleParticipants
()
const
override
;
bool
canHandleCpim
()
const
override
;
bool
canHandleMultipart
()
const
override
;
bool
canHandleParticipants
()
const
override
;
void
addParticipant
(
const
IdentityAddress
&
participantAddress
,
...
...
src/chat/chat-room/server-group-chat-room-stub.cpp
View file @
ae935149
...
...
@@ -125,6 +125,14 @@ ServerGroupChatRoom::CapabilitiesMask ServerGroupChatRoom::getCapabilities () co
return
0
;
}
bool
ServerGroupChatRoom
::
canHandleCpim
()
const
{
return
true
;
}
bool
ServerGroupChatRoom
::
canHandleMultipart
()
const
{
return
true
;
}
bool
ServerGroupChatRoom
::
hasBeenLeft
()
const
{
return
true
;
}
...
...
@@ -137,10 +145,6 @@ bool ServerGroupChatRoom::canHandleParticipants () const {
return
false
;
}
bool
ServerGroupChatRoom
::
canHandleCpim
()
const
{
return
true
;
}
void
ServerGroupChatRoom
::
addParticipant
(
const
IdentityAddress
&
,
const
CallSessionParams
*
,
bool
)
{}
void
ServerGroupChatRoom
::
addParticipants
(
const
list
<
IdentityAddress
>
&
,
const
CallSessionParams
*
,
bool
)
{}
...
...
src/chat/chat-room/server-group-chat-room.h
View file @
ae935149
...
...
@@ -47,6 +47,9 @@ public:
std
::
shared_ptr
<
Core
>
getCore
()
const
;
bool
canHandleCpim
()
const
override
;
bool
canHandleMultipart
()
const
override
;
std
::
shared_ptr
<
Participant
>
findParticipant
(
const
std
::
shared_ptr
<
const
CallSession
>
&
session
)
const
;
CapabilitiesMask
getCapabilities
()
const
override
;
...
...
@@ -55,7 +58,6 @@ public:
const
IdentityAddress
&
getConferenceAddress
()
const
override
;
bool
canHandleParticipants
()
const
override
;
bool
canHandleCpim
()
const
override
;
void
addParticipant
(
const
IdentityAddress
&
address
,
const
CallSessionParams
*
params
,
bool
hasMedia
)
override
;
void
addParticipants
(
...
...
src/conference/conference-interface.h
View file @
ae935149
...
...
@@ -47,7 +47,6 @@ public:
bool
hasMedia
)
=
0
;
virtual
bool
canHandleParticipants
()
const
=
0
;
virtual
bool
canHandleCpim
()
const
=
0
;
virtual
std
::
shared_ptr
<
Participant
>
findParticipant
(
const
IdentityAddress
&
participantAddress
)
const
=
0
;
virtual
const
IdentityAddress
&
getConferenceAddress
()
const
=
0
;
virtual
std
::
shared_ptr
<
Participant
>
getMe
()
const
=
0
;
...
...
src/conference/conference.cpp
View file @
ae935149
...
...
@@ -72,10 +72,6 @@ bool Conference::canHandleParticipants () const {
return
true
;
}
bool
Conference
::
canHandleCpim
()
const
{
return
true
;
}
const
IdentityAddress
&
Conference
::
getConferenceAddress
()
const
{
L_D
();
return
d
->
conferenceAddress
;
...
...
src/conference/conference.h
View file @
ae935149
...
...
@@ -50,7 +50,6 @@ public:
void
addParticipant
(
const
IdentityAddress
&
addr
,
const
CallSessionParams
*
params
,
bool
hasMedia
)
override
;
void
addParticipants
(
const
std
::
list
<
IdentityAddress
>
&
addresses
,
const
CallSessionParams
*
params
,
bool
hasMedia
)
override
;
bool
canHandleParticipants
()
const
override
;
bool
canHandleCpim
()
const
override
;
std
::
shared_ptr
<
Participant
>
findParticipant
(
const
IdentityAddress
&
addr
)
const
override
;
const
IdentityAddress
&
getConferenceAddress
()
const
override
;
std
::
shared_ptr
<
Participant
>
getMe
()
const
override
;
...
...
tester/multipart-tester.cpp
View file @
ae935149
...
...
@@ -42,6 +42,7 @@ static void chat_message_multipart_modifier_base(bool first_file_transfer, bool
IdentityAddress
paulineAddress
(
linphone_address_as_string_uri_only
(
pauline
->
identity
));
shared_ptr
<
AbstractChatRoom
>
marieRoom
=
pauline
->
lc
->
cppPtr
->
getOrCreateBasicChatRoom
(
paulineAddress
);
static_pointer_cast
<
BasicChatRoom
>
(
marieRoom
)
->
allowMultipart
(
true
);
shared_ptr
<
ChatMessage
>
marieMessage
=
marieRoom
->
createChatMessage
();
if
(
first_file_transfer
)
{
...
...
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