update deps and last seen first seen
Some checks are pending
ContinuousDelivery / linux-ubuntu (push) Waiting to run
ContinuousDelivery / android (map[ndk_abi:arm64-v8a vcpkg_toolkit:arm64-android]) (push) Waiting to run
ContinuousDelivery / android (map[ndk_abi:armeabi-v7a vcpkg_toolkit:arm-neon-android]) (push) Waiting to run
ContinuousDelivery / android (map[ndk_abi:x86_64 vcpkg_toolkit:x64-android]) (push) Waiting to run
ContinuousDelivery / windows (push) Waiting to run
ContinuousDelivery / windows-asan (push) Waiting to run
ContinuousDelivery / release (push) Blocked by required conditions
ContinuousIntegration / linux (push) Waiting to run
ContinuousIntegration / android (map[ndk_abi:arm64-v8a vcpkg_toolkit:arm64-android]) (push) Waiting to run
ContinuousIntegration / android (map[ndk_abi:armeabi-v7a vcpkg_toolkit:arm-neon-android]) (push) Waiting to run
ContinuousIntegration / android (map[ndk_abi:x86_64 vcpkg_toolkit:x64-android]) (push) Waiting to run
ContinuousIntegration / macos (push) Waiting to run
ContinuousIntegration / windows (push) Waiting to run

This commit is contained in:
Green Sky
2025-01-07 21:30:40 +01:00
parent 0fb985c4f9
commit 3647ff3d54
16 changed files with 55 additions and 63 deletions

View File

@ -2,6 +2,7 @@
#include <solanaceae/contact/components.hpp>
#include <solanaceae/util/utils.hpp>
#include <solanaceae/util/time.hpp>
#include <imgui/imgui.h>
//#include <imgui/imgui_internal.h>
@ -12,6 +13,8 @@
#include "./icons/person.hpp"
#include "./icons/group.hpp"
#include <cinttypes>
void renderAvatar(
const Theme& th,
ContactTextureCache& contact_tc,
@ -114,6 +117,22 @@ bool renderContactBig(
ImGui::TextUnformatted("Connection state: unknown");
}
// TODO: better time formatter
const int64_t ts_now = getTimeMS();
if (const auto* cfirst = c.try_get<Contact::Components::FirstSeen>(); cfirst != nullptr) {
ImGui::Text("First seen: %" PRId64 "s ago", (ts_now - int64_t(cfirst->ts))/1000);
}
// TODO: fill with useful values periodically, maybe only show if not online?
//if (const auto* clast = c.try_get<Contact::Components::LastSeen>(); clast != nullptr) {
// ImGui::Text("Last seen: %" PRId64 "s ago", (ts_now - int64_t(clast->ts))/1000);
//}
if (const auto* clasta = c.try_get<Contact::Components::LastActivity>(); clasta != nullptr) {
ImGui::Text("Last Activity: %" PRId64 "s ago", (ts_now - int64_t(clasta->ts))/1000);
}
if (
const auto* slt = c.try_get<Contact::Components::StatusText>();
slt != nullptr &&

View File

@ -6,6 +6,8 @@
#include "../image_loader_qoi.hpp"
#include "../image_loader_sdl_image.hpp"
#include <solanaceae/util/time.hpp>
#include <filesystem>
#include <solanaceae/file/file2_std.hpp>
@ -13,11 +15,6 @@
#include <cmath>
// fwd
namespace Message {
uint64_t getTimeMS(void);
}
SendImagePopup::SendImagePopup(TextureUploaderI& tu) : _tu(tu) {
_image_loaders.push_back(std::make_unique<ImageLoaderSDLBMP>());
_image_loaders.push_back(std::make_unique<ImageLoaderQOI>());
@ -90,7 +87,7 @@ bool SendImagePopup::load(void) {
}
assert(preview_image.textures.empty());
preview_image.timestamp_last_rendered = Message::getTimeMS();
preview_image.timestamp_last_rendered = getTimeMS();
preview_image.current_texture = 0;
for (const auto& [ms, data] : original_image.frames) {
const auto n_t = _tu.upload(data.data(), original_image.width, original_image.height);
@ -226,7 +223,7 @@ void SendImagePopup::render(float time_delta) {
//const auto TEXT_BASE_WIDTH = ImGui::CalcTextSize("A").x;
const auto TEXT_BASE_HEIGHT = ImGui::GetTextLineHeightWithSpacing();
preview_image.doAnimation(Message::getTimeMS());
preview_image.doAnimation(getTimeMS());
time += time_delta;
time = fmod(time, 1.f); // fract()