interface refinement and disabling old transfer components

This commit is contained in:
Green Sky 2024-07-29 16:04:42 +02:00
parent c107debf0f
commit 9728f71c98
No known key found for this signature in database
5 changed files with 11 additions and 5 deletions

View File

@ -28,7 +28,7 @@ target_compile_features(solanaceae_message3 PUBLIC cxx_std_17)
target_link_libraries(solanaceae_message3 PUBLIC
solanaceae_util
solanaceae_contact
solanaceae_object_store # for fwd.hpp in components
solanaceae_object_store # for fwd.hpp
EnTT::EnTT
)

View File

@ -76,6 +76,7 @@ namespace Message::Components {
ObjectHandle o;
};
#if 0
namespace Transfer {
//struct TransferState {
@ -153,6 +154,7 @@ namespace Message::Components {
};
} // Transfer
#endif
// points to the front/newer message
// together they define a range that is,

View File

@ -32,6 +32,7 @@ DEFINE_COMP_ID(Message::Components::MessageText)
DEFINE_COMP_ID(Message::Components::TagMessageIsAction)
DEFINE_COMP_ID(Message::Components::MessageFileObject)
#if 0
DEFINE_COMP_ID(Message::Components::Transfer::TagHaveAll)
DEFINE_COMP_ID(Message::Components::Transfer::BytesSent)
DEFINE_COMP_ID(Message::Components::Transfer::BytesReceived)
@ -43,6 +44,7 @@ DEFINE_COMP_ID(Message::Components::Transfer::StateCanceled)
DEFINE_COMP_ID(Message::Components::Transfer::FileInfo)
DEFINE_COMP_ID(Message::Components::Transfer::FileInfoLocal)
DEFINE_COMP_ID(Message::Components::Transfer::ActionAccept)
#endif
#undef DEFINE_COMP_ID

View File

@ -1,8 +1,7 @@
#pragma once
#include <solanaceae/contact/contact_model3.hpp>
//#include "./file.hpp"
#include <solanaceae/object_store/fwd.hpp>
// TODO: move, rename, do something?, change in favor of tox?
//enum class FileKind : uint32_t {
@ -20,8 +19,9 @@ struct MessageModel3I {
//virtual bool sendFile(const Contact& c, std::string_view file_name, std::unique_ptr<FileI> file) { (void)c,(void)message,(void)action; return false; }
virtual bool sendFilePath(const Contact3 c, std::string_view file_name, std::string_view file_path) { (void)c,(void)file_name,(void)file_path; return false; }
virtual bool sendFileObj(const Contact3 c, ObjectHandle o) { (void)c,(void)o; return false; } // ideal for forwarding
// we want this back :)
//virtual bool sendFileMem(const Contact& c, std::string_view file_name, const std::vector<uint8_t>& file) = 0;
};

View File

@ -45,6 +45,7 @@ enum class RegistryMessageModel_Event : uint32_t {
message_updated,
message_destroy,
//???
send_text,
send_file_path,
@ -64,12 +65,13 @@ struct RegistryMessageModelEventI : public MessageModel3I {
// mm3
// send text
// send file path
// send file obj
};
using RegistryMessageModelEventProviderI = EventProviderI<RegistryMessageModelEventI>;
class RegistryMessageModel : public RegistryMessageModelEventProviderI, public MessageModel3I {
public:
static constexpr const char* version {"1"};
static constexpr const char* version {"2"};
protected:
Contact3Registry& _cr;