2024-10-28 15:57:39 +01:00
|
|
|
// Luanti
|
|
|
|
// SPDX-License-Identifier: LGPL-2.1-or-later
|
|
|
|
// Copyright (C) 2017 nerzhul, Loic Blot <loic.blot@unix-experience.fr>
|
2017-07-16 10:47:31 +02:00
|
|
|
|
2017-08-17 22:19:39 +02:00
|
|
|
#pragma once
|
2017-07-16 10:47:31 +02:00
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <ctime>
|
|
|
|
|
|
|
|
enum ChatMessageType
|
|
|
|
{
|
|
|
|
CHATMESSAGE_TYPE_RAW = 0,
|
|
|
|
CHATMESSAGE_TYPE_NORMAL = 1,
|
|
|
|
CHATMESSAGE_TYPE_ANNOUNCE = 2,
|
|
|
|
CHATMESSAGE_TYPE_SYSTEM = 3,
|
|
|
|
CHATMESSAGE_TYPE_MAX = 4,
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ChatMessage
|
|
|
|
{
|
|
|
|
ChatMessage(const std::wstring &m = L"") : message(m) {}
|
|
|
|
|
|
|
|
ChatMessage(ChatMessageType t, const std::wstring &m, const std::wstring &s = L"",
|
2017-10-09 11:32:06 +02:00
|
|
|
std::time_t ts = std::time(0)) :
|
|
|
|
type(t),
|
|
|
|
message(m), sender(s), timestamp(ts)
|
2017-07-16 10:47:31 +02:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
ChatMessageType type = CHATMESSAGE_TYPE_RAW;
|
|
|
|
std::wstring message = L"";
|
|
|
|
std::wstring sender = L"";
|
|
|
|
std::time_t timestamp = std::time(0);
|
|
|
|
};
|