1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2025-06-20 08:25:16 +00:00

Can respond to a friendship request

This commit is contained in:
2020-06-30 14:05:36 +02:00
parent 13f86fd8c1
commit e59541720d
4 changed files with 48 additions and 0 deletions

View File

@ -384,6 +384,14 @@ impl HttpRequestHandler {
self.user_id_opt().unwrap_or(UserID::invalid())
}
/// Get user ID as a reference
pub fn user_id_ref(&self) -> ResultBoxError<&UserID> {
match self.curr_user_id.as_ref() {
Some(s) => Ok(s),
None => Err(ExecError::boxed_new("Could not get required user ID!"))
}
}
/// Get an email included in the request
pub fn post_email(&mut self, name: &str) -> ResultBoxError<String> {
let mail = self.post_string(name)?;