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
7aa68219
Unverified
Commit
7aa68219
authored
Nov 15, 2019
by
Sébastien Blin
Browse files
sip: fix temporary item removal
Change-Id: I26e62a8f0109d547d1dd8503b6aa096b0181cfa9
parent
d81a548c
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/contactmodel.cpp
View file @
7aa68219
...
...
@@ -385,11 +385,13 @@ ContactModelPimpl::updateTemporaryMessage(const std::string& mes, const std::str
void
ContactModelPimpl
::
searchRingContact
(
const
URI
&
query
)
{
std
::
string
uriID
=
query
.
format
(
URI
::
Section
::
USER_INFO
|
URI
::
Section
::
HOSTNAME
|
URI
::
Section
::
PORT
).
toStdString
();
if
(
query
.
isEmpty
())
{
// This will remove the temporary item
emit
linked
.
modelUpdated
(
uriID
);
return
;
}
std
::
string
uriID
=
query
.
format
(
URI
::
Section
::
USER_INFO
|
URI
::
Section
::
HOSTNAME
|
URI
::
Section
::
PORT
).
toStdString
();
if
(
query
.
protocolHint
()
==
URI
::
ProtocolHint
::
RING
)
{
// no lookup, this is a ring infoHash
for
(
auto
&
i
:
contacts
)
{
...
...
@@ -413,13 +415,14 @@ ContactModelPimpl::searchRingContact(const URI& query)
void
ContactModelPimpl
::
searchSipContact
(
const
URI
&
query
)
{
std
::
string
uriID
=
query
.
format
(
URI
::
Section
::
USER_INFO
|
URI
::
Section
::
HOSTNAME
|
URI
::
Section
::
PORT
).
toStdString
();
if
(
query
.
isEmpty
())
{
// This will remove the temporary item
emit
linked
.
modelUpdated
(
uriID
);
return
;
}
std
::
string
uriID
=
query
.
format
(
URI
::
Section
::
USER_INFO
|
URI
::
Section
::
HOSTNAME
|
URI
::
Section
::
PORT
).
toStdString
();
auto
&
temporaryContact
=
contacts
[
""
];
{
std
::
lock_guard
<
std
::
mutex
>
lk
(
contactsMtx_
);
if
(
contacts
.
find
(
uriID
)
==
contacts
.
end
())
{
...
...
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