Fix User Card moderation actions not using Helix (#4378)

This commit is contained in:
pajlada
2023-02-14 21:59:23 +01:00
committed by GitHub
parent a3189baf94
commit f317d4c99b
2 changed files with 23 additions and 7 deletions
+22 -7
View File
@@ -5,6 +5,7 @@
#include "common/NetworkRequest.hpp"
#include "common/QLogging.hpp"
#include "controllers/accounts/AccountController.hpp"
#include "controllers/commands/CommandController.hpp"
#include "controllers/highlights/HighlightBlacklistUser.hpp"
#include "controllers/hotkeys/HotkeyController.hpp"
#include "messages/Message.hpp"
@@ -223,6 +224,10 @@ UserInfoPopup::UserInfoPopup(bool closeAutomatically, QWidget *parent,
.arg(this->userName_)
.arg(calculateTimeoutDuration(button));
}
msg = getApp()->commands->execCommand(
msg, this->underlyingChannel_, false);
this->underlyingChannel_->sendMessage(msg);
return "";
}},
@@ -478,25 +483,35 @@ UserInfoPopup::UserInfoPopup(bool closeAutomatically, QWidget *parent,
case TimeoutWidget::Ban: {
if (this->underlyingChannel_)
{
this->underlyingChannel_->sendMessage("/ban " +
this->userName_);
QString value = "/ban " + this->userName_;
value = getApp()->commands->execCommand(
value, this->underlyingChannel_, false);
this->underlyingChannel_->sendMessage(value);
}
}
break;
case TimeoutWidget::Unban: {
if (this->underlyingChannel_)
{
this->underlyingChannel_->sendMessage("/unban " +
this->userName_);
QString value = "/unban " + this->userName_;
value = getApp()->commands->execCommand(
value, this->underlyingChannel_, false);
this->underlyingChannel_->sendMessage(value);
}
}
break;
case TimeoutWidget::Timeout: {
if (this->underlyingChannel_)
{
this->underlyingChannel_->sendMessage(
"/timeout " + this->userName_ + " " +
QString::number(arg));
QString value = "/timeout " + this->userName_ + " " +
QString::number(arg);
value = getApp()->commands->execCommand(
value, this->underlyingChannel_, false);
this->underlyingChannel_->sendMessage(value);
}
}
break;