Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
savoirfairelinux
jami-libclient
Commits
5bfa1288
Commit
5bfa1288
authored
Nov 04, 2019
by
Sébastien Blin
Browse files
dbus: ignore invalid answer from daemon
Change-Id: Ie548b6c7f536cf673f0df1b0a11bb793cff11adc
parent
5433aa52
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/database.cpp
View file @
5bfa1288
...
...
@@ -605,6 +605,14 @@ LegacyDatabase::migrateLocalProfiles()
const
QStringList
accountIds
=
ConfigurationManager
::
instance
().
getAccountList
();
for
(
auto
accountId
:
accountIds
)
{
// NOTE: If the daemon is down, but dbus answered, id can contains
// "Remote peer disconnected", "The name is not activable", etc.
// So avoid to migrate useless directories.
for
(
auto
&
id
:
accountIds
)
if
(
id
.
indexOf
(
" "
)
!=
-
1
)
{
qWarning
()
<<
"Invalid dbus answer. Daemon not running"
;
return
;
}
MapStringString
account
=
ConfigurationManager
::
instance
().
getAccountDetails
(
accountId
.
toStdString
().
c_str
());
auto
accountURI
=
account
[
DRing
::
Account
::
ConfProperties
::
USERNAME
].
contains
(
"ring:"
)
?
...
...
@@ -847,9 +855,16 @@ LegacyDatabase::migrateSchemaFromVersion1()
void
LegacyDatabase
::
linkRingProfilesWithAccounts
(
bool
contactsOnly
)
{
const
QStringList
accountIds
=
ConfigurationManager
::
instance
().
getAccountList
();
const
QStringList
accountIds
=
ConfigurationManager
::
instance
().
getAccountList
();
for
(
auto
accountId
:
accountIds
)
{
// NOTE: If the daemon is down, but dbus answered, id can contains
// "Remote peer disconnected", "The name is not activable", etc.
// So avoid to migrate useless directories.
for
(
auto
&
id
:
accountIds
)
if
(
id
.
indexOf
(
" "
)
!=
-
1
)
{
qWarning
()
<<
"Invalid dbus answer. Daemon not running"
;
return
;
}
MapStringString
account
=
ConfigurationManager
::
instance
().
getAccountDetails
(
accountId
.
toStdString
().
c_str
());
auto
accountURI
=
account
[
DRing
::
Account
::
ConfProperties
::
USERNAME
].
contains
(
"ring:"
)
?
...
...
src/newaccountmodel.cpp
View file @
5bfa1288
...
...
@@ -339,6 +339,16 @@ NewAccountModelPimpl::NewAccountModelPimpl(NewAccountModel& linked,
,
username_changed
(
false
)
{
const
QStringList
accountIds
=
ConfigurationManager
::
instance
().
getAccountList
();
// NOTE: If the daemon is down, but dbus answered, id can contains
// "Remote peer disconnected", "The name is not activable", etc.
// So avoid to migrate useless directories.
for
(
auto
&
id
:
accountIds
)
if
(
id
.
indexOf
(
" "
)
!=
-
1
)
{
qWarning
()
<<
"Invalid dbus answer. Daemon not running"
;
return
;
}
auto
accountDbs
=
authority
::
storage
::
migrateIfNeeded
(
accountIds
,
willMigrateCb
,
didMigrateCb
);
for
(
const
auto
&
id
:
accountIds
)
{
addToAccounts
(
id
.
toStdString
(),
accountDbs
.
at
(
accountIds
.
indexOf
(
id
)));
...
...
Write
Preview
Supports
Markdown
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