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
5832bb7c
Commit
5832bb7c
authored
1 year ago
by
Adrien Béraud
Browse files
Options
Downloads
Patches
Plain Diff
archiver: cleanup
Change-Id: I518fd3541487e432f405ae25d707cfb2713da9fc
parent
c0d06537
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/archiver.cpp
+0
-58
0 additions, 58 deletions
src/archiver.cpp
with
0 additions
and
58 deletions
src/archiver.cpp
+
0
−
58
View file @
5832bb7c
...
@@ -55,64 +55,6 @@ using namespace std::literals;
...
@@ -55,64 +55,6 @@ using namespace std::literals;
namespace
jami
{
namespace
jami
{
namespace
archiver
{
namespace
archiver
{
std
::
map
<
std
::
string
,
std
::
string
>
jsonValueToAccount
(
Json
::
Value
&
value
,
const
std
::
string
&
accountId
)
{
auto
idPath_
=
fileutils
::
get_data_dir
()
/
accountId
;
dhtnet
::
fileutils
::
check_dir
(
idPath_
.
c_str
(),
0700
);
auto
detailsMap
=
libjami
::
getAccountTemplate
(
value
[
libjami
::
Account
::
ConfProperties
::
TYPE
].
asString
());
for
(
Json
::
ValueIterator
itr
=
value
.
begin
();
itr
!=
value
.
end
();
itr
++
)
{
if
(
itr
->
asString
().
empty
())
continue
;
if
(
itr
.
key
().
asString
().
compare
(
libjami
::
Account
::
ConfProperties
::
TLS
::
CA_LIST_FILE
)
==
0
)
{
std
::
string
fileContent
(
itr
->
asString
());
fileutils
::
saveFile
(
idPath_
/
"ca.key"
,
{
fileContent
.
begin
(),
fileContent
.
end
()},
0600
);
}
else
if
(
itr
.
key
().
asString
().
compare
(
libjami
::
Account
::
ConfProperties
::
TLS
::
PRIVATE_KEY_FILE
)
==
0
)
{
std
::
string
fileContent
(
itr
->
asString
());
fileutils
::
saveFile
(
idPath_
/
"dht.key"
,
{
fileContent
.
begin
(),
fileContent
.
end
()},
0600
);
}
else
if
(
itr
.
key
().
asString
().
compare
(
libjami
::
Account
::
ConfProperties
::
TLS
::
CERTIFICATE_FILE
)
==
0
)
{
std
::
string
fileContent
(
itr
->
asString
());
fileutils
::
saveFile
(
idPath_
/
"dht.crt"
,
{
fileContent
.
begin
(),
fileContent
.
end
()},
0600
);
}
else
detailsMap
[
itr
.
key
().
asString
()]
=
itr
->
asString
();
}
return
detailsMap
;
}
Json
::
Value
accountToJsonValue
(
const
std
::
map
<
std
::
string
,
std
::
string
>&
details
)
{
Json
::
Value
root
;
for
(
const
auto
&
i
:
details
)
{
if
(
i
.
first
==
libjami
::
Account
::
ConfProperties
::
Ringtone
::
PATH
)
{
// Ringtone path is not exportable
}
else
if
(
i
.
first
==
libjami
::
Account
::
ConfProperties
::
TLS
::
CA_LIST_FILE
||
i
.
first
==
libjami
::
Account
::
ConfProperties
::
TLS
::
CERTIFICATE_FILE
||
i
.
first
==
libjami
::
Account
::
ConfProperties
::
TLS
::
PRIVATE_KEY_FILE
)
{
// replace paths by the files content
root
[
i
.
first
]
=
fileutils
::
loadTextFile
(
std
::
filesystem
::
path
(
i
.
second
));
}
else
root
[
i
.
first
]
=
i
.
second
;
}
return
root
;
}
std
::
vector
<
uint8_t
>
std
::
vector
<
uint8_t
>
compress
(
const
std
::
string
&
str
)
compress
(
const
std
::
string
&
str
)
{
{
...
...
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