Open usercard on mention click (#1674)

This commit is contained in:
Daniel
2020-07-18 10:03:51 -04:00
committed by GitHub
parent 276f3e1d98
commit ba06b10135
10 changed files with 175 additions and 70 deletions
+11 -1
View File
@@ -22,6 +22,7 @@ const SystemMessageTag systemMessage{};
const TimeoutMessageTag timeoutMessage{};
MessagePtr makeSystemMessage(const QString &text);
MessagePtr makeSystemMessage(const QString &text, const QTime &time);
std::pair<MessagePtr, MessagePtr> makeAutomodMessage(
const AutomodAction &action);
@@ -37,7 +38,10 @@ class MessageBuilder
{
public:
MessageBuilder();
MessageBuilder(SystemMessageTag, const QString &text);
MessageBuilder(SystemMessageTag, const QString &text,
const QTime &time = QTime::currentTime());
MessageBuilder(TimeoutMessageTag, const QString &systemMessageText,
int times);
MessageBuilder(TimeoutMessageTag, const QString &username,
const QString &durationInSeconds, const QString &reason,
bool multipleTimes);
@@ -67,6 +71,12 @@ public:
}
private:
// Helper method that emplaces some text stylized as system text
// and then appends that text to the QString parameter "toUpdate".
// Returns the TextElement that was emplaced.
TextElement *emplaceSystemTextAndUpdate(const QString &text,
QString &toUpdate);
std::shared_ptr<Message> message_;
};