mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-03-31 16:45:27 +00:00
update ggemini api
This commit is contained in:
parent
62534ab68d
commit
2660fad68d
1 changed files with 7 additions and 8 deletions
|
|
@ -103,7 +103,7 @@ impl Gemini {
|
||||||
"gemini" => handle(
|
"gemini" => handle(
|
||||||
Request::Gemini {
|
Request::Gemini {
|
||||||
uri,
|
uri,
|
||||||
mode: Mode::Header,
|
mode: Mode::HeaderOnly,
|
||||||
},
|
},
|
||||||
(
|
(
|
||||||
self.client.clone(),
|
self.client.clone(),
|
||||||
|
|
@ -127,7 +127,7 @@ impl Gemini {
|
||||||
data: bytes,
|
data: bytes,
|
||||||
mime: header.mime.map(|mime| mime.into()),
|
mime: header.mime.map(|mime| mime.into()),
|
||||||
token: header.token.map(|token| token.into()),
|
token: header.token.map(|token| token.into()),
|
||||||
mode: Mode::Header,
|
mode: Mode::HeaderOnly,
|
||||||
},
|
},
|
||||||
(
|
(
|
||||||
client.clone(),
|
client.clone(),
|
||||||
|
|
@ -210,9 +210,8 @@ fn handle(
|
||||||
match response {
|
match response {
|
||||||
// https://geminiprotocol.net/docs/protocol-specification.gmi#input-expected
|
// https://geminiprotocol.net/docs/protocol-specification.gmi#input-expected
|
||||||
Response::Input(input) => {
|
Response::Input(input) => {
|
||||||
let t = input.to_string();
|
|
||||||
page.set_progress(0.0);
|
page.set_progress(0.0);
|
||||||
page.set_title(&t);
|
page.set_title("Input expected");
|
||||||
if is_snap_history {
|
if is_snap_history {
|
||||||
page.snap_history();
|
page.snap_history();
|
||||||
}
|
}
|
||||||
|
|
@ -220,17 +219,17 @@ fn handle(
|
||||||
update_page_info(&page, EVENT_COMPLETED);
|
update_page_info(&page, EVENT_COMPLETED);
|
||||||
match input {
|
match input {
|
||||||
// https://geminiprotocol.net/docs/protocol-specification.gmi#status-10
|
// https://geminiprotocol.net/docs/protocol-specification.gmi#status-10
|
||||||
Input::Default { message } => page.input.set_new_response(
|
Input::Default(default) => page.input.set_new_response(
|
||||||
page.item_action.clone(),
|
page.item_action.clone(),
|
||||||
uri,
|
uri,
|
||||||
Some(message.as_ref().unwrap_or(&t)),
|
Some(default.message().unwrap_or("Input expected")),
|
||||||
Some(1024),
|
Some(1024),
|
||||||
),
|
),
|
||||||
// https://geminiprotocol.net/docs/protocol-specification.gmi#status-11-sensitive-input
|
// https://geminiprotocol.net/docs/protocol-specification.gmi#status-11-sensitive-input
|
||||||
Input::Sensitive { message } => page.input.set_new_sensitive(
|
Input::Sensitive(sensitive) => page.input.set_new_sensitive(
|
||||||
page.item_action.clone(),
|
page.item_action.clone(),
|
||||||
uri,
|
uri,
|
||||||
Some(message.as_ref().unwrap_or(&t)),
|
Some(sensitive.message().unwrap_or("Sensitive input expected")),
|
||||||
Some(1024),
|
Some(1024),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue