Automatically derive owner tokens from history

This commit is contained in:
timvisee 2018-05-07 22:59:38 +02:00
parent f2336467a2
commit 77fb9c436d
No known key found for this signature in database
GPG key ID: 109CBA0BF74036C2
8 changed files with 84 additions and 8 deletions

View file

@ -252,11 +252,20 @@ impl RemoteFile {
&mut self.owner_token
}
/// Set the owner token.
/// Set the owner token, wrapped in an option.
/// If `None` is given, the owner token will be unset.
pub fn set_owner_token(&mut self, token: Option<String>) {
self.owner_token = token;
}
/// Check whether an owner token is set in this remote file.
pub fn has_owner_token(&self) -> bool {
self.owner_token
.clone()
.map(|t| !t.is_empty())
.unwrap_or(false)
}
/// Get the host URL for this remote file.
pub fn host(&self) -> Url {
self.host.clone()