adf3ff3075
cstdint) Make MessageElement to a class to fit better with the derived classes. Make MessageLayoutElement to a class to fit better with the derived classes. Remove virtual from override functions Replace all instances of boost::signals2 with pajlada::Signals. This lets us properly use clang code model to check for issues. Add missing virtual destructor to AbstractIrcServer Add missing virtual destructor to MessageLayoutElement Remove unused "connectedConnection" connection in TwitchChannel Fix typo in TrimChannelName function Fix typo in MessageParseArgs Replace some raw pointers with unique pointers where it made more sense. This allowed us to remove some manually written destructors whose only purpose was to delete that raw pointer. Reformat: Add namespace comments Reformat: Add empty empty lines between main namespace beginning and end Reformat: Re-order includes Reformat: Fix some includes that used quotes where they should use angle brackets Reformat: Replace some typedef's with using's Filter out more useless warnings
61 lines
1.6 KiB
C++
61 lines
1.6 KiB
C++
#pragma once
|
|
|
|
#include "messages/messageelement.hpp"
|
|
#include "util/flagsenum.hpp"
|
|
#include "widgets/helper/scrollbarhighlight.hpp"
|
|
|
|
#include <QTime>
|
|
|
|
#include <cinttypes>
|
|
#include <memory>
|
|
#include <vector>
|
|
|
|
namespace chatterino {
|
|
namespace messages {
|
|
|
|
struct Message {
|
|
enum MessageFlags : uint16_t {
|
|
None = 0,
|
|
System = (1 << 0),
|
|
Timeout = (1 << 1),
|
|
Highlighted = (1 << 2),
|
|
DoNotTriggerNotification = (1 << 3), // disable notification sound
|
|
Centered = (1 << 4),
|
|
Disabled = (1 << 5),
|
|
DisableCompactEmotes = (1 << 6),
|
|
Collapsed = (1 << 7),
|
|
DisconnectedMessage = (1 << 8),
|
|
};
|
|
|
|
util::FlagsEnum<MessageFlags> flags;
|
|
QTime parseTime;
|
|
QString id;
|
|
QString searchText;
|
|
QString loginName;
|
|
QString displayName;
|
|
QString localizedName;
|
|
QString timeoutUser;
|
|
|
|
// Messages should not be added after the message is done initializing.
|
|
void addElement(MessageElement *element);
|
|
const std::vector<std::unique_ptr<MessageElement>> &getElements() const;
|
|
|
|
// Scrollbar
|
|
widgets::ScrollbarHighlight getScrollBarHighlight() const;
|
|
|
|
private:
|
|
std::vector<std::unique_ptr<MessageElement>> elements;
|
|
|
|
public:
|
|
static std::shared_ptr<Message> createSystemMessage(const QString &text);
|
|
|
|
static std::shared_ptr<Message> createTimeoutMessage(const QString &username,
|
|
const QString &durationInSeconds,
|
|
const QString &reason, bool multipleTimes);
|
|
};
|
|
|
|
using MessagePtr = std::shared_ptr<Message>;
|
|
|
|
} // namespace messages
|
|
} // namespace chatterino
|