Chatterino
Whisper.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <QColor>
4 #include <QJsonObject>
5 #include <QString>
6 
7 #include <magic_enum.hpp>
8 
9 namespace chatterino {
10 
12  enum class Type {
15  Thread,
16 
17  INVALID,
18  };
19 
20  QString typeString;
22 
23  QString messageID;
24  int id;
25  QString threadID;
26  QString body;
27  QString fromUserID;
28  QString fromUserLogin;
30  QColor fromUserColor;
31 
32  PubSubWhisperMessage(const QJsonObject &root);
33 };
34 
35 } // namespace chatterino
36 
37 template <>
38 constexpr magic_enum::customize::customize_t
39  magic_enum::customize::enum_name<chatterino::PubSubWhisperMessage::Type>(
41 {
42  switch (value)
43  {
45  return "whisper_received";
46 
48  return "whisper_sent";
49 
51  return "thread";
52  default:
53  return default_tag;
54  }
55 }
QString fromUserLogin
Definition: Whisper.hpp:28
Type
Definition: Whisper.hpp:12
QString fromUserID
Definition: Whisper.hpp:27
Definition: Whisper.hpp:11
Definition: Application.cpp:48
int id
Definition: Whisper.hpp:24
QColor fromUserColor
Definition: Whisper.hpp:30
Type type
Definition: Whisper.hpp:21
QString messageID
Definition: Whisper.hpp:23
QString threadID
Definition: Whisper.hpp:25
QString typeString
Definition: Whisper.hpp:20
PubSubWhisperMessage(const QJsonObject &root)
Definition: Whisper.cpp:5
QString fromUserDisplayName
Definition: Whisper.hpp:29
QString body
Definition: Whisper.hpp:26