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
deb9e5dd
Commit
deb9e5dd
authored
4 years ago
by
Sébastien Blin
Committed by
Andreas Traczyk
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
jams: fix search for @ and direct ids
GitLab:
#445
Change-Id: I6de102834c4923090e5699e4fddeafc3b548478b
parent
93f4e600
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/contactmodel.cpp
+10
-25
10 additions, 25 deletions
src/contactmodel.cpp
with
10 additions
and
25 deletions
src/contactmodel.cpp
+
10
−
25
View file @
deb9e5dd
...
...
@@ -90,11 +90,10 @@ public:
const
QString
&
displayName
=
""
,
bool
banned
=
false
);
/**
* Helpers for searchContact. Search for a given
RING
or SIP contact.
* Helpers for searchContact. Search for a given
classic
or SIP contact.
*/
void
search
Ring
Contact
(
const
URI
&
query
);
void
searchContact
(
const
URI
&
query
);
void
searchSipContact
(
const
URI
&
query
);
void
jamsSearch
(
const
URI
&
query
);
/**
* Update temporary item to display a given message about a given uri.
...
...
@@ -415,11 +414,7 @@ ContactModel::searchContact(const QString& query)
&&
owner
.
profileInfo
.
type
==
profile
::
Type
::
SIP
)
{
pimpl_
->
searchSipContact
(
uri
);
}
else
if
(
uriScheme
==
URI
::
SchemeType
::
RING
&&
owner
.
profileInfo
.
type
==
profile
::
Type
::
RING
)
{
bool
isJamsAccount
=
!
owner
.
confProperties
.
managerUri
.
isEmpty
();
if
(
isJamsAccount
)
pimpl_
->
jamsSearch
(
uri
);
else
pimpl_
->
searchRingContact
(
uri
);
pimpl_
->
searchContact
(
uri
);
}
else
{
pimpl_
->
updateTemporaryMessage
(
tr
(
"Bad URI scheme"
));
}
...
...
@@ -432,7 +427,7 @@ ContactModelPimpl::updateTemporaryMessage(const QString& mes)
}
void
ContactModelPimpl
::
search
Ring
Contact
(
const
URI
&
query
)
ContactModelPimpl
::
searchContact
(
const
URI
&
query
)
{
QString
uriID
=
query
.
format
(
URI
::
Section
::
USER_INFO
|
URI
::
Section
::
HOSTNAME
|
URI
::
Section
::
PORT
);
...
...
@@ -459,25 +454,15 @@ ContactModelPimpl::searchRingContact(const URI& query)
}
else
{
updateTemporaryMessage
(
tr
(
"Searching…"
));
// Default searching
// If the username contains an @ it's an exact match
bool
isJamsAccount
=
!
linked
.
owner
.
confProperties
.
managerUri
.
isEmpty
();
if
(
isJamsAccount
and
not
query
.
hasHostname
())
ConfigurationManager
::
instance
().
searchUser
(
linked
.
owner
.
id
,
uriID
);
else
ConfigurationManager
::
instance
().
lookupName
(
linked
.
owner
.
id
,
""
,
uriID
);
}
}
void
ContactModelPimpl
::
jamsSearch
(
const
URI
&
query
)
{
QString
uriID
=
query
.
format
(
URI
::
Section
::
USER_INFO
|
URI
::
Section
::
HOSTNAME
|
URI
::
Section
::
PORT
);
if
(
query
.
isEmpty
())
{
emit
linked
.
modelUpdated
(
uriID
);
updateTemporaryMessage
(
""
);
return
;
}
updateTemporaryMessage
(
tr
(
"Searching…"
));
ConfigurationManager
::
instance
().
searchUser
(
linked
.
owner
.
id
,
uriID
);
}
void
ContactModelPimpl
::
searchSipContact
(
const
URI
&
query
)
{
...
...
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