add a generic way to get a stable id from a contact

This commit is contained in:
Green Sky 2023-11-03 14:09:45 +01:00
parent 5ff7d1cee0
commit 2d73c7272c
No known key found for this signature in database
2 changed files with 9 additions and 0 deletions

View File

@ -43,6 +43,14 @@ namespace Contact::Components {
std::string name;
};
// stable, probably unique, ID
// eg for tox this would be the public key of the contact
// if the protocol does not have its own ids, you can use a hash or a random byte array
// TODO: make more length specific variants?
struct ID {
std::vector<uint8_t> data;
};
// (display)alias
// tag to signal an avatar change, and the texture needs to be reloaded

View File

@ -22,6 +22,7 @@ DEFINE_COMP_ID(Contact::Components::Parent)
DEFINE_COMP_ID(Contact::Components::ParentOf)
DEFINE_COMP_ID(Contact::Components::ContactModel)
DEFINE_COMP_ID(Contact::Components::Name)
DEFINE_COMP_ID(Contact::Components::ID)
DEFINE_COMP_ID(Contact::Components::TagAvatarInvalidate)
DEFINE_COMP_ID(Contact::Components::AvatarMemory)
DEFINE_COMP_ID(Contact::Components::AvatarFile)