From 8cf90ae85d9224475deb0c57e434b10d78602733 Mon Sep 17 00:00:00 2001 From: Beaudan Brown Date: Mon, 21 Oct 2019 14:29:32 +1100 Subject: [PATCH] Use message timestamp for empty messages --- js/modules/loki_app_dot_net_api.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/js/modules/loki_app_dot_net_api.js b/js/modules/loki_app_dot_net_api.js index bbc934ec6..92ef192d5 100644 --- a/js/modules/loki_app_dot_net_api.js +++ b/js/modules/loki_app_dot_net_api.js @@ -858,7 +858,8 @@ class LokiPublicChannelAPI { receivedAt, isPublic: true, message: { - body: adnMessage.text, + // == to compare string and number + body: adnMessage.text == timestamp ? '' : adnMessage.text, attachments, group: { id: this.conversationId, @@ -962,7 +963,7 @@ class LokiPublicChannelAPI { // create a message in the channel async sendMessage(data, messageTimeStamp) { const { quote, attachments, preview } = data; - const text = data.body; + const text = data.body || messageTimeStamp.toString(); const attachmentAnnotations = attachments.map( LokiPublicChannelAPI.getAnnotationFromAttachment );