mirror of
https://github.com/narrrl/proton-stream.git
synced 2026-11-03 16:41:26 +01:00
feat(core,app,android,ios): finish adding a first share where it pays off
- A link with a password of its own, added without one, now fails as "This link has a password of its own" instead of the handshake's refusal. The link's public flags are only asked for after a refusal. The desktop form turns its password toggle on. - After the first share is added, all three clients go to the library. While that share is being listed, the empty library says so instead of offering to add a share. - The desktop library offers posters and synopses once there is a library to put them on. The offer says what is sent, links to Settings, never turns anything on, and "Not now" is remembered.
This commit is contained in:
1 parent
0f96cc4514
commit
89e55aac12
11 files changed
+150
-10
No files matched your search
@@ -46,6 +46,11 @@ pub enum Error {
|
||||
/// mailbox password.
|
||||
#[error("{0}")]
|
||||
SignIn(String),
|
||||
|
||||
/// A public link with a password of its own was opened without one. The
|
||||
/// handshake refusal says nothing a viewer can act on; this does.
|
||||
#[error("This link has a password of its own. Enter it to add the link.")]
|
||||
PasswordNeeded,
|
||||
}
|
||||
|
||||
impl Error {
|
||||
|
||||
@@ -443,7 +443,22 @@ impl ShareStore {
|
||||
));
|
||||
}
|
||||
let custom_password = custom_password.filter(|password| !password.is_empty());
|
||||
let client = open_link(url, custom_password).await?;
|
||||
let client = match open_link(url, custom_password).await {
|
||||
Ok(client) => client,
|
||||
// Asked only after a refusal: the link's public flags cost a round
|
||||
// trip, and most links open without one.
|
||||
Err(error) if custom_password.is_none() => {
|
||||
let protected = ProtonDrivePublicLinkClient::info(client_configuration(), url)
|
||||
.await
|
||||
.is_ok_and(|info| info.is_custom_password_protected);
|
||||
return Err(if protected {
|
||||
Error::PasswordNeeded
|
||||
} else {
|
||||
error
|
||||
});
|
||||
}
|
||||
Err(error) => return Err(error),
|
||||
};
|
||||
// A name is the viewer's to give, not theirs to invent before they
|
||||
// can see anything: without one, the shared folder's own name.
|
||||
let name = match name.trim() {
|
||||
|
||||
Reference in new issue
Block a user