Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
liblinphone
Commits
90b653f6
Commit
90b653f6
authored
Nov 22, 2017
by
Ronan
Browse files
fix(chat-room): hide public onChatMessageReceived handler!
parent
ec2ffd8a
Changes
20
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
56 additions
and
56 deletions
+56
-56
src/c-wrapper/api/c-chat-message.cpp
src/c-wrapper/api/c-chat-message.cpp
+3
-4
src/chat/chat-message/chat-message.cpp
src/chat/chat-message/chat-message.cpp
+3
-3
src/chat/chat-room/basic-chat-room-p.h
src/chat/chat-room/basic-chat-room-p.h
+2
-0
src/chat/chat-room/basic-chat-room.cpp
src/chat/chat-room/basic-chat-room.cpp
+6
-3
src/chat/chat-room/basic-chat-room.h
src/chat/chat-room/basic-chat-room.h
+0
-3
src/chat/chat-room/chat-room-p.h
src/chat/chat-room/chat-room-p.h
+2
-0
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
-2
src/chat/chat-room/client-group-chat-room-p.h
src/chat/chat-room/client-group-chat-room-p.h
+2
-0
src/chat/chat-room/client-group-chat-room.cpp
src/chat/chat-room/client-group-chat-room.cpp
+2
-2
src/chat/chat-room/client-group-chat-room.h
src/chat/chat-room/client-group-chat-room.h
+0
-2
src/chat/chat-room/server-group-chat-room-p.h
src/chat/chat-room/server-group-chat-room-p.h
+2
-0
src/chat/chat-room/server-group-chat-room-stub.cpp
src/chat/chat-room/server-group-chat-room-stub.cpp
+2
-2
src/chat/chat-room/server-group-chat-room.h
src/chat/chat-room/server-group-chat-room.h
+0
-1
src/content/content.cpp
src/content/content.cpp
+0
-2
src/content/content.h
src/content/content.h
+2
-3
src/content/file-content.cpp
src/content/file-content.cpp
+6
-9
src/content/file-content.h
src/content/file-content.h
+10
-10
src/core/core.cpp
src/core/core.cpp
+6
-2
src/core/core.h
src/core/core.h
+7
-7
No files found.
src/c-wrapper/api/c-chat-message.cpp
View file @
90b653f6
...
...
@@ -292,11 +292,10 @@ bool_t linphone_chat_message_has_text_content(const LinphoneChatMessage *msg) {
return
L_GET_PRIVATE_FROM_C_OBJECT
(
msg
)
->
hasTextContent
();
}
const
char
*
linphone_chat_message_get_text_content
(
const
LinphoneChatMessage
*
msg
)
{
const
char
*
linphone_chat_message_get_text_content
(
const
LinphoneChatMessage
*
msg
)
{
const
LinphonePrivate
::
Content
*
content
=
L_GET_PRIVATE_FROM_C_OBJECT
(
msg
)
->
getTextContent
();
if
(
*
content
==
LinphonePrivate
::
Content
::
Empty
)
{
return
NULL
;
}
if
(
content
->
isEmpty
())
return
nullptr
;
return
L_STRING_TO_C
(
content
->
getBodyAsString
());
}
...
...
src/chat/chat-message/chat-message.cpp
View file @
90b653f6
...
...
@@ -159,7 +159,7 @@ const Content* ChatMessagePrivate::getTextContent() const {
return
c
;
}
}
return
&
Content
::
Empty
;
return
&
Utils
::
getEmptyConstRefObject
<
Content
>
()
;
}
bool
ChatMessagePrivate
::
hasFileTransferContent
()
const
{
...
...
@@ -177,7 +177,7 @@ const Content* ChatMessagePrivate::getFileTransferContent() const {
return
c
;
}
}
return
&
Content
::
Empty
;
return
&
Utils
::
getEmptyConstRefObject
<
Content
>
()
;
}
const
string
&
ChatMessagePrivate
::
getFileTransferFilepath
()
const
{
...
...
@@ -414,7 +414,7 @@ void ChatMessagePrivate::sendImdn (Imdn::Type imdnType, LinphoneReason reason) {
L_Q
();
shared_ptr
<
ChatMessage
>
msg
=
q
->
getChatRoom
()
->
createMessage
();
Content
*
content
=
new
Content
();
content
->
setContentType
(
"message/imdn+xml"
);
content
->
setBody
(
createImdnXml
(
imdnType
,
reason
));
...
...
src/chat/chat-room/basic-chat-room-p.h
View file @
90b653f6
...
...
@@ -32,6 +32,8 @@ public:
BasicChatRoomPrivate
()
=
default
;
private:
void
onChatMessageReceived
(
const
std
::
shared_ptr
<
ChatMessage
>
&
chatMessage
)
override
;
std
::
string
subject
;
L_DECLARE_PUBLIC
(
BasicChatRoom
);
...
...
src/chat/chat-room/basic-chat-room.cpp
View file @
90b653f6
...
...
@@ -29,6 +29,12 @@ using namespace std;
LINPHONE_BEGIN_NAMESPACE
// -----------------------------------------------------------------------------
void
BasicChatRoomPrivate
::
onChatMessageReceived
(
const
shared_ptr
<
ChatMessage
>
&
)
{}
// -----------------------------------------------------------------------------
BasicChatRoom
::
BasicChatRoom
(
const
shared_ptr
<
Core
>
&
core
,
const
ChatRoomId
&
chatRoomId
)
:
ChatRoom
(
*
new
BasicChatRoomPrivate
,
core
,
chatRoomId
)
{}
...
...
@@ -107,7 +113,4 @@ void BasicChatRoom::leave () {
lError
()
<<
"leave() is not allowed on a BasicChatRoom"
;
}
// TODO: Move me in BasicChatRoomPrivate.
void
BasicChatRoom
::
onChatMessageReceived
(
const
shared_ptr
<
ChatMessage
>
&
)
{}
LINPHONE_END_NAMESPACE
src/chat/chat-room/basic-chat-room.h
View file @
90b653f6
...
...
@@ -64,9 +64,6 @@ protected:
private:
BasicChatRoom
(
const
std
::
shared_ptr
<
Core
>
&
core
,
const
ChatRoomId
&
chatRoomId
);
// TODO: Remove me. Move me in private object.
void
onChatMessageReceived
(
const
std
::
shared_ptr
<
ChatMessage
>
&
msg
)
override
;
L_DECLARE_PRIVATE
(
BasicChatRoom
);
L_DISABLE_COPY
(
BasicChatRoom
);
};
...
...
src/chat/chat-room/chat-room-p.h
View file @
90b653f6
...
...
@@ -97,6 +97,8 @@ public:
// TODO: Check all fields before this point.
public:
virtual
void
onChatMessageReceived
(
const
std
::
shared_ptr
<
ChatMessage
>
&
chatMessage
)
=
0
;
ChatRoomId
chatRoomId
;
time_t
creationTime
=
-
1
;
...
...
src/chat/chat-room/chat-room.cpp
View file @
90b653f6
...
...
@@ -306,7 +306,7 @@ void ChatRoomPrivate::chatMessageReceived (const shared_ptr<ChatMessage> &msg) {
L_Q
();
if
((
msg
->
getPrivate
()
->
getContentType
()
!=
ContentType
::
Imdn
)
&&
(
msg
->
getPrivate
()
->
getContentType
()
!=
ContentType
::
ImIsComposing
))
{
q
->
onChatMessageReceived
(
msg
);
onChatMessageReceived
(
msg
);
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 @
90b653f6
...
...
@@ -81,8 +81,6 @@ public:
protected:
explicit
ChatRoom
(
ChatRoomPrivate
&
p
,
const
std
::
shared_ptr
<
Core
>
&
core
,
const
ChatRoomId
&
chatRoomId
);
virtual
void
onChatMessageReceived
(
const
std
::
shared_ptr
<
ChatMessage
>
&
msg
)
=
0
;
private:
L_DECLARE_PRIVATE
(
ChatRoom
);
L_DISABLE_COPY
(
ChatRoom
);
...
...
src/chat/chat-room/client-group-chat-room-p.h
View file @
90b653f6
...
...
@@ -37,6 +37,8 @@ public:
void
multipartNotifyReceived
(
const
std
::
string
&
body
);
private:
void
onChatMessageReceived
(
const
std
::
shared_ptr
<
ChatMessage
>
&
chatMessage
)
override
;
L_DECLARE_PUBLIC
(
ClientGroupChatRoom
);
};
...
...
src/chat/chat-room/client-group-chat-room.cpp
View file @
90b653f6
...
...
@@ -79,6 +79,8 @@ void ClientGroupChatRoomPrivate::multipartNotifyReceived (const string &body) {
qConference
->
getPrivate
()
->
eventHandler
->
multipartNotifyReceived
(
body
);
}
void
ClientGroupChatRoomPrivate
::
onChatMessageReceived
(
const
shared_ptr
<
ChatMessage
>
&
)
{}
// =============================================================================
ClientGroupChatRoom
::
ClientGroupChatRoom
(
...
...
@@ -262,8 +264,6 @@ void ClientGroupChatRoom::leave () {
// -----------------------------------------------------------------------------
void
ClientGroupChatRoom
::
onChatMessageReceived
(
const
shared_ptr
<
ChatMessage
>
&
msg
)
{}
void
ClientGroupChatRoom
::
onConferenceCreated
(
const
IdentityAddress
&
addr
)
{
L_D
();
L_D_T
(
RemoteConference
,
dConference
);
...
...
src/chat/chat-room/client-group-chat-room.h
View file @
90b653f6
...
...
@@ -71,8 +71,6 @@ private:
// TODO: Move me in ClientGroupChatRoomPrivate.
// ALL METHODS AFTER THIS POINT.
void
onChatMessageReceived
(
const
std
::
shared_ptr
<
ChatMessage
>
&
msg
)
override
;
void
onConferenceCreated
(
const
IdentityAddress
&
addr
)
override
;
void
onConferenceTerminated
(
const
IdentityAddress
&
addr
)
override
;
void
onFirstNotifyReceived
(
const
IdentityAddress
&
addr
)
override
;
...
...
src/chat/chat-room/server-group-chat-room-p.h
View file @
90b653f6
...
...
@@ -56,6 +56,8 @@ private:
void
finalizeCreation
();
bool
isAdminLeft
()
const
;
void
onChatMessageReceived
(
const
std
::
shared_ptr
<
ChatMessage
>
&
)
override
;
std
::
list
<
std
::
shared_ptr
<
Participant
>>
removedParticipants
;
L_DECLARE_PUBLIC
(
ServerGroupChatRoom
);
...
...
src/chat/chat-room/server-group-chat-room-stub.cpp
View file @
90b653f6
...
...
@@ -75,6 +75,8 @@ bool ServerGroupChatRoomPrivate::isAdminLeft () const {
return
false
;
}
void
ServerGroupChatRoomPrivate
::
onChatMessageReceived
(
const
shared_ptr
<
ChatMessage
>
&
)
{}
// =============================================================================
ServerGroupChatRoom
::
ServerGroupChatRoom
(
const
shared_ptr
<
Core
>
&
core
,
SalCallOp
*
op
)
:
...
...
@@ -131,8 +133,6 @@ void ServerGroupChatRoom::leave () {}
// -----------------------------------------------------------------------------
void
ServerGroupChatRoom
::
onChatMessageReceived
(
const
shared_ptr
<
ChatMessage
>
&
msg
)
{}
void
ServerGroupChatRoom
::
onCallSessionStateChanged
(
const
shared_ptr
<
const
CallSession
>
&
,
LinphoneCallState
,
...
...
src/chat/chat-room/server-group-chat-room.h
View file @
90b653f6
...
...
@@ -67,7 +67,6 @@ public:
private:
// TODO: Move me in ServerGroupChatRoomPrivate.
void
onChatMessageReceived
(
const
std
::
shared_ptr
<
ChatMessage
>
&
msg
)
override
;
void
onCallSessionStateChanged
(
const
std
::
shared_ptr
<
const
CallSession
>
&
session
,
LinphoneCallState
state
,
const
std
::
string
&
message
)
override
;
L_DECLARE_PRIVATE
(
ServerGroupChatRoom
);
...
...
src/content/content.cpp
View file @
90b653f6
...
...
@@ -29,8 +29,6 @@ using namespace std;
LINPHONE_BEGIN_NAMESPACE
const
Content
Content
::
Empty
;
// -----------------------------------------------------------------------------
Content
::
Content
()
:
ClonableObject
(
*
new
ContentPrivate
)
{}
...
...
src/content/content.h
View file @
90b653f6
...
...
@@ -67,9 +67,8 @@ public:
bool
isEmpty
()
const
;
virtual
LinphoneContent
*
toLinphoneContent
()
const
;
static
const
Content
Empty
;
// TODO: Remove me later.
virtual
LinphoneContent
*
toLinphoneContent
()
const
;
protected:
explicit
Content
(
ContentPrivate
&
p
);
...
...
src/content/file-content.cpp
View file @
90b653f6
...
...
@@ -36,9 +36,7 @@ public:
// -----------------------------------------------------------------------------
FileContent
::
FileContent
()
:
Content
(
*
new
FileContentPrivate
())
{
}
FileContent
::
FileContent
()
:
Content
(
*
new
FileContentPrivate
())
{}
FileContent
::
FileContent
(
const
FileContent
&
src
)
:
Content
(
*
new
FileContentPrivate
)
{
L_D
();
...
...
@@ -102,20 +100,19 @@ const string& FileContent::getFileName() const {
L_D
();
return
d
->
fileName
;
}
void
FileContent
::
setFilePath
(
const
string
&
path
)
{
void
FileContent
::
setFilePath
(
const
string
&
path
)
{
L_D
();
d
->
filePath
=
path
;
}
const
string
&
FileContent
::
getFilePath
()
const
{
const
string
&
FileContent
::
getFilePath
()
const
{
L_D
();
return
d
->
filePath
;
}
LinphoneContent
*
FileContent
::
toLinphoneContent
()
const
{
LinphoneContent
*
content
;
content
=
linphone_core_create_content
(
NULL
);
LinphoneContent
*
FileContent
::
toLinphoneContent
()
const
{
LinphoneContent
*
content
=
linphone_core_create_content
(
nullptr
);
linphone_content_set_type
(
content
,
getContentType
().
getType
().
c_str
());
linphone_content_set_subtype
(
content
,
getContentType
().
getSubType
().
c_str
());
linphone_content_set_name
(
content
,
getFileName
().
c_str
());
...
...
src/content/file-content.h
View file @
90b653f6
...
...
@@ -30,7 +30,7 @@ class FileContentPrivate;
class
LINPHONE_PUBLIC
FileContent
:
public
Content
{
public:
FileContent
();
FileContent
();
FileContent
(
const
FileContent
&
src
);
FileContent
(
FileContent
&&
src
);
...
...
@@ -38,16 +38,16 @@ public:
FileContent
&
operator
=
(
FileContent
&&
src
);
bool
operator
==
(
const
FileContent
&
content
)
const
;
void
setFileSize
(
size_t
size
);
size_t
getFileSize
()
const
;
void
setFileName
(
const
std
::
string
&
name
);
const
std
::
string
&
getFileName
()
const
;
void
setFilePath
(
const
std
::
string
&
path
);
const
std
::
string
&
getFilePath
()
const
;
void
setFileSize
(
size_t
size
);
size_t
getFileSize
()
const
;
LinphoneContent
*
toLinphoneContent
()
const
override
;
void
setFileName
(
const
std
::
string
&
name
);
const
std
::
string
&
getFileName
()
const
;
void
setFilePath
(
const
std
::
string
&
path
);
const
std
::
string
&
getFilePath
()
const
;
LinphoneContent
*
toLinphoneContent
()
const
override
;
private:
L_DECLARE_PRIVATE
(
FileContent
);
...
...
src/core/core.cpp
View file @
90b653f6
...
...
@@ -24,10 +24,10 @@
// TODO: Remove me later.
#include "c-wrapper/c-wrapper.h"
// =============================================================================
#define LINPHONE_DB "linphone.db"
// =============================================================================
using
namespace
std
;
LINPHONE_BEGIN_NAMESPACE
...
...
@@ -73,6 +73,10 @@ LinphoneCore *Core::getCCore () const {
return
d
->
cCore
;
}
// -----------------------------------------------------------------------------
// Paths.
// -----------------------------------------------------------------------------
string
Core
::
getDataPath
()
const
{
L_D
();
return
Paths
::
getPath
(
Paths
::
Data
,
static_cast
<
PlatformHelpers
*>
(
d
->
cCore
->
platform_helper
));
...
...
src/core/core.h
View file @
90b653f6
...
...
@@ -58,13 +58,6 @@ public:
// TODO: Remove me later.
LinphoneCore
*
getCCore
()
const
;
// ---------------------------------------------------------------------------
// Paths.
// ---------------------------------------------------------------------------
std
::
string
getDataPath
()
const
;
std
::
string
getConfigPath
()
const
;
// ---------------------------------------------------------------------------
// ChatRoom.
// ---------------------------------------------------------------------------
...
...
@@ -84,6 +77,13 @@ public:
static
void
deleteChatRoom
(
const
std
::
shared_ptr
<
const
ChatRoom
>
&
chatRoom
);
// ---------------------------------------------------------------------------
// Paths.
// ---------------------------------------------------------------------------
std
::
string
getDataPath
()
const
;
std
::
string
getConfigPath
()
const
;
private:
Core
();
...
...
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