mirror of
https://github.com/KingDuckZ/kamokan.git
synced 2025-08-19 13:29:49 +00:00
Implement self-destruct upon read when selfdes=1 in POST
This commit is contained in:
parent
8d19c794ed
commit
b6edab7171
7 changed files with 39 additions and 12 deletions
|
@ -44,6 +44,7 @@ namespace kamokan {
|
|||
const boost::string_view& parText,
|
||||
uint32_t parExpiry,
|
||||
const boost::string_view& parLang,
|
||||
bool parSelfDestruct,
|
||||
const std::string& parRemoteIP
|
||||
) const {
|
||||
SubmittedPastie pastie;
|
||||
|
@ -53,6 +54,7 @@ namespace kamokan {
|
|||
pastie.lang = std::string(parLang);
|
||||
pastie.remote_ip = parRemoteIP;
|
||||
pastie.token = token;
|
||||
pastie.self_destruct = parSelfDestruct;
|
||||
m_submitted_pasties.push_back(std::move(pastie));
|
||||
|
||||
Storage::SubmissionResult submission_res;
|
||||
|
|
|
@ -35,22 +35,24 @@ namespace kamokan {
|
|||
std::string remote_ip;
|
||||
std::string token;
|
||||
uint32_t expiry;
|
||||
bool self_destruct;
|
||||
};
|
||||
|
||||
FakeStorage (const Kakoune::SafePtr<SettingsBag>& parSettings, bool parItsConnected);
|
||||
kamokan_virtual_testing ~FakeStorage();
|
||||
|
||||
kamokan_virtual_testing void connect_async();
|
||||
kamokan_virtual_testing bool is_connected() const;
|
||||
kamokan_virtual_testing void finalize_connection();
|
||||
kamokan_virtual_testing void connect_async() override;
|
||||
kamokan_virtual_testing bool is_connected() const override;
|
||||
kamokan_virtual_testing void finalize_connection() override;
|
||||
kamokan_virtual_testing SubmissionResult submit_pastie (
|
||||
const boost::string_view& parText,
|
||||
uint32_t parExpiry,
|
||||
const boost::string_view& parLang,
|
||||
bool parSelfDestruct,
|
||||
const std::string& parRemoteIP
|
||||
) const;
|
||||
) const override;
|
||||
|
||||
kamokan_virtual_testing boost::optional<std::string> retrieve_pastie (const boost::string_view& parToken) const;
|
||||
kamokan_virtual_testing boost::optional<std::string> retrieve_pastie (const boost::string_view& parToken) const override;
|
||||
|
||||
const std::vector<SubmittedPastie>& submitted_pasties() const;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue