From e2917c497c91f91f8febcd1f43e462fad8359305 Mon Sep 17 00:00:00 2001 From: Green Sky Date: Tue, 7 Jan 2025 16:31:46 +0100 Subject: [PATCH] add first seen, last seen and last activity --- src/solanaceae/contact/components.hpp | 16 +++++++++++++++- src/solanaceae/contact/components_id.inl | 3 +++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/solanaceae/contact/components.hpp b/src/solanaceae/contact/components.hpp index 2d1c331..febaf2c 100644 --- a/src/solanaceae/contact/components.hpp +++ b/src/solanaceae/contact/components.hpp @@ -108,7 +108,21 @@ namespace Contact::Components { } }; - // last seen (not disconnected?) + // the first time *we* have seen the contact + struct FirstSeen { + uint64_t ts {0}; + }; + + struct LastSeen { + // update rate might vary, check connection state first + uint64_t ts {0}; + }; + + struct LastActivity { + // message observed + // maybe status set + uint64_t ts {0}; + }; } // Contact::Components diff --git a/src/solanaceae/contact/components_id.inl b/src/solanaceae/contact/components_id.inl index 46006d0..819b72e 100644 --- a/src/solanaceae/contact/components_id.inl +++ b/src/solanaceae/contact/components_id.inl @@ -37,6 +37,9 @@ DEFINE_COMP_ID(Contact::Components::AvatarMemory) DEFINE_COMP_ID(Contact::Components::AvatarFile) DEFINE_COMP_ID(Contact::Components::ConnectionState) DEFINE_COMP_ID(Contact::Components::StatusText) +DEFINE_COMP_ID(Contact::Components::FirstSeen) +DEFINE_COMP_ID(Contact::Components::LastSeen) +DEFINE_COMP_ID(Contact::Components::LastActivity) #undef DEFINE_COMP_ID