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
58c94c86
Commit
58c94c86
authored
Oct 18, 2017
by
Ronan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(Core): database access in progress
parent
bebcee53
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
45 additions
and
9 deletions
+45
-9
CMakeLists.txt
src/CMakeLists.txt
+1
-0
core.cpp
src/core/core.cpp
+26
-5
core.h
src/core/core.h
+9
-4
main-db.cpp
src/db/main-db.cpp
+8
-0
main-db.h
src/db/main-db.h
+1
-0
No files found.
src/CMakeLists.txt
View file @
58c94c86
...
...
@@ -79,6 +79,7 @@ set(LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES
conference/session/port-config.h
content/content-type.h
content/content.h
core/core-p.h
core/core.h
db/abstract/abstract-db-p.h
db/abstract/abstract-db.h
...
...
src/core/core.cpp
View file @
58c94c86
...
...
@@ -17,21 +17,42 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include <algorithm>
#include "address/address.h"
#include "chat/chat-room/basic-chat-room.h"
#include "core-p.h"
#include "db/main-db.h"
#include "object/object-p.h"
#include "core.h"
// =============================================================================
using
namespace
std
;
LINPHONE_BEGIN_NAMESPACE
class
CorePrivate
:
public
ObjectPrivate
{
public
:
// TODO.
};
// -----------------------------------------------------------------------------
Core
::
Core
()
:
Object
(
*
new
CorePrivate
)
{}
// -----------------------------------------------------------------------------
Core
::
Core
(
CorePrivate
&
p
)
:
Object
(
p
)
{}
shared_ptr
<
ChatRoom
>
Core
::
createClientGroupChatRoom
(
const
string
&
subject
)
{
// TODO.
return
shared_ptr
<
ChatRoom
>
();
}
shared_ptr
<
ChatRoom
>
Core
::
getOrCreateChatRoom
(
const
string
&
peerAddress
,
bool
isRtt
)
const
{
return
shared_ptr
<
ChatRoom
>
();
}
const
list
<
shared_ptr
<
ChatRoom
>>
&
Core
::
getChatRooms
()
const
{
L_D
();
return
d
->
chatRooms
;
}
// -----------------------------------------------------------------------------
LINPHONE_END_NAMESPACE
src/core/core.h
View file @
58c94c86
...
...
@@ -20,21 +20,26 @@
#ifndef _CORE_H_
#define _CORE_H_
#include "object/object.h"
#include <list>
#include "chat/chat-room/chat-room.h"
// =============================================================================
LINPHONE_BEGIN_NAMESPACE
class
ChatRoom
;
class
CorePrivate
;
class
LINPHONE_PUBLIC
Core
:
public
Object
{
public
:
// Nothing for the moment.
Core
();
private
:
explicit
Core
(
CorePrivate
&
p
);
std
::
shared_ptr
<
ChatRoom
>
createClientGroupChatRoom
(
const
std
::
string
&
subject
);
std
::
shared_ptr
<
ChatRoom
>
getOrCreateChatRoom
(
const
std
::
string
&
peerAddress
,
bool
isRtt
=
false
)
const
;
const
std
::
list
<
std
::
shared_ptr
<
ChatRoom
>>
&
getChatRooms
()
const
;
private
:
L_DECLARE_PRIVATE
(
Core
);
L_DISABLE_COPY
(
Core
);
};
...
...
src/db/main-db.cpp
View file @
58c94c86
...
...
@@ -854,6 +854,12 @@ MainDb::MainDb () : AbstractDb(*new MainDbPrivate) {}
// -----------------------------------------------------------------------------
list
<
shared_ptr
<
ChatRoom
>>
MainDb
::
getChatRooms
()
const
{
list
<
shared_ptr
<
ChatRoom
>>
chatRooms
;
// TODO.
return
chatRooms
;
}
shared_ptr
<
ChatRoom
>
MainDb
::
findChatRoom
(
const
string
&
peerAddress
)
const
{
L_D
();
...
...
@@ -875,6 +881,8 @@ shared_ptr<ChatRoom> MainDb::findChatRoom (const string &peerAddress) const {
" )"
,
soci
::
use
(
peerAddress
),
soci
::
into
(
creationDate
),
soci
::
into
(
lastUpdateDate
),
soci
::
use
(
capabilities
),
soci
::
use
(
subject
);
// TODO.
L_END_LOG_EXCEPTION
return
shared_ptr
<
ChatRoom
>
();
...
...
src/db/main-db.h
View file @
58c94c86
...
...
@@ -70,6 +70,7 @@ public:
void
cleanHistory
(
const
std
::
string
&
peerAddress
=
""
,
FilterMask
mask
=
NoFilter
);
// ChatRooms.
std
::
list
<
std
::
shared_ptr
<
ChatRoom
>>
getChatRooms
()
const
;
std
::
shared_ptr
<
ChatRoom
>
findChatRoom
(
const
std
::
string
&
peerAddress
)
const
;
// Import legacy messages from old db.
...
...
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