From fff36dff6f91142138300787241cd40147e78446 Mon Sep 17 00:00:00 2001 From: Jaidyn Ann Date: Sun, 25 Jul 2021 10:15:21 -0500 Subject: [PATCH] Add 'when' to queued messages --- application/views/ConversationView.cpp | 6 ++++-- application/views/ConversationView.h | 18 +++++++++--------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/application/views/ConversationView.cpp b/application/views/ConversationView.cpp index e11bc1a..8721116 100644 --- a/application/views/ConversationView.cpp +++ b/application/views/ConversationView.cpp @@ -135,6 +135,7 @@ ConversationView::ImMessage(BMessage* msg) } case IM_MESSAGE_RECEIVED: { + msg->AddInt64("when", (int64)time(NULL)); _AppendOrEnqueueMessage(msg); fReceiveView->ScrollToBottom(); break; @@ -151,6 +152,7 @@ ConversationView::ImMessage(BMessage* msg) { BMessage msg; msg.AddString("body", B_TRANSLATE("** You joined the room.\n")); + msg.AddInt64("when", (int64)time(NULL)); _AppendOrEnqueueMessage(&msg); fReceiveView->ScrollToBottom(); } @@ -158,6 +160,7 @@ ConversationView::ImMessage(BMessage* msg) { BMessage msg; msg.AddString("body", B_TRANSLATE("** You created the room.\n")); + msg.AddInt64("when", (int64)time(NULL)); _AppendOrEnqueueMessage(&msg); fReceiveView->ScrollToBottom(); } @@ -383,8 +386,7 @@ ConversationView::_UserMessage(const char* format, const char* bodyFormat, BMessage newMsg; newMsg.AddString("body", newBody); + newMsg.AddInt64("when", (int64)time(NULL)); _AppendOrEnqueueMessage(&newMsg); fReceiveView->ScrollToBottom(); } - - diff --git a/application/views/ConversationView.h b/application/views/ConversationView.h index d45335b..99fd3c3 100644 --- a/application/views/ConversationView.h +++ b/application/views/ConversationView.h @@ -54,17 +54,17 @@ private: void _UserMessage(const char* format, const char* bodyFormat, BMessage* msg); - Conversation* fConversation; - BObjectList fMessageQueue; + Conversation* fConversation; + BObjectList fMessageQueue; - BTextView* fNameTextView; - BTextView* fSubjectTextView; - BitmapView* fProtocolView; - BitmapView* fIcon; + BTextView* fNameTextView; + BTextView* fSubjectTextView; + BitmapView* fProtocolView; + BitmapView* fIcon; - RenderView* fReceiveView; - UserListView* fUserList; - SendTextView* fSendView; + RenderView* fReceiveView; + UserListView* fUserList; + SendTextView* fSendView; };