Add extra context to messages that are added to channels, allowing the logging controller to take more responsibility in what messages to log (#5499)

Co-auhtored-by: James Upjohn <jupjohn@jammeh.co.nz>
This commit is contained in:
pajlada
2024-07-13 13:15:11 +02:00
committed by GitHub
parent 49de421bd8
commit 973b7a3bdd
26 changed files with 163 additions and 139 deletions
+10 -1
View File
@@ -28,6 +28,14 @@ enum class TimeoutStackStyle : int {
Default = DontStackBeyondUserMessage,
};
/// Context of the message being added to a channel
enum class MessageContext {
/// This message is the original
Original,
/// This message is a repost of a message that has already been added in a channel
Repost,
};
class Channel : public std::enable_shared_from_this<Channel>
{
public:
@@ -79,7 +87,7 @@ public:
// overridingFlags can be filled in with flags that should be used instead
// of the message's flags. This is useful in case a flag is specific to a
// type of split
void addMessage(MessagePtr message,
void addMessage(MessagePtr message, MessageContext context,
std::optional<MessageFlags> overridingFlags = std::nullopt);
void addMessagesAtStart(const std::vector<MessagePtr> &messages_);
@@ -120,6 +128,7 @@ public:
protected:
virtual void onConnected();
virtual void messageRemovedFromStart(const MessagePtr &msg);
QString platform_{"other"};
private:
const QString name_;