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
1f46a567
Commit
1f46a567
authored
Sep 05, 2017
by
Ronan
Browse files
feat(core): many fixes
parent
0feb3684
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
65 additions
and
19 deletions
+65
-19
coreapi/bellesip_sal/sal_address_impl.c
coreapi/bellesip_sal/sal_address_impl.c
+1
-2
src/chat/imdn.h
src/chat/imdn.h
+2
-1
src/chat/is-composing-listener.h
src/chat/is-composing-listener.h
+1
-1
src/chat/is-composing.h
src/chat/is-composing.h
+2
-1
src/db/events-db.cpp
src/db/events-db.cpp
+45
-0
tester/CMakeLists.txt
tester/CMakeLists.txt
+1
-1
tester/cpim-tester.cpp
tester/cpim-tester.cpp
+13
-13
No files found.
coreapi/bellesip_sal/sal_address_impl.c
View file @
1f46a567
...
...
@@ -33,7 +33,7 @@ SalAddress * sal_address_new(const char *uri){
}
SalAddress
*
sal_address_clone
(
const
SalAddress
*
addr
){
return
(
SalAddress
*
)
belle_sip_object_ref
(
belle_sip_
object
_clone
(
BELLE_SIP_
OBJECT
(
addr
)));
return
(
SalAddress
*
)
belle_sip_object_ref
(
belle_sip_
header_address
_clone
(
BELLE_SIP_
HEADER_ADDRESS
(
addr
)));
}
const
char
*
sal_address_get_scheme
(
const
SalAddress
*
addr
){
...
...
@@ -277,4 +277,3 @@ bool_t sal_address_is_ipv6(const SalAddress *addr){
void
sal_address_destroy
(
SalAddress
*
addr
){
sal_address_unref
(
addr
);
}
src/chat/imdn.h
View file @
1f46a567
...
...
@@ -21,8 +21,9 @@
#include <string>
#include "linphone/utils/general.h"
#include "chat-room.h"
#include "utils/general.h"
#include "private.h"
...
...
src/chat/is-composing-listener.h
View file @
1f46a567
...
...
@@ -19,7 +19,7 @@
#ifndef _IS_COMPOSING_LISTENER_H_
#define _IS_COMPOSING_LISTENER_H_
#include "utils/general.h"
#include "
linphone/
utils/general.h"
// =============================================================================
...
...
src/chat/is-composing.h
View file @
1f46a567
...
...
@@ -21,8 +21,9 @@
#include <string>
#include "linphone/utils/general.h"
#include "is-composing-listener.h"
#include "utils/general.h"
#include "private.h"
...
...
src/db/events-db.cpp
View file @
1f46a567
...
...
@@ -250,6 +250,11 @@ EventsDb::EventsDb () : AbstractDb(*new EventsDbPrivate) {}
}
bool
EventsDb
::
addEvent
(
const
EventLog
&
eventLog
)
{
if
(
!
isConnected
())
{
lWarning
()
<<
"Unable to add event. Not connected."
;
return
false
;
}
// TODO.
switch
(
eventLog
.
getType
())
{
case
EventLog
::
TypeNone
:
...
...
@@ -270,12 +275,22 @@ EventsDb::EventsDb () : AbstractDb(*new EventsDbPrivate) {}
}
bool
EventsDb
::
deleteEvent
(
const
EventLog
&
eventLog
)
{
if
(
!
isConnected
())
{
lWarning
()
<<
"Unable to delete event. Not connected."
;
return
false
;
}
// TODO.
(
void
)
eventLog
;
return
true
;
}
void
EventsDb
::
cleanEvents
(
FilterMask
mask
)
{
if
(
!
isConnected
())
{
lWarning
()
<<
"Unable to clean events. Not connected."
;
return
;
}
// TODO.
(
void
)
mask
;
}
...
...
@@ -283,6 +298,11 @@ EventsDb::EventsDb () : AbstractDb(*new EventsDbPrivate) {}
int
EventsDb
::
getEventsCount
(
FilterMask
mask
)
const
{
L_D
(
const
EventsDb
);
if
(
!
isConnected
())
{
lWarning
()
<<
"Unable to get events count. Not connected."
;
return
0
;
}
string
query
=
"SELECT COUNT(*) FROM event"
+
buildSqlEventFilter
({
MessageFilter
,
CallFilter
,
ConferenceFilter
},
mask
);
int
count
=
0
;
...
...
@@ -300,6 +320,11 @@ EventsDb::EventsDb () : AbstractDb(*new EventsDbPrivate) {}
int
EventsDb
::
getMessagesCount
(
const
string
&
remoteAddress
)
const
{
L_D
(
const
EventsDb
);
if
(
!
isConnected
())
{
lWarning
()
<<
"Unable to get messages count. Not connected."
;
return
0
;
}
string
query
=
"SELECT COUNT(*) FROM message_event"
;
if
(
!
remoteAddress
.
empty
())
query
+=
" WHERE dialog_id = ("
...
...
@@ -322,6 +347,11 @@ EventsDb::EventsDb () : AbstractDb(*new EventsDbPrivate) {}
int
EventsDb
::
getUnreadMessagesCount
(
const
string
&
remoteAddress
)
const
{
L_D
(
const
EventsDb
);
if
(
!
isConnected
())
{
lWarning
()
<<
"Unable to get unread messages count. Not connected."
;
return
0
;
}
string
query
=
"SELECT COUNT(*) FROM message_event"
;
if
(
!
remoteAddress
.
empty
())
query
+=
" WHERE dialog_id = ("
...
...
@@ -344,6 +374,11 @@ EventsDb::EventsDb () : AbstractDb(*new EventsDbPrivate) {}
}
list
<
shared_ptr
<
EventLog
>>
EventsDb
::
getHistory
(
const
string
&
remoteAddress
,
int
nLast
,
FilterMask
mask
)
const
{
if
(
!
isConnected
())
{
lWarning
()
<<
"Unable to get history. Not connected."
;
return
list
<
shared_ptr
<
EventLog
>>
();
}
// TODO.
(
void
)
remoteAddress
;
(
void
)
nLast
;
...
...
@@ -352,6 +387,11 @@ EventsDb::EventsDb () : AbstractDb(*new EventsDbPrivate) {}
}
list
<
shared_ptr
<
EventLog
>>
EventsDb
::
getHistory
(
const
string
&
remoteAddress
,
int
begin
,
int
end
,
FilterMask
mask
)
const
{
if
(
!
isConnected
())
{
lWarning
()
<<
"Unable to get history. Not connected."
;
return
list
<
shared_ptr
<
EventLog
>>
();
}
// TODO.
(
void
)
remoteAddress
;
(
void
)
begin
;
...
...
@@ -361,6 +401,11 @@ EventsDb::EventsDb () : AbstractDb(*new EventsDbPrivate) {}
}
void
EventsDb
::
cleanHistory
(
const
string
&
remoteAddress
)
{
if
(
!
isConnected
())
{
lWarning
()
<<
"Unable to clean history. Not connected."
;
return
;
}
// TODO.
(
void
)
remoteAddress
;
}
...
...
tester/CMakeLists.txt
View file @
1f46a567
...
...
@@ -193,7 +193,7 @@ set(SOURCE_FILES_C
)
set
(
SOURCE_FILES_CXX
cpim
_
tester.cpp
cpim
-
tester.cpp
)
set
(
SOURCE_FILES_OBJC
)
...
...
tester/cpim
_
tester.cpp
→
tester/cpim
-
tester.cpp
View file @
1f46a567
/*
*
liblinphone_tester - liblinphone test suite
*
cpim-tester.cpp
* Copyright (C) 2017 Belledonne Communications SARL
*
* This program is free software: you can redistribute it and/or modify
...
...
@@ -20,13 +20,13 @@
#include "liblinphone_tester.h"
using
namespace
std
;
// =============================================================================
using
namespace
LinphonePrivate
;
using
namespace
std
;
// =============================================================================
using
namespace
LINPHONE_NAMESPACE
;
static
void
parse_minimal_message
(
void
)
{
static
void
parse_minimal_message
()
{
const
string
str
=
"Content-type: Message/CPIM
\r\n
"
"
\r\n
"
"Content-Type: text/plain; charset=utf-8
\r\n
"
...
...
@@ -39,7 +39,7 @@ static void parse_minimal_message (void) {
BC_ASSERT_STRING_EQUAL
(
str2
.
c_str
(),
str
.
c_str
());
}
static
void
set_generic_header_name
(
void
)
{
static
void
set_generic_header_name
()
{
const
list
<
pair
<
string
,
bool
>
>
entries
=
{
{
"toto"
,
true
},
{
"george.abitbol"
,
true
},
...
...
@@ -82,7 +82,7 @@ static void set_generic_header_name (void) {
}
}
static
void
set_generic_header_value
(
void
)
{
static
void
set_generic_header_value
()
{
const
list
<
pair
<
string
,
bool
>
>
entries
=
{
{
"MyFeatures <mid:MessageFeatures@id.foo.com>"
,
true
},
{
"2000-12-13T13:40:00-08:00"
,
true
},
...
...
@@ -106,7 +106,7 @@ static void set_generic_header_value (void) {
}
}
static
void
check_core_header_names
(
void
)
{
static
void
check_core_header_names
()
{
const
list
<
pair
<
shared_ptr
<
Cpim
::
CoreHeader
>
,
string
>
>
entries
=
{
{
make_shared
<
Cpim
::
FromHeader
>
(),
"From"
},
{
make_shared
<
Cpim
::
ToHeader
>
(),
"To"
},
...
...
@@ -123,7 +123,7 @@ static void check_core_header_names (void) {
}
}
static
void
set_core_header_values
(
void
)
{
static
void
set_core_header_values
()
{
const
list
<
pair
<
shared_ptr
<
Cpim
::
Header
>
,
list
<
pair
<
string
,
bool
>
>
>
>
entries
=
{
{
make_shared
<
Cpim
::
FromHeader
>
(),
{
{
"Winnie the Pooh <im:pooh@100akerwood.com>"
,
true
},
...
...
@@ -196,7 +196,7 @@ static void set_core_header_values (void) {
}
}
static
void
check_subject_header_language
(
void
)
{
static
void
check_subject_header_language
()
{
Cpim
::
SubjectHeader
subjectHeader
;
// Check for not defined language.
...
...
@@ -226,7 +226,7 @@ static void check_subject_header_language (void) {
}
}
static
void
parse_rfc_example
(
void
)
{
static
void
parse_rfc_example
()
{
const
string
str
=
"Content-type: Message/CPIM
\r\n
"
"
\r\n
"
"From: MR SANDERS <im:piglet@100akerwood.com>
\r\n
"
...
...
@@ -253,7 +253,7 @@ static void parse_rfc_example (void) {
BC_ASSERT_STRING_EQUAL
(
str2
.
c_str
(),
str
.
c_str
());
}
static
void
parse_message_with_generic_header_parameters
(
void
)
{
static
void
parse_message_with_generic_header_parameters
()
{
const
string
str
=
"Content-type: Message/CPIM
\r\n
"
"
\r\n
"
"From: MR SANDERS <im:piglet@100akerwood.com>
\r\n
"
...
...
@@ -275,7 +275,7 @@ static void parse_message_with_generic_header_parameters (void) {
BC_ASSERT_STRING_EQUAL
(
str2
.
c_str
(),
str
.
c_str
());
}
static
void
build_message
(
void
)
{
static
void
build_message
()
{
Cpim
::
Message
message
;
if
(
!
BC_ASSERT_FALSE
(
message
.
isValid
()))
return
;
...
...
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