This commit is contained in:
Antonio Scandurra 2022-05-09 17:06:21 +02:00
parent ca56b0d6d5
commit e4f1952657
5 changed files with 52 additions and 23 deletions

View file

@ -237,6 +237,14 @@ impl UserStore {
&self.outgoing_contact_requests
}
pub fn has_outgoing_contact_request(&self, user: &User) -> bool {
self.outgoing_contact_requests
.binary_search_by_key(&&user.github_login, |requested_user| {
&requested_user.github_login
})
.is_ok()
}
pub fn request_contact(&self, responder_id: u64) -> impl Future<Output = Result<()>> {
let client = self.client.upgrade();
async move {