diff --git a/resources/buttons/trashCan.png b/resources/buttons/trashCan.png
new file mode 100644
index 00000000..b5e11bf4
Binary files /dev/null and b/resources/buttons/trashCan.png differ
diff --git a/resources/resources_autogenerated.qrc b/resources/resources_autogenerated.qrc
index fcf0b5da..4c15a6a8 100644
--- a/resources/resources_autogenerated.qrc
+++ b/resources/resources_autogenerated.qrc
@@ -24,6 +24,7 @@
buttons/modModeEnabled.png
buttons/modModeEnabled2.png
buttons/timeout.png
+ buttons/trashCan.png
buttons/unban.png
buttons/unmod.png
buttons/update.png
diff --git a/src/autogenerated/ResourcesAutogen.cpp b/src/autogenerated/ResourcesAutogen.cpp
index 34cf039e..59f5fce7 100644
--- a/src/autogenerated/ResourcesAutogen.cpp
+++ b/src/autogenerated/ResourcesAutogen.cpp
@@ -18,6 +18,7 @@ Resources2::Resources2()
this->buttons.modModeEnabled = QPixmap(":/buttons/modModeEnabled.png");
this->buttons.modModeEnabled2 = QPixmap(":/buttons/modModeEnabled2.png");
this->buttons.timeout = QPixmap(":/buttons/timeout.png");
+ this->buttons.trashCan = QPixmap(":/buttons/trashCan.png");
this->buttons.unban = QPixmap(":/buttons/unban.png");
this->buttons.unmod = QPixmap(":/buttons/unmod.png");
this->buttons.update = QPixmap(":/buttons/update.png");
diff --git a/src/autogenerated/ResourcesAutogen.hpp b/src/autogenerated/ResourcesAutogen.hpp
index fbbb2fbf..1c8a0bce 100644
--- a/src/autogenerated/ResourcesAutogen.hpp
+++ b/src/autogenerated/ResourcesAutogen.hpp
@@ -24,6 +24,7 @@ public:
QPixmap modModeEnabled;
QPixmap modModeEnabled2;
QPixmap timeout;
+ QPixmap trashCan;
QPixmap unban;
QPixmap unmod;
QPixmap update;
diff --git a/src/common/Channel.cpp b/src/common/Channel.cpp
index 82432db4..caa43275 100644
--- a/src/common/Channel.cpp
+++ b/src/common/Channel.cpp
@@ -217,18 +217,12 @@ void Channel::deleteMessage(QString messageID)
LimitedQueueSnapshot snapshot = this->getMessageSnapshot();
int snapshotLength = snapshot.size();
- int end = std::max(0, snapshotLength - 20);
+ int end = std::max(0, snapshotLength - 200);
- QTime minimumTime = QTime::currentTime().addSecs(-5);
for (int i = snapshotLength - 1; i >= end; --i)
{
auto &s = snapshot[i];
- if (s->parseTime < minimumTime)
- {
- break;
- }
-
if (s->id == messageID)
{
s->flags.set(MessageFlag::Disabled);
diff --git a/src/controllers/moderationactions/ModerationAction.cpp b/src/controllers/moderationactions/ModerationAction.cpp
index 8683f2c4..199ea552 100644
--- a/src/controllers/moderationactions/ModerationAction.cpp
+++ b/src/controllers/moderationactions/ModerationAction.cpp
@@ -75,7 +75,7 @@ ModerationAction::ModerationAction(const QString &action)
}
else if (action.startsWith("/delete"))
{
- this->image_ = Image::fromPixmap(getApp()->resources->pajaDank);
+ this->image_ = Image::fromPixmap(getApp()->resources->buttons.trashCan);
}
else
{
diff --git a/src/providers/twitch/PubsubClient.cpp b/src/providers/twitch/PubsubClient.cpp
index 5108c5ad..0a897661 100644
--- a/src/providers/twitch/PubsubClient.cpp
+++ b/src/providers/twitch/PubsubClient.cpp
@@ -710,9 +710,6 @@ PubSub::PubSub()
// qDebug() << QString::fromStdString(rj::stringify(data));
};
- this->moderationActionHandlers["delete"] =
- [this](const auto &data, const auto &roomID) { qDebug() << "xd"; };
-
this->websocketClient.set_access_channels(websocketpp::log::alevel::all);
this->websocketClient.clear_access_channels(
websocketpp::log::alevel::frame_payload);
diff --git a/src/providers/twitch/TwitchMessageBuilder.cpp b/src/providers/twitch/TwitchMessageBuilder.cpp
index 6073e644..b935a283 100644
--- a/src/providers/twitch/TwitchMessageBuilder.cpp
+++ b/src/providers/twitch/TwitchMessageBuilder.cpp
@@ -580,9 +580,8 @@ void TwitchMessageBuilder::parseMessageID()
if (iterator != this->tags.end())
{
- this->messageID = iterator.value().toString();
+ this->message().id = iterator.value().toString();
}
- this->message().id = this->messageID;
}
void TwitchMessageBuilder::parseRoomID()
@@ -608,7 +607,7 @@ void TwitchMessageBuilder::parseRoomID()
void TwitchMessageBuilder::appendChannelName()
{
QString channelName("#" + this->channel->getName());
- Link link(Link::Url, this->channel->getName() + "\n" + this->messageID);
+ Link link(Link::Url, this->channel->getName() + "\n" + this->message().id);
this->emplace(channelName, MessageElementFlag::ChannelName,
MessageColor::System) //
diff --git a/src/providers/twitch/TwitchMessageBuilder.hpp b/src/providers/twitch/TwitchMessageBuilder.hpp
index 5aa72b20..da7b3865 100644
--- a/src/providers/twitch/TwitchMessageBuilder.hpp
+++ b/src/providers/twitch/TwitchMessageBuilder.hpp
@@ -41,7 +41,6 @@ public:
MessageParseArgs args;
const QVariantMap tags;
- QString messageID;
QString userName;
bool isIgnored() const;
@@ -55,8 +54,10 @@ private:
void appendUsername();
void parseHighlights(bool isPastMsg);
- void appendTwitchEmote(const QString &emote,
- std::vector> &vec, std::vector &correctPositions);
+ void appendTwitchEmote(
+ const QString &emote,
+ std::vector> &vec,
+ std::vector &correctPositions);
Outcome tryAppendEmote(const EmoteName &name);
void addWords(
diff --git a/src/widgets/settingspages/ModerationPage.cpp b/src/widgets/settingspages/ModerationPage.cpp
index 3349d2e9..b44e7327 100644
--- a/src/widgets/settingspages/ModerationPage.cpp
+++ b/src/widgets/settingspages/ModerationPage.cpp
@@ -161,7 +161,8 @@ ModerationPage::ModerationPage()
// clang-format off
auto label = modMode.emplace(
"Moderation mode is enabled by clicking
in a channel that you moderate.
"
- "Moderation buttons can be bound to chat commands such as \"/ban {user}\", \"/timeout {user} 1000\", \"/w someusername !report {user} was bad in channel {channel}\" or any other custom text commands.
");
+ "Moderation buttons can be bound to chat commands such as \"/ban {user}\", \"/timeout {user} 1000\", \"/w someusername !report {user} was bad in channel {channel}\" or any other custom text commands.
"
+ "For deleting messages use /delete {msg-id}.");
label->setWordWrap(true);
label->setStyleSheet("color: #bbb");
// clang-format on