mirror of
https://github.com/timvisee/ffsend.git
synced 2025-10-05 02:09:27 +02:00
Automatically derive owner tokens from history
This commit is contained in:
parent
f2336467a2
commit
77fb9c436d
8 changed files with 84 additions and 8 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue