messenger-gtk

Gtk+3 graphical user interfaces for GNUnet Messenger
Log | Files | Refs | Submodules | README | LICENSE

commit 7e69780bb3d18e5abe01202b3b7881548fc5be72
parent 963ca5e24a56e17be1ba1bbff2a498c7837edb55
Author: TheJackiMonster <thejackimonster@gmail.com>
Date:   Thu, 23 Dec 2021 15:48:15 +0100

Added timestamp to join messages in chat

Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>

Diffstat:
Mresources/ui/chat_entry.ui | 3+++
Msrc/event.c | 7+++++++
2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/resources/ui/chat_entry.ui b/resources/ui/chat_entry.ui @@ -70,6 +70,9 @@ Author: Tobias Frisch <property name="visible">True</property> <property name="can-focus">False</property> <property name="justify">right</property> + <style> + <class name="timestamp-label"/> + </style> </object> <packing> <property name="expand">False</property> diff --git a/src/event.c b/src/event.c @@ -263,7 +263,14 @@ event_joining_contact(MESSENGER_Application *app, "avatar-default-symbolic" ); + struct GNUNET_TIME_Absolute timestamp = GNUNET_CHAT_message_get_timestamp( + msg + ); + + const gchar *time = GNUNET_STRINGS_absolute_time_to_string(timestamp); + gtk_label_set_text(message->text_label, join_message); + gtk_label_set_text(message->timestamp_label, time? time : ""); gtk_container_add( GTK_CONTAINER(handle->chat->messages_listbox),