Minetest 5.9.0-dev
 
Loading...
Searching...
No Matches
chatmessage.h
Go to the documentation of this file.
1/*
2Minetest
3Copyright (C) 2017 nerzhul, Loic Blot <loic.blot@unix-experience.fr>
4
5This program is free software; you can redistribute it and/or modify
6it under the terms of the GNU Lesser General Public License as published by
7the Free Software Foundation; either version 2.1 of the License, or
8(at your option) any later version.
9
10This program is distributed in the hope that it will be useful,
11but WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU Lesser General Public License for more details.
14
15You should have received a copy of the GNU Lesser General Public License along
16with this program; if not, write to the Free Software Foundation, Inc.,
1751 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18*/
19
20#pragma once
21
22#include <string>
23#include <ctime>
24
26{
32};
33
35{
36 ChatMessage(const std::wstring &m = L"") : message(m) {}
37
38 ChatMessage(ChatMessageType t, const std::wstring &m, const std::wstring &s = L"",
39 std::time_t ts = std::time(0)) :
40 type(t),
41 message(m), sender(s), timestamp(ts)
42 {
43 }
44
46 std::wstring message = L"";
47 std::wstring sender = L"";
48 std::time_t timestamp = std::time(0);
49};
ChatMessageType
Definition: chatmessage.h:26
@ CHATMESSAGE_TYPE_RAW
Definition: chatmessage.h:27
@ CHATMESSAGE_TYPE_ANNOUNCE
Definition: chatmessage.h:29
@ CHATMESSAGE_TYPE_SYSTEM
Definition: chatmessage.h:30
@ CHATMESSAGE_TYPE_MAX
Definition: chatmessage.h:31
@ CHATMESSAGE_TYPE_NORMAL
Definition: chatmessage.h:28
Definition: chatmessage.h:35
std::wstring sender
Definition: chatmessage.h:47
std::wstring message
Definition: chatmessage.h:46
ChatMessage(const std::wstring &m=L"")
Definition: chatmessage.h:36
ChatMessage(ChatMessageType t, const std::wstring &m, const std::wstring &s=L"", std::time_t ts=std::time(0))
Definition: chatmessage.h:38
ChatMessageType type
Definition: chatmessage.h:45
std::time_t timestamp
Definition: chatmessage.h:48