update to rmmi

This commit is contained in:
Green Sky 2024-10-06 11:57:14 +02:00
parent 70bc3a47f2
commit f7471ca4cb
No known key found for this signature in database
10 changed files with 16 additions and 15 deletions

@ -1 +1 @@
Subproject commit 9728f71c9833baa65995e19e993d3450da750c20 Subproject commit 3e6c857c8ad509a94e5a309a5061c5729fbcc439

@ -1 +1 @@
Subproject commit 1a3d9dd1870b1f45e252ff636adfd0c1f0ccf521 Subproject commit 2e34ad2100afb314a3cf6d9336adc78d60ced638

View File

@ -201,7 +201,7 @@ void ChatGui4::setClipboardData(std::vector<std::string> mime_types, std::shared
ChatGui4::ChatGui4( ChatGui4::ChatGui4(
ConfigModelI& conf, ConfigModelI& conf,
ObjectStore2& os, ObjectStore2& os,
RegistryMessageModel& rmm, RegistryMessageModelI& rmm,
Contact3Registry& cr, Contact3Registry& cr,
TextureUploaderI& tu, TextureUploaderI& tu,
ContactTextureCache& contact_tc, ContactTextureCache& contact_tc,

View File

@ -27,7 +27,7 @@ using MessageTextureCache = TextureCache<void*, Message3Handle, MessageImageLoad
class ChatGui4 { class ChatGui4 {
ConfigModelI& _conf; ConfigModelI& _conf;
ObjectStore2& _os; ObjectStore2& _os;
RegistryMessageModel& _rmm; RegistryMessageModelI& _rmm;
Contact3Registry& _cr; Contact3Registry& _cr;
ContactTextureCache& _contact_tc; ContactTextureCache& _contact_tc;
@ -60,7 +60,7 @@ class ChatGui4 {
ChatGui4( ChatGui4(
ConfigModelI& conf, ConfigModelI& conf,
ObjectStore2& os, ObjectStore2& os,
RegistryMessageModel& rmm, RegistryMessageModelI& rmm,
Contact3Registry& cr, Contact3Registry& cr,
TextureUploaderI& tu, TextureUploaderI& tu,
ContactTextureCache& contact_tc, ContactTextureCache& contact_tc,

View File

@ -75,7 +75,7 @@ MainScreen::MainScreen(SimpleConfigModel&& conf_, SDL_Renderer* renderer_, Theme
g_provideInstance<ConfigModelI>("ConfigModelI", "host", &conf); g_provideInstance<ConfigModelI>("ConfigModelI", "host", &conf);
g_provideInstance<Contact3Registry>("Contact3Registry", "1", "host", &cr); g_provideInstance<Contact3Registry>("Contact3Registry", "1", "host", &cr);
g_provideInstance<RegistryMessageModel>("RegistryMessageModel", "host", &rmm); g_provideInstance<RegistryMessageModelI>("RegistryMessageModelI", "host", &rmm);
g_provideInstance<MessageSerializerNJ>("MessageSerializerNJ", "host", &msnj); g_provideInstance<MessageSerializerNJ>("MessageSerializerNJ", "host", &msnj);
g_provideInstance<ToxI>("ToxI", "host", &tc); g_provideInstance<ToxI>("ToxI", "host", &tc);

View File

@ -6,6 +6,7 @@
#include <solanaceae/util/simple_config_model.hpp> #include <solanaceae/util/simple_config_model.hpp>
#include <solanaceae/contact/contact_model3.hpp> #include <solanaceae/contact/contact_model3.hpp>
#include <solanaceae/message3/registry_message_model.hpp> #include <solanaceae/message3/registry_message_model.hpp>
#include <solanaceae/message3/registry_message_model_impl.hpp>
#include <solanaceae/message3/message_time_sort.hpp> #include <solanaceae/message3/message_time_sort.hpp>
#include <solanaceae/message3/message_serializer.hpp> #include <solanaceae/message3/message_serializer.hpp>
#include <solanaceae/plugin/plugin_manager.hpp> #include <solanaceae/plugin/plugin_manager.hpp>
@ -58,7 +59,7 @@ struct MainScreen final : public Screen {
SimpleConfigModel conf; SimpleConfigModel conf;
Contact3Registry cr; Contact3Registry cr;
RegistryMessageModel rmm; RegistryMessageModelImpl rmm;
MessageSerializerNJ msnj; MessageSerializerNJ msnj;
MessageTimeSort mts; MessageTimeSort mts;

View File

@ -120,7 +120,7 @@ void MediaMetaInfoLoader::handleMessage(const Message3Handle& m) {
_rmm.throwEventUpdate(m); _rmm.throwEventUpdate(m);
} }
MediaMetaInfoLoader::MediaMetaInfoLoader(RegistryMessageModel& rmm) : _rmm(rmm) { MediaMetaInfoLoader::MediaMetaInfoLoader(RegistryMessageModelI& rmm) : _rmm(rmm) {
// HACK: make them be added externally? // HACK: make them be added externally?
_image_loaders.push_back(std::make_unique<ImageLoaderWebP>()); _image_loaders.push_back(std::make_unique<ImageLoaderWebP>());
_image_loaders.push_back(std::make_unique<ImageLoaderSDLBMP>()); _image_loaders.push_back(std::make_unique<ImageLoaderSDLBMP>());

View File

@ -13,14 +13,14 @@ namespace Message::Components {
// adds metadata to file messages // adds metadata to file messages
class MediaMetaInfoLoader : public RegistryMessageModelEventI { class MediaMetaInfoLoader : public RegistryMessageModelEventI {
protected: protected:
RegistryMessageModel& _rmm; RegistryMessageModelI& _rmm;
std::vector<std::unique_ptr<ImageLoaderI>> _image_loaders; std::vector<std::unique_ptr<ImageLoaderI>> _image_loaders;
void handleMessage(const Message3Handle& m); void handleMessage(const Message3Handle& m);
public: public:
MediaMetaInfoLoader(RegistryMessageModel& rmm); MediaMetaInfoLoader(RegistryMessageModelI& rmm);
virtual ~MediaMetaInfoLoader(void); virtual ~MediaMetaInfoLoader(void);
protected: // rmm protected: // rmm

View File

@ -26,7 +26,7 @@ namespace Contact::Components {
ToxFriendFauxOfflineMessaging::ToxFriendFauxOfflineMessaging( ToxFriendFauxOfflineMessaging::ToxFriendFauxOfflineMessaging(
Contact3Registry& cr, Contact3Registry& cr,
RegistryMessageModel& rmm, RegistryMessageModelI& rmm,
ToxContactModel2& tcm, ToxContactModel2& tcm,
ToxI& t, ToxI& t,
ToxEventProviderI& tep ToxEventProviderI& tep
@ -54,7 +54,7 @@ float ToxFriendFauxOfflineMessaging::tick(float time_delta) {
// cleanup // cleanup
if (_cr.all_of<Contact::Components::NextSendAttempt>(c)) { if (_cr.all_of<Contact::Components::NextSendAttempt>(c)) {
_cr.remove<Contact::Components::NextSendAttempt>(c); _cr.remove<Contact::Components::NextSendAttempt>(c);
auto* mr = static_cast<const RegistryMessageModel&>(_rmm).get(c); auto* mr = static_cast<const RegistryMessageModelI&>(_rmm).get(c);
if (mr != nullptr) { if (mr != nullptr) {
mr->storage<Message::Components::LastSendAttempt>().clear(); mr->storage<Message::Components::LastSendAttempt>().clear();
} }
@ -99,7 +99,7 @@ ToxFriendFauxOfflineMessaging::dfmc_Ret ToxFriendFauxOfflineMessaging::doFriendM
// unacked message // unacked message
// timeouts for exising unacked messages expired (send) // timeouts for exising unacked messages expired (send)
auto* mr = static_cast<const RegistryMessageModel&>(_rmm).get(c); auto* mr = static_cast<const RegistryMessageModelI&>(_rmm).get(c);
if (mr == nullptr) { if (mr == nullptr) {
// no messages // no messages
return dfmc_Ret::NO_MSG; return dfmc_Ret::NO_MSG;

View File

@ -15,7 +15,7 @@ namespace Contact::Components {
// timers get reset on connection changes, and send order is preserved. // timers get reset on connection changes, and send order is preserved.
class ToxFriendFauxOfflineMessaging : public ToxEventI { class ToxFriendFauxOfflineMessaging : public ToxEventI {
Contact3Registry& _cr; Contact3Registry& _cr;
RegistryMessageModel& _rmm; RegistryMessageModelI& _rmm;
ToxContactModel2& _tcm; ToxContactModel2& _tcm;
ToxI& _t; ToxI& _t;
ToxEventProviderI& _tep; ToxEventProviderI& _tep;
@ -30,7 +30,7 @@ class ToxFriendFauxOfflineMessaging : public ToxEventI {
public: public:
ToxFriendFauxOfflineMessaging( ToxFriendFauxOfflineMessaging(
Contact3Registry& cr, Contact3Registry& cr,
RegistryMessageModel& rmm, RegistryMessageModelI& rmm,
ToxContactModel2& tcm, ToxContactModel2& tcm,
ToxI& t, ToxI& t,
ToxEventProviderI& tep ToxEventProviderI& tep