Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-daemon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-daemon
Commits
bb504cce
Commit
bb504cce
authored
13 years ago
by
Tristan Matthews
Browse files
Options
Downloads
Patches
Plain Diff
* #7264: renamed CallType -> HistoryState
This is the nomenclature used in the client.
parent
4b5afbd8
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
daemon/src/history/historyitem.cpp
+11
-11
11 additions, 11 deletions
daemon/src/history/historyitem.cpp
daemon/src/history/historyitem.h
+8
-8
8 additions, 8 deletions
daemon/src/history/historyitem.h
daemon/src/history/historymanager.cpp
+2
-2
2 additions, 2 deletions
daemon/src/history/historymanager.cpp
with
21 additions
and
21 deletions
daemon/src/history/historyitem.cpp
+
11
−
11
View file @
bb504cce
...
...
@@ -46,10 +46,10 @@ const char * const HistoryItem::RECORDING_PATH_KEY = "recordfile";
const
char
*
const
HistoryItem
::
TIME_ADDED_KEY
=
"timeadded"
;
const
char
*
const
HistoryItem
::
TIMESTAMP_START_KEY
=
"timestamp_start"
;
const
char
*
const
HistoryItem
::
TIMESTAMP_STOP_KEY
=
"timestamp_stop"
;
const
char
*
const
HistoryItem
::
TYP
E_KEY
=
"
typ
e"
;
const
char
*
const
HistoryItem
::
STAT
E_KEY
=
"
stat
e"
;
HistoryItem
::
HistoryItem
(
const
std
::
string
&
timestampStart
,
CallType
callTyp
e
,
const
std
::
string
&
timestampStop
,
HistoryState
stat
e
,
const
std
::
string
&
timestampStop
,
const
std
::
string
&
name
,
const
std
::
string
&
number
,
const
std
::
string
&
callID
,
const
std
::
string
&
accountID
,
const
std
::
string
&
recording
,
...
...
@@ -64,14 +64,14 @@ HistoryItem::HistoryItem(const std::string ×tampStart,
timeAdded_
(
timeAdded
),
timestampStart_
(
timestampStart
),
timestampStop_
(
timestampStop
),
callType_
(
callTyp
e
)
state_
(
stat
e
)
{}
HistoryItem
::
HistoryItem
(
std
::
string
serialized_form
)
:
accountID_
(),
confID_
(),
callID_
(),
name_
(),
number_
(),
recordingPath_
(),
timeAdded_
(),
timestampStart_
(),
timestampStop_
(),
callType_
(
CALL_
MISSED
)
state_
(
MISSED
)
{
for
(
int
index
=
0
;
serialized_form
.
find
(
ITEM_SEPARATOR
,
0
)
!=
std
::
string
::
npos
;
++
index
)
{
size_t
pos
=
serialized_form
.
find
(
ITEM_SEPARATOR
,
0
);
...
...
@@ -79,8 +79,8 @@ HistoryItem::HistoryItem(std::string serialized_form) :
serialized_form
.
erase
(
0
,
pos
+
1
);
switch
(
index
)
{
case
0
:
// The call
typ
e
callType_
=
(
CallTyp
e
)
atoi
(
tmp
.
c_str
());
case
0
:
// The call
stat
e
state_
=
(
HistoryStat
e
)
atoi
(
tmp
.
c_str
());
break
;
case
1
:
// The number field
number_
=
tmp
;
...
...
@@ -122,14 +122,14 @@ HistoryItem::HistoryItem(std::string serialized_form) :
bool
HistoryItem
::
save
(
Conf
::
ConfigTree
**
history
)
{
std
::
stringstream
section
;
std
::
stringstream
callTyp
e
;
std
::
stringstream
stat
e
;
// The section is : "[" + timestamp = "]"
section
<<
rand
();
std
::
string
sectionstr
=
section
.
str
();
callType
<<
callTyp
e_
;
state
<<
stat
e_
;
return
(
*
history
)
->
setConfigTreeItem
(
sectionstr
,
TYP
E_KEY
,
callTyp
e
.
str
())
return
(
*
history
)
->
setConfigTreeItem
(
sectionstr
,
STAT
E_KEY
,
stat
e
.
str
())
&&
(
*
history
)
->
setConfigTreeItem
(
sectionstr
,
TIMESTAMP_START_KEY
,
timestampStart_
)
&&
(
*
history
)
->
setConfigTreeItem
(
sectionstr
,
TIMESTAMP_STOP_KEY
,
timestampStop_
)
&&
(
*
history
)
->
setConfigTreeItem
(
sectionstr
,
NUMBER_KEY
,
number_
)
...
...
@@ -158,7 +158,7 @@ std::string HistoryItem::serialize() const
std
::
stringstream
res
;
// Serialize it
res
<<
callTyp
e_
<<
ITEM_SEPARATOR
<<
number_
<<
ITEM_SEPARATOR
<<
name
<<
ITEM_SEPARATOR
<<
timestampStart_
<<
ITEM_SEPARATOR
<<
timestampStop_
res
<<
stat
e_
<<
ITEM_SEPARATOR
<<
number_
<<
ITEM_SEPARATOR
<<
name
<<
ITEM_SEPARATOR
<<
timestampStart_
<<
ITEM_SEPARATOR
<<
timestampStop_
<<
ITEM_SEPARATOR
<<
callID_
<<
ITEM_SEPARATOR
<<
accountID
<<
ITEM_SEPARATOR
<<
recordingPath_
<<
ITEM_SEPARATOR
<<
confID_
<<
ITEM_SEPARATOR
<<
timeAdded_
;
return
res
.
str
();
...
...
@@ -183,7 +183,7 @@ std::map<std::string, std::string> HistoryItem::toMap() const
else
result
[
ACCOUNT_ID_KEY
]
=
accountID_
;
result
[
TYP
E_KEY
]
=
callTyp
e_
;
result
[
STAT
E_KEY
]
=
stat
e_
;
result
[
NUMBER_KEY
]
=
number_
;
result
[
TIMESTAMP_START_KEY
]
=
timestampStart_
;
result
[
TIMESTAMP_STOP_KEY
]
=
timestampStop_
;
...
...
This diff is collapsed.
Click to expand it.
daemon/src/history/historyitem.h
+
8
−
8
View file @
bb504cce
...
...
@@ -36,11 +36,11 @@
#include
<string>
#include
<map>
typedef
enum
CallTyp
e
{
CALL_
MISSED
,
CALL_
INCOMING
,
CALL_
OUTGOING
}
CallTyp
e
;
typedef
enum
HistoryStat
e
{
MISSED
,
INCOMING
,
OUTGOING
}
HistoryStat
e
;
namespace
Conf
{
class
ConfigTree
;
...
...
@@ -57,7 +57,7 @@ class HistoryItem {
static
const
char
*
const
TIME_ADDED_KEY
;
static
const
char
*
const
TIMESTAMP_START_KEY
;
static
const
char
*
const
TIMESTAMP_STOP_KEY
;
static
const
char
*
const
TYP
E_KEY
;
static
const
char
*
const
STAT
E_KEY
;
/*
* Constructor
*
...
...
@@ -72,7 +72,7 @@ class HistoryItem {
* @param Configuration ID
* @param time added
*/
HistoryItem
(
const
std
::
string
&
,
CallTyp
e
,
const
std
::
string
&
,
HistoryItem
(
const
std
::
string
&
,
HistoryStat
e
,
const
std
::
string
&
,
const
std
::
string
&
,
const
std
::
string
&
,
const
std
::
string
&
,
const
std
::
string
&
,
const
std
::
string
&
,
const
std
::
string
&
,
const
std
::
string
&
);
...
...
@@ -139,7 +139,7 @@ class HistoryItem {
* Represents the type of call
* Has be either CALL_MISSED, CALL_INCOMING or CALL_OUTGOING
*/
CallType
callTyp
e_
;
HistoryState
stat
e_
;
};
...
...
This diff is collapsed.
Click to expand it.
daemon/src/history/historymanager.cpp
+
2
−
2
View file @
bb504cce
...
...
@@ -86,7 +86,7 @@ int HistoryManager::load_history_items_map(Conf::ConfigTree *history_list, int l
Conf
::
TokenList
sections
(
history_list
->
getSections
());
int
nb_items
=
0
;
for
(
Conf
::
TokenList
::
iterator
iter
=
sections
.
begin
();
iter
!=
sections
.
end
();
++
iter
)
{
CallType
typ
e
=
static_cast
<
CallTyp
e
>
(
getConfigInt
(
*
iter
,
HistoryItem
::
TYP
E_KEY
,
history_list
));
HistoryState
stat
e
=
static_cast
<
HistoryStat
e
>
(
getConfigInt
(
*
iter
,
HistoryItem
::
STAT
E_KEY
,
history_list
));
string
timestamp_start
(
getConfigString
(
*
iter
,
HistoryItem
::
TIMESTAMP_START_KEY
,
history_list
));
string
timestamp_stop
(
getConfigString
(
*
iter
,
HistoryItem
::
TIMESTAMP_STOP_KEY
,
history_list
));
string
name
(
getConfigString
(
*
iter
,
HistoryItem
::
NAME_KEY
,
history_list
));
...
...
@@ -99,7 +99,7 @@ int HistoryManager::load_history_items_map(Conf::ConfigTree *history_list, int l
// Make a check on the start timestamp to know it is loadable according to CONFIG_HISTORY_LIMIT
if
(
atoi
(
timestamp_start
.
c_str
())
>=
((
int
)
current_timestamp
-
history_limit
))
{
HistoryItem
item
(
timestamp_start
,
typ
e
,
timestamp_stop
,
name
,
number
,
callID
,
accountID
,
recording_file
,
confID
,
timeAdded
);
HistoryItem
item
(
timestamp_start
,
stat
e
,
timestamp_stop
,
name
,
number
,
callID
,
accountID
,
recording_file
,
confID
,
timeAdded
);
add_new_history_entry
(
item
);
++
nb_items
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment