new internal api + sdcpp_stduhpf_wip2 impl
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
#include <solanaceae/message3/registry_message_model.hpp>
|
||||
#include <solanaceae/contact/fwd.hpp>
|
||||
|
||||
#include <httplib.h>
|
||||
#include "./webapi_interface.hpp"
|
||||
|
||||
#include <map>
|
||||
#include <vector>
|
||||
@@ -24,31 +24,17 @@ class SDBot : public RegistryMessageModelEventI {
|
||||
RegistryMessageModelI::SubscriptionReference _rmm_sr;
|
||||
ConfigModelI& _conf;
|
||||
|
||||
//TransferManager& _tm;
|
||||
|
||||
//std::map<uint64_t, std::variant<ContactFriend, ContactConference, ContactGroupPeer>> _task_map;
|
||||
std::map<uint64_t, Contact4> _task_map;
|
||||
std::queue<std::pair<uint64_t, std::string>> _prompt_queue;
|
||||
uint64_t _last_task_counter = 0;
|
||||
|
||||
std::optional<uint64_t> _current_task;
|
||||
std::shared_ptr<httplib::Client> _cli;
|
||||
std::optional<std::future<std::vector<uint8_t>>> _curr_future;
|
||||
std::optional<uint64_t> _current_task_id;
|
||||
std::shared_ptr<WebAPITaskI> _current_task;
|
||||
|
||||
std::default_random_engine _rng;
|
||||
|
||||
public:
|
||||
struct EndpointI {
|
||||
RegistryMessageModelI& _rmm;
|
||||
std::default_random_engine& _rng;
|
||||
EndpointI(RegistryMessageModelI& rmm, std::default_random_engine& rng) : _rmm(rmm), _rng(rng) {}
|
||||
virtual ~EndpointI(void) {}
|
||||
|
||||
virtual bool handleResponse(Contact4 contact, ByteSpan data) = 0;
|
||||
};
|
||||
|
||||
private:
|
||||
std::unique_ptr<EndpointI> _endpoint;
|
||||
std::unique_ptr<WebAPII> _endpoint;
|
||||
|
||||
public:
|
||||
SDBot(
|
||||
@@ -64,9 +50,6 @@ class SDBot : public RegistryMessageModelEventI {
|
||||
bool use_webp_for_friends = true;
|
||||
bool use_webp_for_groups = true;
|
||||
|
||||
//protected: // tox events
|
||||
//bool onToxEvent(const Tox_Event_Friend_Message* e) override;
|
||||
//bool onToxEvent(const Tox_Event_Group_Message* e) override;
|
||||
protected: // mm
|
||||
bool onEvent(const Message::Events::MessageConstruct& e) override;
|
||||
};
|
||||
|
Reference in New Issue
Block a user