Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linphone
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
7
Issues
7
List
Board
Labels
Milestones
Merge Requests
9
Merge Requests
9
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
linphone
Commits
d60b5fab
Commit
d60b5fab
authored
Oct 06, 2017
by
Ronan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(EventsDb): import correctly legacy messages
parent
32e22abe
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
185 additions
and
136 deletions
+185
-136
general.h
include/linphone/utils/general.h
+2
-0
content.cpp
src/content/content.cpp
+4
-2
content.h
src/content/content.h
+1
-1
abstract-db.cpp
src/db/abstract/abstract-db.cpp
+20
-6
abstract-db.h
src/db/abstract/abstract-db.h
+2
-1
events-db.cpp
src/db/events-db.cpp
+151
-123
object-p.h
src/object/object-p.h
+1
-1
object.cpp
src/object/object.cpp
+4
-2
No files found.
include/linphone/utils/general.h
View file @
d60b5fab
...
...
@@ -117,9 +117,11 @@ constexpr T *getPublicHelper (Object *object, const ObjectPrivate *) {
#define L_DECLARE_PUBLIC(CLASS) \
inline CLASS *getPublic () { \
L_ASSERT(mPublic); \
return getPublicHelper<CLASS>(mPublic, this); \
} \
inline const CLASS *getPublic () const { \
L_ASSERT(mPublic); \
return getPublicHelper<const CLASS>(mPublic, this); \
} \
friend class CLASS;
...
...
src/content/content.cpp
View file @
d60b5fab
...
...
@@ -72,9 +72,11 @@ Content &Content::operator= (Content &&src) {
return
*
this
;
}
bool
Content
::
operator
==
(
const
Content
&
content
)
const
{
bool
Content
::
operator
==
(
const
Content
&
content
)
const
{
L_D
();
return
d
->
contentType
==
content
.
getContentType
()
&&
d
->
body
==
content
.
getBody
()
&&
d
->
contentDisposition
==
content
.
getContentDisposition
();
return
d
->
contentType
==
content
.
getContentType
()
&&
d
->
body
==
content
.
getBody
()
&&
d
->
contentDisposition
==
content
.
getContentDisposition
();
}
const
ContentType
&
Content
::
getContentType
()
const
{
...
...
src/content/content.h
View file @
d60b5fab
...
...
@@ -39,7 +39,7 @@ public:
Content
&
operator
=
(
const
Content
&
src
);
Content
&
operator
=
(
Content
&&
src
);
bool
operator
==
(
const
Content
&
content
)
const
;
bool
operator
==
(
const
Content
&
content
)
const
;
const
ContentType
&
getContentType
()
const
;
void
setContentType
(
const
ContentType
&
contentType
);
...
...
src/db/abstract/abstract-db.cpp
View file @
d60b5fab
...
...
@@ -17,6 +17,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifdef SOCI_ENABLED
#include <soci/soci.h>
#endif // ifdef SOCI_ENABLED
#include "abstract-db-p.h"
#include "db/provider/db-session-provider.h"
#include "logger/logger.h"
...
...
@@ -86,17 +90,27 @@ string AbstractDb::primaryKeyAutoIncrementStr (const string &type) const {
return
""
;
}
string
AbstractDb
::
insertOrIgnoreStr
()
const
{
long
AbstractDb
::
getLastInsertId
()
const
{
L_D
();
switch
(
d
->
backend
)
{
case
Mysql
:
return
"INSERT IGNORE INTO "
;
string
sql
;
switch
(
d
->
backend
)
{
case
Sqlite3
:
return
"INSERT OR IGNORE INTO "
;
sql
=
"SELECT last_insert_rowid()"
;
break
;
default
:
lWarning
()
<<
"Unsupported backend."
;
return
-
1
;
}
return
""
;
long
result
=
0
;
#ifdef SOCI_ENABLED
soci
::
session
*
session
=
d
->
dbSession
.
getBackendSession
<
soci
::
session
>
();
*
session
<<
sql
,
soci
::
into
(
result
);
#endif // ifdef SOCI_ENABLED
return
result
;
}
LINPHONE_END_NAMESPACE
src/db/abstract/abstract-db.h
View file @
d60b5fab
...
...
@@ -52,7 +52,8 @@ protected:
virtual
void
init
();
std
::
string
primaryKeyAutoIncrementStr
(
const
std
::
string
&
type
=
"INT"
)
const
;
std
::
string
insertOrIgnoreStr
()
const
;
long
getLastInsertId
()
const
;
private
:
L_DECLARE_PRIVATE
(
AbstractDb
);
...
...
src/db/events-db.cpp
View file @
d60b5fab
This diff is collapsed.
Click to expand it.
src/object/object-p.h
View file @
d60b5fab
...
...
@@ -36,7 +36,7 @@ public:
virtual
~
ObjectPrivate
()
=
default
;
protected
:
Object
*
mPublic
;
Object
*
mPublic
=
nullptr
;
private
:
std
::
unordered_map
<
std
::
string
,
Variant
>
properties
;
...
...
src/object/object.cpp
View file @
d60b5fab
...
...
@@ -30,12 +30,14 @@ using namespace std;
LINPHONE_BEGIN_NAMESPACE
Object
::
Object
(
ObjectPrivate
&
p
)
:
mPrivate
(
&
p
)
{
mPrivate
->
mPublic
=
this
;
}
Object
::~
Object
()
{
delete
mPrivate
;
}
Object
::
Object
(
ObjectPrivate
&
p
)
:
mPrivate
(
&
p
)
{}
shared_ptr
<
Object
>
Object
::
getSharedFromThis
()
{
return
const_pointer_cast
<
Object
>
(
static_cast
<
const
Object
*>
(
this
)
->
getSharedFromThis
());
}
...
...
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