Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement contacts_find and contacts_get_all #276

Merged
merged 3 commits into from Aug 1, 2019

Conversation

@NoraCodes
Copy link
Contributor

commented Jul 25, 2019

No description provided.

NoraCodes added 2 commits Jul 25, 2019
Add like_query to UserData for searching
This function currently just does a substring match on the name and
username but could be updated in the future to use some kind of fuzzy
matching technique.
Add contacts_find and contacts_get_all
Includes a basic test in service_sim
@spacekookie
Copy link
Member

left a comment

I think maybe remove the actual end-point implementations for now, because they'll require a bunch of groundwork to happen first.

I do like the simple search function and the testing for it

}

/// Enumerate all contacts known by a user
pub fn contacts_get_all(&self, user: UserAuth) -> QaulResult<Vec<User>> {
unimplemented!()
pub fn contacts_get_all(&self, _user: UserAuth) -> QaulResult<Vec<User>> {

This comment has been minimized.

Copy link
@spacekookie

spacekookie Jul 28, 2019

Member

This is slightly wrong behaviour.

While there is a list of users on a system, the contact book is a concept local to a user, and should only be handed out over passing authentication too

let query = query.into();
Ok(users
.iter()
.filter(|(_, user)| user.data.like_query(&query))

This comment has been minimized.

Copy link
@spacekookie

spacekookie Jul 28, 2019

Member

Same thing here. Actually what we need first is a contact book store concept inside the user, before these endpoints can be implemented

Revert "Add contacts_find and contacts_get_all"
These implementations weren't corrent.

This reverts commit 0424afb.
@spacekookie
Copy link
Member

left a comment

We should sit down and figure out more libqaul structure soon

@spacekookie spacekookie merged commit f34b325 into qaul:master Aug 1, 2019

spacekookie added a commit that referenced this pull request Aug 9, 2019
Implement contacts_find and contacts_get_all (#276)
* Add like_query to UserData for searching

This function currently just does a substring match on the name and
username but could be updated in the future to use some kind of fuzzy
matching technique.

* Add contacts_find and contacts_get_all

Includes a basic test in service_sim

* Revert "Add contacts_find and contacts_get_all"

These implementations weren't corrent.

This reverts commit 0424afb.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.