Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jami-libclient
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
savoirfairelinux
jami-libclient
Commits
74214fd6
Commit
74214fd6
authored
Mar 28, 2022
by
Sébastien Blin
Browse files
Options
Downloads
Patches
Plain Diff
misc: cleanup some warnings
Change-Id: Iba7379b89e33525a86619241b74dbf82f3c07d7d
parent
f5bc9288
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/authority/storagehelper.cpp
+1
-4
1 addition, 4 deletions
src/authority/storagehelper.cpp
src/contactmodel.cpp
+6
-11
6 additions, 11 deletions
src/contactmodel.cpp
with
7 additions
and
15 deletions
src/authority/storagehelper.cpp
+
1
−
4
View file @
74214fd6
...
@@ -356,10 +356,8 @@ getAccountAvatar(const QString& accountId)
...
@@ -356,10 +356,8 @@ getAccountAvatar(const QString& accountId)
QString
filePath
;
QString
filePath
;
filePath
=
accountLocalPath
+
"profile.vcf"
;
filePath
=
accountLocalPath
+
"profile.vcf"
;
QFile
file
(
filePath
);
QFile
file
(
filePath
);
if
(
!
file
.
open
(
QIODevice
::
ReadOnly
))
{
if
(
!
file
.
open
(
QIODevice
::
ReadOnly
))
qWarning
()
<<
"Can't open file: "
<<
filePath
;
return
{};
return
{};
}
const
auto
vCard
=
lrc
::
vCard
::
utils
::
toHashMap
(
file
.
readAll
());
const
auto
vCard
=
lrc
::
vCard
::
utils
::
toHashMap
(
file
.
readAll
());
const
auto
photo
=
(
vCard
.
find
(
vCard
::
Property
::
PHOTO_PNG
)
==
vCard
.
end
())
const
auto
photo
=
(
vCard
.
find
(
vCard
::
Property
::
PHOTO_PNG
)
==
vCard
.
end
())
?
vCard
[
vCard
::
Property
::
PHOTO_JPEG
]
?
vCard
[
vCard
::
Property
::
PHOTO_JPEG
]
...
@@ -384,7 +382,6 @@ buildContactFromProfile(const QString& accountId,
...
@@ -384,7 +382,6 @@ buildContactFromProfile(const QString& accountId,
QString
filePath
=
accountLocalPath
+
"profiles/"
+
peer_uri
+
".vcf"
;
QString
filePath
=
accountLocalPath
+
"profiles/"
+
peer_uri
+
".vcf"
;
file
.
setFileName
(
filePath
);
file
.
setFileName
(
filePath
);
if
(
!
file
.
open
(
QIODevice
::
ReadOnly
))
{
if
(
!
file
.
open
(
QIODevice
::
ReadOnly
))
{
qWarning
().
noquote
()
<<
"Can't open file: "
<<
filePath
;
return
{
profileInfo
,
""
,
true
,
false
};
return
{
profileInfo
,
""
,
true
,
false
};
}
}
// rename it
// rename it
...
...
This diff is collapsed.
Click to expand it.
src/contactmodel.cpp
+
6
−
11
View file @
74214fd6
...
@@ -523,18 +523,15 @@ ContactModel::sendDhtMessage(const QString& contactUri, const QString& body) con
...
@@ -523,18 +523,15 @@ ContactModel::sendDhtMessage(const QString& contactUri, const QString& body) con
const
QString
const
QString
ContactModel
::
bestNameForContact
(
const
QString
&
contactUri
)
const
ContactModel
::
bestNameForContact
(
const
QString
&
contactUri
)
const
{
{
try
{
std
::
lock_guard
<
std
::
mutex
>
lk
(
pimpl_
->
contactsMtx_
);
auto
contact
=
getContact
(
contactUri
);
if
(
pimpl_
->
contacts
.
contains
(
contactUri
))
{
auto
contact
=
pimpl_
->
contacts
.
value
(
contactUri
);
auto
alias
=
contact
.
profileInfo
.
alias
.
simplified
();
auto
alias
=
contact
.
profileInfo
.
alias
.
simplified
();
if
(
alias
.
isEmpty
())
{
if
(
alias
.
isEmpty
())
{
return
bestIdFromContactInfo
(
contact
);
return
bestIdFromContactInfo
(
contact
);
}
}
return
alias
;
return
alias
;
}
catch
(
const
std
::
out_of_range
&
e
)
{
qDebug
()
<<
"ContactModel::bestNameForContact"
<<
e
.
what
();
}
}
return
contactUri
;
return
contactUri
;
}
}
...
@@ -547,13 +544,11 @@ ContactModel::avatar(const QString& uri) const
...
@@ -547,13 +544,11 @@ ContactModel::avatar(const QString& uri) const
const
QString
const
QString
ContactModel
::
bestIdForContact
(
const
QString
&
contactUri
)
const
ContactModel
::
bestIdForContact
(
const
QString
&
contactUri
)
const
{
{
try
{
std
::
lock_guard
<
std
::
mutex
>
lk
(
pimpl_
->
contactsMtx_
);
auto
contact
=
getContact
(
contactUri
);
if
(
pimpl_
->
contacts
.
contains
(
contactUri
))
{
auto
contact
=
pimpl_
->
contacts
.
value
(
contactUri
);
return
bestIdFromContactInfo
(
contact
);
return
bestIdFromContactInfo
(
contact
);
}
catch
(
const
std
::
out_of_range
&
e
)
{
qDebug
()
<<
"ContactModel::bestIdForContact"
<<
e
.
what
();
}
}
return
contactUri
;
return
contactUri
;
}
}
...
...
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