commit 2cb5059f0353f2dca0762a3eba714361a7e19a2e
parent be913f75546422d3e8e1c3b84d0ee66ae3e26602
Author: TheJackiMonster <thejackimonster@gmail.com>
Date: Sat, 19 Mar 2022 20:23:17 +0100
Add sending read receipts depending on settings
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
Diffstat:
1 file changed, 8 insertions(+), 0 deletions(-)
diff --git a/src/event.c b/src/event.c
@@ -485,6 +485,11 @@ event_invitation(MESSENGER_Application *app,
if (!invitation)
return;
+ const int sent = GNUNET_CHAT_message_is_sent(msg);
+
+ if ((GNUNET_YES != sent) && (app->settings.send_read_receipts))
+ GNUNET_CHAT_context_send_read_receipt(context, msg);
+
UI_MESSAGE_Handle *message = ui_message_new(app, UI_MESSAGE_STATUS);
ui_message_update(message, app, msg);
@@ -553,6 +558,9 @@ event_receive_message(MESSENGER_Application *app,
if ((text) && (!(*text)))
goto skip_message;
+ if ((GNUNET_YES != sent) && (app->settings.send_read_receipts))
+ GNUNET_CHAT_context_send_read_receipt(context, msg);
+
const UI_MESSAGE_Type type = (
GNUNET_YES == sent? UI_MESSAGE_SENT : UI_MESSAGE_DEFAULT
);