e2d801b84b
In Chat-O-Matic, text messages are enqueued by the ConversationView and appended when the ConversationView becomes attached to the window (editing a non-attached BTextView doesn't go well). Previously, only the receive-time was added to the enqueued message― so that if the view doesn't come into focus for a long while after message receipt, the timestamp is still accurate. The user's nickname and color weren't added as well, meaning that if the user left the room before the message was appended, the ugly user-id and default user color would be used instead. This appends user_color and user_name.
25 lines
527 B
C++
25 lines
527 B
C++
/*
|
|
* Copyright 2021, Jaidyn Levesque <jadedctrl@teknik.io>
|
|
* All rights reserved. Distributed under the terms of the MIT license.
|
|
*/
|
|
#ifndef _RENDER_VIEW_H
|
|
#define _RENDER_VIEW_H
|
|
|
|
#include <librunview/RunView.h>
|
|
|
|
|
|
class RenderView : public RunView {
|
|
public:
|
|
RenderView(const char* name);
|
|
|
|
void AppendGeneric(const char* message, int64 when);
|
|
void AppendUserstamp(const char* nick, rgb_color nameColor);
|
|
void AppendTimestamp(time_t time = 0);
|
|
|
|
private:
|
|
int fLastDay;
|
|
int fLastYear;
|
|
};
|
|
|
|
#endif // _RENDER_VIEW_H
|