Luanti 5.10.0-dev
 
Loading...
Searching...
No Matches
chatmessage.h
Go to the documentation of this file.
1// Luanti
2// SPDX-License-Identifier: LGPL-2.1-or-later
3// Copyright (C) 2017 nerzhul, Loic Blot <loic.blot@unix-experience.fr>
4
5#pragma once
6
7#include <string>
8#include <ctime>
9
18
20{
21 ChatMessage(const std::wstring &m = L"") : message(m) {}
22
23 ChatMessage(ChatMessageType t, const std::wstring &m, const std::wstring &s = L"",
24 std::time_t ts = std::time(0)) :
25 type(t),
26 message(m), sender(s), timestamp(ts)
27 {
28 }
29
31 std::wstring message = L"";
32 std::wstring sender = L"";
33 std::time_t timestamp = std::time(0);
34};
ChatMessageType
Definition chatmessage.h:11
@ CHATMESSAGE_TYPE_RAW
Definition chatmessage.h:12
@ CHATMESSAGE_TYPE_ANNOUNCE
Definition chatmessage.h:14
@ CHATMESSAGE_TYPE_SYSTEM
Definition chatmessage.h:15
@ CHATMESSAGE_TYPE_MAX
Definition chatmessage.h:16
@ CHATMESSAGE_TYPE_NORMAL
Definition chatmessage.h:13
Definition chatmessage.h:20
std::wstring sender
Definition chatmessage.h:32
std::wstring message
Definition chatmessage.h:31
ChatMessage(const std::wstring &m=L"")
Definition chatmessage.h:21
ChatMessage(ChatMessageType t, const std::wstring &m, const std::wstring &s=L"", std::time_t ts=std::time(0))
Definition chatmessage.h:23
ChatMessageType type
Definition chatmessage.h:30
std::time_t timestamp
Definition chatmessage.h:33