syncedBy got moved and adopt the timestamp change
This commit is contained in:
parent
c01d91144c
commit
a5da51a428
@ -15,10 +15,6 @@ struct ToxGroupMessageID {
|
|||||||
|
|
||||||
// TODO: move all those comps
|
// TODO: move all those comps
|
||||||
|
|
||||||
struct SyncedBy {
|
|
||||||
std::set<Contact3> list;
|
|
||||||
};
|
|
||||||
|
|
||||||
namespace Transfer {
|
namespace Transfer {
|
||||||
|
|
||||||
struct ToxTransferFriend {
|
struct ToxTransferFriend {
|
||||||
|
@ -13,7 +13,6 @@ constexpr entt::id_type entt::type_hash<x>::value() noexcept { \
|
|||||||
// cross compile(r) stable ids
|
// cross compile(r) stable ids
|
||||||
|
|
||||||
DEFINE_COMP_ID(Message::Components::ToxGroupMessageID)
|
DEFINE_COMP_ID(Message::Components::ToxGroupMessageID)
|
||||||
DEFINE_COMP_ID(Message::Components::SyncedBy)
|
|
||||||
DEFINE_COMP_ID(Message::Components::Transfer::ToxTransferFriend)
|
DEFINE_COMP_ID(Message::Components::Transfer::ToxTransferFriend)
|
||||||
DEFINE_COMP_ID(Message::Components::Transfer::FileID)
|
DEFINE_COMP_ID(Message::Components::Transfer::FileID)
|
||||||
DEFINE_COMP_ID(Message::Components::Transfer::FileKind)
|
DEFINE_COMP_ID(Message::Components::Transfer::FileKind)
|
||||||
|
@ -128,8 +128,7 @@ bool ToxMessageManager::sendText(const Contact3 c, std::string_view message, boo
|
|||||||
reg.emplace<Message::Components::ToxGroupMessageID>(new_msg_e, message_id_opt.value());
|
reg.emplace<Message::Components::ToxGroupMessageID>(new_msg_e, message_id_opt.value());
|
||||||
|
|
||||||
// TODO: generalize?
|
// TODO: generalize?
|
||||||
auto& synced_by = reg.emplace<Message::Components::SyncedBy>(new_msg_e).list;
|
reg.emplace<Message::Components::SyncedBy>(new_msg_e).ts.emplace(c_self, ts);
|
||||||
synced_by.emplace(c_self);
|
|
||||||
}
|
}
|
||||||
} else if (
|
} else if (
|
||||||
// non online group
|
// non online group
|
||||||
@ -140,8 +139,7 @@ bool ToxMessageManager::sendText(const Contact3 c, std::string_view message, boo
|
|||||||
reg.emplace<Message::Components::ToxGroupMessageID>(new_msg_e, msg_id);
|
reg.emplace<Message::Components::ToxGroupMessageID>(new_msg_e, msg_id);
|
||||||
|
|
||||||
// TODO: generalize?
|
// TODO: generalize?
|
||||||
auto& synced_by = reg.emplace<Message::Components::SyncedBy>(new_msg_e).list;
|
reg.emplace<Message::Components::SyncedBy>(new_msg_e).ts.emplace(c_self, ts);
|
||||||
synced_by.emplace(c_self);
|
|
||||||
} else if (
|
} else if (
|
||||||
_cr.any_of<Contact::Components::ToxGroupPeerEphemeral>(c)
|
_cr.any_of<Contact::Components::ToxGroupPeerEphemeral>(c)
|
||||||
) {
|
) {
|
||||||
@ -256,8 +254,7 @@ bool ToxMessageManager::onToxEvent(const Tox_Event_Group_Message* e) {
|
|||||||
reg.emplace<Message::Components::TagUnread>(new_msg_e);
|
reg.emplace<Message::Components::TagUnread>(new_msg_e);
|
||||||
|
|
||||||
{ // by whom
|
{ // by whom
|
||||||
auto& synced_by = reg.get_or_emplace<Message::Components::SyncedBy>(new_msg_e).list;
|
reg.get_or_emplace<Message::Components::SyncedBy>(new_msg_e).ts.emplace(self_c, ts);
|
||||||
synced_by.emplace(self_c);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_rmm.throwEventConstruct(reg, new_msg_e);
|
_rmm.throwEventConstruct(reg, new_msg_e);
|
||||||
|
Loading…
Reference in New Issue
Block a user