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
fe8930ce
Commit
fe8930ce
authored
Dec 22, 2017
by
Benjamin REIS
Browse files
notify fallbacked chat room creation
parent
554ad75c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
1 deletion
+23
-1
src/chat/chat-room/abstract-chat-room.h
src/chat/chat-room/abstract-chat-room.h
+1
-0
src/chat/chat-room/basic-chat-room.h
src/chat/chat-room/basic-chat-room.h
+1
-0
src/chat/chat-room/client-group-to-basic-chat-room.cpp
src/chat/chat-room/client-group-to-basic-chat-room.cpp
+6
-1
src/core/core-chat-room.cpp
src/core/core-chat-room.cpp
+14
-0
src/core/core.h
src/core/core.h
+1
-0
No files found.
src/chat/chat-room/abstract-chat-room.h
View file @
fe8930ce
...
...
@@ -37,6 +37,7 @@ class EventLog;
class
LINPHONE_PUBLIC
AbstractChatRoom
:
public
Object
,
public
CoreAccessor
,
public
ConferenceInterface
{
friend
class
ChatMessage
;
friend
class
ChatMessagePrivate
;
friend
class
ClientGroupToBasicChatRoomPrivate
;
friend
class
CorePrivate
;
friend
class
MainDb
;
friend
class
ProxyChatRoomPrivate
;
...
...
src/chat/chat-room/basic-chat-room.h
View file @
fe8930ce
...
...
@@ -29,6 +29,7 @@ LINPHONE_BEGIN_NAMESPACE
class
BasicChatRoomPrivate
;
class
LINPHONE_PUBLIC
BasicChatRoom
:
public
ChatRoom
{
friend
class
Core
;
friend
class
CorePrivate
;
public:
...
...
src/chat/chat-room/client-group-to-basic-chat-room.cpp
View file @
fe8930ce
...
...
@@ -68,7 +68,12 @@ public:
cgcr
->
getPrivate
()
->
setChatRoomListener
(
nullptr
);
Core
::
deleteChatRoom
(
q
->
getSharedFromThis
());
LinphoneChatRoom
*
lcr
=
L_GET_C_BACK_PTR
(
q
);
L_SET_CPP_PTR_FROM_C_OBJECT
(
lcr
,
cgcr
->
getCore
()
->
getOrCreateBasicChatRoom
(
invitedAddresses
.
front
()));
shared_ptr
<
AbstractChatRoom
>
bcr
=
cgcr
->
getCore
()
->
onlyGetOrCreateBasicChatRoom
(
invitedAddresses
.
front
());
L_SET_CPP_PTR_FROM_C_OBJECT
(
lcr
,
bcr
);
bcr
->
getPrivate
()
->
setState
(
ChatRoom
::
State
::
Instantiated
);
bcr
->
getPrivate
()
->
setState
(
ChatRoom
::
State
::
Created
);
cgcr
->
getCore
()
->
getPrivate
()
->
insertChatRoom
(
bcr
);
cgcr
->
getCore
()
->
getPrivate
()
->
insertChatRoomWithDb
(
bcr
);
return
;
}
cgcr
->
getPrivate
()
->
onCallSessionStateChanged
(
session
,
newState
,
message
);
...
...
src/core/core-chat-room.cpp
View file @
fe8930ce
...
...
@@ -185,6 +185,20 @@ shared_ptr<AbstractChatRoom> Core::createClientGroupChatRoom (const string &subj
return
d
->
createClientGroupChatRoom
(
subject
,
true
);
}
shared_ptr
<
AbstractChatRoom
>
Core
::
onlyGetOrCreateBasicChatRoom
(
const
IdentityAddress
&
peerAddress
,
bool
isRtt
)
{
list
<
shared_ptr
<
AbstractChatRoom
>>
chatRooms
=
findChatRooms
(
peerAddress
);
if
(
!
chatRooms
.
empty
())
return
chatRooms
.
front
();
const
ChatRoomId
&
chatRoomId
=
ChatRoomId
(
peerAddress
,
getDefaultLocalAddress
(
getSharedFromThis
(),
peerAddress
));
shared_ptr
<
AbstractChatRoom
>
chatRoom
;
BasicChatRoom
*
basicChatRoom
=
new
BasicChatRoom
(
getSharedFromThis
(),
chatRoomId
);
chatRoom
.
reset
(
basicChatRoom
);
return
chatRoom
;
}
shared_ptr
<
AbstractChatRoom
>
Core
::
getOrCreateBasicChatRoom
(
const
ChatRoomId
&
chatRoomId
,
bool
isRtt
)
{
L_D
();
...
...
src/core/core.h
View file @
fe8930ce
...
...
@@ -107,6 +107,7 @@ public:
const
IdentityAddress
&
localAddress
);
std
::
shared_ptr
<
AbstractChatRoom
>
onlyGetOrCreateBasicChatRoom
(
const
IdentityAddress
&
peerAddress
,
bool
isRtt
=
false
);
std
::
shared_ptr
<
AbstractChatRoom
>
getOrCreateBasicChatRoom
(
const
ChatRoomId
&
chatRoomId
,
bool
isRtt
=
false
);
std
::
shared_ptr
<
AbstractChatRoom
>
getOrCreateBasicChatRoom
(
const
IdentityAddress
&
peerAddress
,
bool
isRtt
=
false
);
...
...
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