Refactored the Image Uploader feature. (#4971)

Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
Mm2PL
2023-11-19 12:05:30 +01:00
committed by GitHub
parent 7898b97fc2
commit fbc8aacabe
13 changed files with 266 additions and 139 deletions
+17
View File
@@ -37,6 +37,9 @@ struct LiveUpdatesAddEmoteMessageTag {
};
struct LiveUpdatesUpdateEmoteSetMessageTag {
};
struct ImageUploaderResultTag {
};
const SystemMessageTag systemMessage{};
const TimeoutMessageTag timeoutMessage{};
const LiveUpdatesUpdateEmoteMessageTag liveUpdatesUpdateEmoteMessage{};
@@ -44,6 +47,10 @@ const LiveUpdatesRemoveEmoteMessageTag liveUpdatesRemoveEmoteMessage{};
const LiveUpdatesAddEmoteMessageTag liveUpdatesAddEmoteMessage{};
const LiveUpdatesUpdateEmoteSetMessageTag liveUpdatesUpdateEmoteSetMessage{};
// This signifies that you want to construct a message containing the result of
// a successful image upload.
const ImageUploaderResultTag imageUploaderResultMessage{};
MessagePtr makeSystemMessage(const QString &text);
MessagePtr makeSystemMessage(const QString &text, const QTime &time);
std::pair<MessagePtr, MessagePtr> makeAutomodMessage(
@@ -88,6 +95,16 @@ public:
MessageBuilder(LiveUpdatesUpdateEmoteSetMessageTag, const QString &platform,
const QString &actor, const QString &emoteSetName);
/**
* "Your image has been uploaded to %1[ (Deletion link: %2)]."
* or "Your image has been uploaded to %1 %2. %3 left. "
* "Please wait until all of them are uploaded. "
* "About %4 seconds left."
*/
MessageBuilder(ImageUploaderResultTag, const QString &imageLink,
const QString &deletionLink, size_t imagesStillQueued = 0,
size_t secondsLeft = 0);
virtual ~MessageBuilder() = default;
Message *operator->();