mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-03-31 16:45:27 +00:00
update header len for input statuses
This commit is contained in:
parent
2660fad68d
commit
c6a691bbdf
1 changed files with 34 additions and 13 deletions
|
|
@ -216,22 +216,43 @@ fn handle(
|
||||||
page.snap_history();
|
page.snap_history();
|
||||||
}
|
}
|
||||||
redirects.replace(0); // reset
|
redirects.replace(0); // reset
|
||||||
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(default) => page.input.set_new_response(
|
Input::Default(default) => {
|
||||||
page.item_action.clone(),
|
{
|
||||||
uri,
|
let mut i = page.navigation.request.info.borrow_mut();
|
||||||
Some(default.message().unwrap_or("Input expected")),
|
i
|
||||||
Some(1024),
|
.add_event(EVENT_COMPLETED.to_string())
|
||||||
),
|
.set_size(Some(default.as_bytes().len()), None)
|
||||||
|
.unset_mime()
|
||||||
|
.commit();
|
||||||
|
page.navigation.request.update_secondary_icon(&i)
|
||||||
|
}
|
||||||
|
page.input.set_new_response(
|
||||||
|
page.item_action.clone(),
|
||||||
|
uri,
|
||||||
|
Some(default.message().unwrap_or("Input expected")),
|
||||||
|
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(sensitive) => page.input.set_new_sensitive(
|
Input::Sensitive(sensitive) => {
|
||||||
page.item_action.clone(),
|
{
|
||||||
uri,
|
let mut i = page.navigation.request.info.borrow_mut();
|
||||||
Some(sensitive.message().unwrap_or("Sensitive input expected")),
|
i
|
||||||
Some(1024),
|
.add_event(EVENT_COMPLETED.to_string())
|
||||||
)
|
.set_size(Some(sensitive.as_bytes().len()), None)
|
||||||
|
.unset_mime()
|
||||||
|
.commit();
|
||||||
|
page.navigation.request.update_secondary_icon(&i)
|
||||||
|
}
|
||||||
|
page.input.set_new_sensitive(
|
||||||
|
page.item_action.clone(),
|
||||||
|
uri,
|
||||||
|
Some(sensitive.message().unwrap_or("Sensitive input expected")),
|
||||||
|
Some(1024),
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// https://geminiprotocol.net/docs/protocol-specification.gmi#status-20
|
// https://geminiprotocol.net/docs/protocol-specification.gmi#status-20
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue