Added trashcan, replaced messageID var with this-message().id, removed pubsub stuff that didn't belong
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 3.0 KiB |
@@ -24,6 +24,7 @@
|
|||||||
<file>buttons/modModeEnabled.png</file>
|
<file>buttons/modModeEnabled.png</file>
|
||||||
<file>buttons/modModeEnabled2.png</file>
|
<file>buttons/modModeEnabled2.png</file>
|
||||||
<file>buttons/timeout.png</file>
|
<file>buttons/timeout.png</file>
|
||||||
|
<file>buttons/trashCan.png</file>
|
||||||
<file>buttons/unban.png</file>
|
<file>buttons/unban.png</file>
|
||||||
<file>buttons/unmod.png</file>
|
<file>buttons/unmod.png</file>
|
||||||
<file>buttons/update.png</file>
|
<file>buttons/update.png</file>
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ Resources2::Resources2()
|
|||||||
this->buttons.modModeEnabled = QPixmap(":/buttons/modModeEnabled.png");
|
this->buttons.modModeEnabled = QPixmap(":/buttons/modModeEnabled.png");
|
||||||
this->buttons.modModeEnabled2 = QPixmap(":/buttons/modModeEnabled2.png");
|
this->buttons.modModeEnabled2 = QPixmap(":/buttons/modModeEnabled2.png");
|
||||||
this->buttons.timeout = QPixmap(":/buttons/timeout.png");
|
this->buttons.timeout = QPixmap(":/buttons/timeout.png");
|
||||||
|
this->buttons.trashCan = QPixmap(":/buttons/trashCan.png");
|
||||||
this->buttons.unban = QPixmap(":/buttons/unban.png");
|
this->buttons.unban = QPixmap(":/buttons/unban.png");
|
||||||
this->buttons.unmod = QPixmap(":/buttons/unmod.png");
|
this->buttons.unmod = QPixmap(":/buttons/unmod.png");
|
||||||
this->buttons.update = QPixmap(":/buttons/update.png");
|
this->buttons.update = QPixmap(":/buttons/update.png");
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ public:
|
|||||||
QPixmap modModeEnabled;
|
QPixmap modModeEnabled;
|
||||||
QPixmap modModeEnabled2;
|
QPixmap modModeEnabled2;
|
||||||
QPixmap timeout;
|
QPixmap timeout;
|
||||||
|
QPixmap trashCan;
|
||||||
QPixmap unban;
|
QPixmap unban;
|
||||||
QPixmap unmod;
|
QPixmap unmod;
|
||||||
QPixmap update;
|
QPixmap update;
|
||||||
|
|||||||
@@ -217,18 +217,12 @@ void Channel::deleteMessage(QString messageID)
|
|||||||
LimitedQueueSnapshot<MessagePtr> snapshot = this->getMessageSnapshot();
|
LimitedQueueSnapshot<MessagePtr> snapshot = this->getMessageSnapshot();
|
||||||
int snapshotLength = snapshot.size();
|
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)
|
for (int i = snapshotLength - 1; i >= end; --i)
|
||||||
{
|
{
|
||||||
auto &s = snapshot[i];
|
auto &s = snapshot[i];
|
||||||
|
|
||||||
if (s->parseTime < minimumTime)
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (s->id == messageID)
|
if (s->id == messageID)
|
||||||
{
|
{
|
||||||
s->flags.set(MessageFlag::Disabled);
|
s->flags.set(MessageFlag::Disabled);
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ ModerationAction::ModerationAction(const QString &action)
|
|||||||
}
|
}
|
||||||
else if (action.startsWith("/delete"))
|
else if (action.startsWith("/delete"))
|
||||||
{
|
{
|
||||||
this->image_ = Image::fromPixmap(getApp()->resources->pajaDank);
|
this->image_ = Image::fromPixmap(getApp()->resources->buttons.trashCan);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -710,9 +710,6 @@ PubSub::PubSub()
|
|||||||
// qDebug() << QString::fromStdString(rj::stringify(data));
|
// 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.set_access_channels(websocketpp::log::alevel::all);
|
||||||
this->websocketClient.clear_access_channels(
|
this->websocketClient.clear_access_channels(
|
||||||
websocketpp::log::alevel::frame_payload);
|
websocketpp::log::alevel::frame_payload);
|
||||||
|
|||||||
@@ -580,9 +580,8 @@ void TwitchMessageBuilder::parseMessageID()
|
|||||||
|
|
||||||
if (iterator != this->tags.end())
|
if (iterator != this->tags.end())
|
||||||
{
|
{
|
||||||
this->messageID = iterator.value().toString();
|
this->message().id = iterator.value().toString();
|
||||||
}
|
}
|
||||||
this->message().id = this->messageID;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TwitchMessageBuilder::parseRoomID()
|
void TwitchMessageBuilder::parseRoomID()
|
||||||
@@ -608,7 +607,7 @@ void TwitchMessageBuilder::parseRoomID()
|
|||||||
void TwitchMessageBuilder::appendChannelName()
|
void TwitchMessageBuilder::appendChannelName()
|
||||||
{
|
{
|
||||||
QString channelName("#" + this->channel->getName());
|
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<TextElement>(channelName, MessageElementFlag::ChannelName,
|
this->emplace<TextElement>(channelName, MessageElementFlag::ChannelName,
|
||||||
MessageColor::System) //
|
MessageColor::System) //
|
||||||
|
|||||||
@@ -41,7 +41,6 @@ public:
|
|||||||
MessageParseArgs args;
|
MessageParseArgs args;
|
||||||
const QVariantMap tags;
|
const QVariantMap tags;
|
||||||
|
|
||||||
QString messageID;
|
|
||||||
QString userName;
|
QString userName;
|
||||||
|
|
||||||
bool isIgnored() const;
|
bool isIgnored() const;
|
||||||
@@ -55,8 +54,10 @@ private:
|
|||||||
void appendUsername();
|
void appendUsername();
|
||||||
void parseHighlights(bool isPastMsg);
|
void parseHighlights(bool isPastMsg);
|
||||||
|
|
||||||
void appendTwitchEmote(const QString &emote,
|
void appendTwitchEmote(
|
||||||
std::vector<std::tuple<int, EmotePtr, EmoteName>> &vec, std::vector<int> &correctPositions);
|
const QString &emote,
|
||||||
|
std::vector<std::tuple<int, EmotePtr, EmoteName>> &vec,
|
||||||
|
std::vector<int> &correctPositions);
|
||||||
Outcome tryAppendEmote(const EmoteName &name);
|
Outcome tryAppendEmote(const EmoteName &name);
|
||||||
|
|
||||||
void addWords(
|
void addWords(
|
||||||
|
|||||||
@@ -161,7 +161,8 @@ ModerationPage::ModerationPage()
|
|||||||
// clang-format off
|
// clang-format off
|
||||||
auto label = modMode.emplace<QLabel>(
|
auto label = modMode.emplace<QLabel>(
|
||||||
"Moderation mode is enabled by clicking <img width='18' height='18' src=':/buttons/modModeDisabled.png'> in a channel that you moderate.<br><br>"
|
"Moderation mode is enabled by clicking <img width='18' height='18' src=':/buttons/modModeDisabled.png'> in a channel that you moderate.<br><br>"
|
||||||
"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.<br>");
|
"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.<br>"
|
||||||
|
"For deleting messages use /delete {msg-id}.");
|
||||||
label->setWordWrap(true);
|
label->setWordWrap(true);
|
||||||
label->setStyleSheet("color: #bbb");
|
label->setStyleSheet("color: #bbb");
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|||||||
Reference in New Issue
Block a user