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
3454bd3a
Commit
3454bd3a
authored
Dec 12, 2017
by
Ronan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(ChatRoom): clean some pieces of code in Abstract and ServerGroupChatRoom (stub)
parent
9258c5f1
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
54 additions
and
50 deletions
+54
-50
src/chat/chat-message/chat-message.cpp
src/chat/chat-message/chat-message.cpp
+1
-1
src/chat/chat-room/abstract-chat-room-p.h
src/chat/chat-room/abstract-chat-room-p.h
+1
-1
src/chat/chat-room/basic-chat-room.cpp
src/chat/chat-room/basic-chat-room.cpp
+1
-1
src/chat/chat-room/basic-chat-room.h
src/chat/chat-room/basic-chat-room.h
+1
-1
src/chat/chat-room/chat-room-p.h
src/chat/chat-room/chat-room-p.h
+1
-1
src/chat/chat-room/chat-room.cpp
src/chat/chat-room/chat-room.cpp
+1
-1
src/chat/chat-room/chat-room.h
src/chat/chat-room/chat-room.h
+0
-3
src/chat/chat-room/client-group-chat-room.cpp
src/chat/chat-room/client-group-chat-room.cpp
+1
-1
src/chat/chat-room/client-group-chat-room.h
src/chat/chat-room/client-group-chat-room.h
+1
-1
src/chat/chat-room/server-group-chat-room-p.h
src/chat/chat-room/server-group-chat-room-p.h
+16
-14
src/chat/chat-room/server-group-chat-room-stub.cpp
src/chat/chat-room/server-group-chat-room-stub.cpp
+18
-13
src/chat/chat-room/server-group-chat-room.h
src/chat/chat-room/server-group-chat-room.h
+9
-9
src/conference/conference-interface.h
src/conference/conference-interface.h
+1
-1
src/conference/conference.cpp
src/conference/conference.cpp
+1
-1
src/conference/conference.h
src/conference/conference.h
+1
-1
No files found.
src/chat/chat-message/chat-message.cpp
View file @
3454bd3a
...
...
@@ -357,7 +357,7 @@ LinphoneReason ChatMessagePrivate::receive () {
ChatMessageModifier
::
Result
result
=
ecmm
.
decode
(
q
->
getSharedFromThis
(),
errorCode
);
if
(
result
==
ChatMessageModifier
::
Result
::
Error
)
{
/* Unable to decrypt message */
chatRoom
->
getPrivate
()
->
notifyUndecryptableMessageReceived
(
q
->
getSharedFromThis
());
chatRoom
->
getPrivate
()
->
notifyUndecryptable
Chat
MessageReceived
(
q
->
getSharedFromThis
());
reason
=
linphone_error_code_to_reason
(
errorCode
);
q
->
sendDeliveryNotification
(
reason
);
return
reason
;
...
...
src/chat/chat-room/abstract-chat-room-p.h
View file @
3454bd3a
...
...
@@ -43,7 +43,7 @@ public:
virtual
void
addTransientEvent
(
const
std
::
shared_ptr
<
EventLog
>
&
eventLog
)
=
0
;
virtual
void
removeTransientEvent
(
const
std
::
shared_ptr
<
EventLog
>
&
eventLog
)
=
0
;
virtual
void
notifyUndecryptableMessageReceived
(
const
std
::
shared_ptr
<
ChatMessage
>
&
chatMessage
)
=
0
;
virtual
void
notifyUndecryptable
Chat
MessageReceived
(
const
std
::
shared_ptr
<
ChatMessage
>
&
chatMessage
)
=
0
;
virtual
void
onChatMessageReceived
(
const
std
::
shared_ptr
<
ChatMessage
>
&
chatMessage
)
=
0
;
virtual
LinphoneReason
onSipMessageReceived
(
SalOp
*
op
,
const
SalMessage
*
message
)
=
0
;
...
...
src/chat/chat-room/basic-chat-room.cpp
View file @
3454bd3a
...
...
@@ -95,7 +95,7 @@ const list<shared_ptr<Participant>> &BasicChatRoom::getParticipants () const {
return
d
->
participants
;
}
void
BasicChatRoom
::
setParticipantAdminStatus
(
shared_ptr
<
Participant
>
&
,
bool
)
{
void
BasicChatRoom
::
setParticipantAdminStatus
(
const
shared_ptr
<
Participant
>
&
,
bool
)
{
lError
()
<<
"setParticipantAdminStatus() is not allowed on a BasicChatRoom"
;
}
...
...
src/chat/chat-room/basic-chat-room.h
View file @
3454bd3a
...
...
@@ -51,7 +51,7 @@ public:
int
getParticipantCount
()
const
override
;
const
std
::
list
<
std
::
shared_ptr
<
Participant
>>
&
getParticipants
()
const
override
;
void
setParticipantAdminStatus
(
std
::
shared_ptr
<
Participant
>
&
participant
,
bool
isAdmin
)
override
;
void
setParticipantAdminStatus
(
const
std
::
shared_ptr
<
Participant
>
&
participant
,
bool
isAdmin
)
override
;
const
std
::
string
&
getSubject
()
const
override
;
void
setSubject
(
const
std
::
string
&
subject
)
override
;
...
...
src/chat/chat-room/chat-room-p.h
View file @
3454bd3a
...
...
@@ -47,7 +47,7 @@ public:
void
addTransientEvent
(
const
std
::
shared_ptr
<
EventLog
>
&
eventLog
)
override
;
void
removeTransientEvent
(
const
std
::
shared_ptr
<
EventLog
>
&
eventLog
)
override
;
void
notifyUndecryptableMessageReceived
(
const
std
::
shared_ptr
<
ChatMessage
>
&
chatMessage
)
override
;
void
notifyUndecryptable
Chat
MessageReceived
(
const
std
::
shared_ptr
<
ChatMessage
>
&
chatMessage
)
override
;
void
onChatMessageReceived
(
const
std
::
shared_ptr
<
ChatMessage
>
&
chatMessage
)
override
;
LinphoneReason
onSipMessageReceived
(
SalOp
*
op
,
const
SalMessage
*
message
)
override
;
...
...
src/chat/chat-room/chat-room.cpp
View file @
3454bd3a
...
...
@@ -271,7 +271,7 @@ void ChatRoomPrivate::notifyStateChanged () {
cb
(
cr
,
(
LinphoneChatRoomState
)
state
);
}
void
ChatRoomPrivate
::
notifyUndecryptableMessageReceived
(
const
shared_ptr
<
ChatMessage
>
&
msg
)
{
void
ChatRoomPrivate
::
notifyUndecryptable
Chat
MessageReceived
(
const
shared_ptr
<
ChatMessage
>
&
msg
)
{
L_Q
();
LinphoneChatRoom
*
cr
=
L_GET_C_BACK_PTR
(
q
);
LinphoneChatRoomCbs
*
cbs
=
linphone_chat_room_get_callbacks
(
cr
);
...
...
src/chat/chat-room/chat-room.h
View file @
3454bd3a
...
...
@@ -29,9 +29,6 @@ LINPHONE_BEGIN_NAMESPACE
class
ChatRoomPrivate
;
class
LINPHONE_PUBLIC
ChatRoom
:
public
AbstractChatRoom
{
friend
class
Core
;
friend
class
FileTransferChatMessageModifier
;
public:
L_OVERRIDE_SHARED_FROM_THIS
(
ChatRoom
);
...
...
src/chat/chat-room/client-group-chat-room.cpp
View file @
3454bd3a
...
...
@@ -247,7 +247,7 @@ const list<shared_ptr<Participant>> &ClientGroupChatRoom::getParticipants () con
return
RemoteConference
::
getParticipants
();
}
void
ClientGroupChatRoom
::
setParticipantAdminStatus
(
shared_ptr
<
Participant
>
&
participant
,
bool
isAdmin
)
{
void
ClientGroupChatRoom
::
setParticipantAdminStatus
(
const
shared_ptr
<
Participant
>
&
participant
,
bool
isAdmin
)
{
if
(
isAdmin
==
participant
->
isAdmin
())
return
;
...
...
src/chat/chat-room/client-group-chat-room.h
View file @
3454bd3a
...
...
@@ -69,7 +69,7 @@ public:
int
getParticipantCount
()
const
override
;
const
std
::
list
<
std
::
shared_ptr
<
Participant
>>
&
getParticipants
()
const
override
;
void
setParticipantAdminStatus
(
std
::
shared_ptr
<
Participant
>
&
participant
,
bool
isAdmin
)
override
;
void
setParticipantAdminStatus
(
const
std
::
shared_ptr
<
Participant
>
&
participant
,
bool
isAdmin
)
override
;
const
std
::
string
&
getSubject
()
const
override
;
void
setSubject
(
const
std
::
string
&
subject
)
override
;
...
...
src/chat/chat-room/server-group-chat-room-p.h
View file @
3454bd3a
...
...
@@ -20,36 +20,34 @@
#ifndef _SERVER_GROUP_CHAT_ROOM_P_H_
#define _SERVER_GROUP_CHAT_ROOM_P_H_
// From coreapi.
#include "private.h"
#include "address/address.h"
#include "chat-room-p.h"
#include "server-group-chat-room.h"
#include "conference/session/call-session-listener.h"
#include "server-group-chat-room.h"
// =============================================================================
LINPHONE_BEGIN_NAMESPACE
class
Participant
;
class
ServerGroupChatRoomPrivate
:
public
ChatRoomPrivate
,
public
CallSessionListener
{
public:
ServerGroupChatRoomPrivate
()
=
default
;
std
::
shared_ptr
<
Participant
>
addParticipant
(
const
IdentityAddress
&
participantAddress
);
void
removeParticipant
(
const
std
::
shared_ptr
<
const
Participant
>
&
participant
);
std
::
shared_ptr
<
Participant
>
findRemovedParticipant
(
const
std
::
shared_ptr
<
const
CallSession
>
&
session
)
const
;
std
::
shared_ptr
<
Participant
>
addParticipant
(
const
IdentityAddress
&
addr
);
void
confirmCreation
();
void
confirmJoining
(
SalCallOp
*
op
);
std
::
shared_ptr
<
Participant
>
findRemovedParticipant
(
const
std
::
shared_ptr
<
const
CallSession
>
&
session
)
const
;
std
::
string
generateConferenceId
()
const
;
void
removeParticipant
(
const
std
::
shared_ptr
<
const
Participant
>
&
participant
);
void
subscribeReceived
(
LinphoneEvent
*
event
);
void
update
(
SalCallOp
*
op
);
void
dispatchMessage
(
const
IdentityAddress
&
fromAddr
,
const
Content
&
content
);
void
dispatchMessage
(
const
IdentityAddress
&
fromAddress
,
const
Content
&
content
);
void
setConferenceAddress
(
const
IdentityAddress
&
conferenceAddress
);
LinphoneReason
onSipMessageReceived
(
SalOp
*
op
,
const
SalMessage
*
message
)
override
;
void
setConferenceAddress
(
const
IdentityAddress
&
confAddr
);
private:
void
designateAdmin
();
...
...
@@ -57,7 +55,11 @@ private:
bool
isAdminLeft
()
const
;
// CallSessionListener
void
onCallSessionStateChanged
(
const
std
::
shared_ptr
<
const
CallSession
>
&
session
,
LinphoneCallState
state
,
const
std
::
string
&
message
)
override
;
void
onCallSessionStateChanged
(
const
std
::
shared_ptr
<
const
CallSession
>
&
session
,
LinphoneCallState
state
,
const
std
::
string
&
message
)
override
;
std
::
list
<
std
::
shared_ptr
<
Participant
>>
removedParticipants
;
...
...
src/chat/chat-room/server-group-chat-room-stub.cpp
View file @
3454bd3a
...
...
@@ -18,7 +18,6 @@
*/
#include "core/core.h"
#include "server-group-chat-room-p.h"
// =============================================================================
...
...
@@ -33,9 +32,7 @@ shared_ptr<Participant> ServerGroupChatRoomPrivate::addParticipant (const Identi
return
nullptr
;
}
void
ServerGroupChatRoomPrivate
::
confirmCreation
()
{}
void
ServerGroupChatRoomPrivate
::
confirmJoining
(
SalCallOp
*
)
{}
void
ServerGroupChatRoomPrivate
::
removeParticipant
(
const
shared_ptr
<
const
Participant
>
&
)
{}
shared_ptr
<
Participant
>
ServerGroupChatRoomPrivate
::
findRemovedParticipant
(
const
shared_ptr
<
const
CallSession
>
&
...
...
@@ -43,12 +40,18 @@ shared_ptr<Participant> ServerGroupChatRoomPrivate::findRemovedParticipant (
return
nullptr
;
}
// -----------------------------------------------------------------------------
void
ServerGroupChatRoomPrivate
::
confirmCreation
()
{}
void
ServerGroupChatRoomPrivate
::
confirmJoining
(
SalCallOp
*
)
{}
// -----------------------------------------------------------------------------
string
ServerGroupChatRoomPrivate
::
generateConferenceId
()
const
{
return
""
;
}
void
ServerGroupChatRoomPrivate
::
removeParticipant
(
const
shared_ptr
<
const
Participant
>
&
)
{}
void
ServerGroupChatRoomPrivate
::
subscribeReceived
(
LinphoneEvent
*
)
{}
void
ServerGroupChatRoomPrivate
::
update
(
SalCallOp
*
)
{}
...
...
@@ -57,12 +60,14 @@ void ServerGroupChatRoomPrivate::update (SalCallOp *) {}
void
ServerGroupChatRoomPrivate
::
dispatchMessage
(
const
IdentityAddress
&
,
const
Content
&
)
{}
void
ServerGroupChatRoomPrivate
::
setConferenceAddress
(
const
IdentityAddress
&
)
{}
// -----------------------------------------------------------------------------
LinphoneReason
ServerGroupChatRoomPrivate
::
onSipMessageReceived
(
SalOp
*
,
const
SalMessage
*
)
{
return
LinphoneReasonNone
;
}
void
ServerGroupChatRoomPrivate
::
setConferenceAddress
(
const
IdentityAddress
&
confAddr
)
{}
// -----------------------------------------------------------------------------
void
ServerGroupChatRoomPrivate
::
designateAdmin
()
{}
...
...
@@ -104,6 +109,10 @@ bool ServerGroupChatRoom::hasBeenLeft () const {
return
true
;
}
const
IdentityAddress
&
ServerGroupChatRoom
::
getConferenceAddress
()
const
{
return
LocalConference
::
getConferenceAddress
();
}
bool
ServerGroupChatRoom
::
canHandleParticipants
()
const
{
return
false
;
}
...
...
@@ -112,10 +121,6 @@ void ServerGroupChatRoom::addParticipant (const IdentityAddress &, const CallSes
void
ServerGroupChatRoom
::
addParticipants
(
const
list
<
IdentityAddress
>
&
,
const
CallSessionParams
*
,
bool
)
{}
const
IdentityAddress
&
ServerGroupChatRoom
::
getConferenceAddress
()
const
{
return
LocalConference
::
getConferenceAddress
();
}
void
ServerGroupChatRoom
::
removeParticipant
(
const
shared_ptr
<
const
Participant
>
&
)
{}
void
ServerGroupChatRoom
::
removeParticipants
(
const
list
<
shared_ptr
<
Participant
>>
&
)
{}
...
...
@@ -136,7 +141,7 @@ const list<shared_ptr<Participant>> &ServerGroupChatRoom::getParticipants () con
return
LocalConference
::
getParticipants
();
}
void
ServerGroupChatRoom
::
setParticipantAdminStatus
(
shared_ptr
<
Participant
>
&
,
bool
)
{}
void
ServerGroupChatRoom
::
setParticipantAdminStatus
(
const
shared_ptr
<
Participant
>
&
,
bool
)
{}
const
string
&
ServerGroupChatRoom
::
getSubject
()
const
{
return
LocalConference
::
getSubject
();
...
...
src/chat/chat-room/server-group-chat-room.h
View file @
3454bd3a
...
...
@@ -20,18 +20,14 @@
#ifndef _SERVER_GROUP_CHAT_ROOM_H_
#define _SERVER_GROUP_CHAT_ROOM_H_
// From coreapi
#include "private.h"
#include "chat/chat-room/chat-room.h"
#include "conference/local-conference.h"
#include "linphone/types.h"
// =============================================================================
LINPHONE_BEGIN_NAMESPACE
class
SalCallOp
;
class
ServerGroupChatRoomPrivate
;
class
ServerGroupChatRoom
:
public
ChatRoom
,
public
LocalConference
{
...
...
@@ -55,19 +51,23 @@ public:
bool
canHandleParticipants
()
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
;
void
addParticipant
(
const
IdentityAddress
&
address
,
const
CallSessionParams
*
params
,
bool
hasMedia
)
override
;
void
addParticipants
(
const
std
::
list
<
IdentityAddress
>
&
addresses
,
const
CallSessionParams
*
params
,
bool
hasMedia
)
override
;
void
removeParticipant
(
const
std
::
shared_ptr
<
const
Participant
>
&
participant
)
override
;
void
removeParticipants
(
const
std
::
list
<
std
::
shared_ptr
<
Participant
>>
&
participants
)
override
;
std
::
shared_ptr
<
Participant
>
findParticipant
(
const
IdentityAddress
&
addr
)
const
override
;
std
::
shared_ptr
<
Participant
>
findParticipant
(
const
IdentityAddress
&
participantAddress
)
const
override
;
std
::
shared_ptr
<
Participant
>
getMe
()
const
override
;
int
getParticipantCount
()
const
override
;
const
std
::
list
<
std
::
shared_ptr
<
Participant
>>
&
getParticipants
()
const
override
;
void
setParticipantAdminStatus
(
std
::
shared_ptr
<
Participant
>
&
participant
,
bool
isAdmin
)
override
;
void
setParticipantAdminStatus
(
const
std
::
shared_ptr
<
Participant
>
&
participant
,
bool
isAdmin
)
override
;
const
std
::
string
&
getSubject
()
const
override
;
void
setSubject
(
const
std
::
string
&
subject
)
override
;
...
...
src/conference/conference-interface.h
View file @
3454bd3a
...
...
@@ -50,7 +50,7 @@ public:
virtual
void
leave
()
=
0
;
virtual
void
removeParticipant
(
const
std
::
shared_ptr
<
const
Participant
>
&
participant
)
=
0
;
virtual
void
removeParticipants
(
const
std
::
list
<
std
::
shared_ptr
<
Participant
>>
&
participants
)
=
0
;
virtual
void
setParticipantAdminStatus
(
std
::
shared_ptr
<
Participant
>
&
participant
,
bool
isAdmin
)
=
0
;
virtual
void
setParticipantAdminStatus
(
const
std
::
shared_ptr
<
Participant
>
&
participant
,
bool
isAdmin
)
=
0
;
virtual
void
setSubject
(
const
std
::
string
&
subject
)
=
0
;
};
...
...
src/conference/conference.cpp
View file @
3454bd3a
...
...
@@ -110,7 +110,7 @@ void Conference::removeParticipants (const list<shared_ptr<Participant>> &partic
removeParticipant
(
p
);
}
void
Conference
::
setParticipantAdminStatus
(
shared_ptr
<
Participant
>
&
participant
,
bool
isAdmin
)
{
void
Conference
::
setParticipantAdminStatus
(
const
shared_ptr
<
Participant
>
&
participant
,
bool
isAdmin
)
{
lError
()
<<
"Conference class does not handle setParticipantAdminStatus() generically"
;
}
...
...
src/conference/conference.h
View file @
3454bd3a
...
...
@@ -60,7 +60,7 @@ public:
void
leave
()
override
;
void
removeParticipant
(
const
std
::
shared_ptr
<
const
Participant
>
&
participant
)
override
;
void
removeParticipants
(
const
std
::
list
<
std
::
shared_ptr
<
Participant
>>
&
participants
)
override
;
void
setParticipantAdminStatus
(
std
::
shared_ptr
<
Participant
>
&
participant
,
bool
isAdmin
)
override
;
void
setParticipantAdminStatus
(
const
std
::
shared_ptr
<
Participant
>
&
participant
,
bool
isAdmin
)
override
;
void
setSubject
(
const
std
::
string
&
subject
)
override
;
protected:
...
...
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