mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
Add moderation buttons in search popup (#2803)
This commit is contained in:
parent
f123a11c1c
commit
b42f70e6d8
2 changed files with 27 additions and 3 deletions
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
## Unversioned
|
## Unversioned
|
||||||
|
|
||||||
|
- Minor: Added moderation buttons to search popup when searching in a split with moderation mode enabled. (#2148, #2803)
|
||||||
- Minor: Made "#channel" in `/mentions` tab show in usercards and in the search popup. (#2802)
|
- Minor: Made "#channel" in `/mentions` tab show in usercards and in the search popup. (#2802)
|
||||||
- Minor: Added settings to disable custom FrankerFaceZ VIP/mod badges. (#2693, #2759)
|
- Minor: Added settings to disable custom FrankerFaceZ VIP/mod badges. (#2693, #2759)
|
||||||
- Bugfix: Fixed FFZ emote links for global emotes (#2807, #2808)
|
- Bugfix: Fixed FFZ emote links for global emotes (#2807, #2808)
|
||||||
|
|
|
@ -46,6 +46,7 @@
|
||||||
#include "widgets/dialogs/SettingsDialog.hpp"
|
#include "widgets/dialogs/SettingsDialog.hpp"
|
||||||
#include "widgets/dialogs/UserInfoPopup.hpp"
|
#include "widgets/dialogs/UserInfoPopup.hpp"
|
||||||
#include "widgets/helper/EffectLabel.hpp"
|
#include "widgets/helper/EffectLabel.hpp"
|
||||||
|
#include "widgets/helper/SearchPopup.hpp"
|
||||||
#include "widgets/splits/Split.hpp"
|
#include "widgets/splits/Split.hpp"
|
||||||
|
|
||||||
#define DRAW_WIDTH (this->width())
|
#define DRAW_WIDTH (this->width())
|
||||||
|
@ -999,6 +1000,16 @@ MessageElementFlags ChannelView::getFlags() const
|
||||||
|
|
||||||
Split *split = dynamic_cast<Split *>(this->parentWidget());
|
Split *split = dynamic_cast<Split *>(this->parentWidget());
|
||||||
|
|
||||||
|
if (split == nullptr)
|
||||||
|
{
|
||||||
|
SearchPopup *searchPopup =
|
||||||
|
dynamic_cast<SearchPopup *>(this->parentWidget());
|
||||||
|
if (searchPopup != nullptr)
|
||||||
|
{
|
||||||
|
split = dynamic_cast<Split *>(searchPopup->parentWidget());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (split != nullptr)
|
if (split != nullptr)
|
||||||
{
|
{
|
||||||
if (split->getModerationMode())
|
if (split->getModerationMode())
|
||||||
|
@ -2059,14 +2070,26 @@ void ChannelView::handleLinkClick(QMouseEvent *event, const Link &link,
|
||||||
case Link::UserAction: {
|
case Link::UserAction: {
|
||||||
QString value = link.value;
|
QString value = link.value;
|
||||||
|
|
||||||
|
ChannelPtr channel = this->underlyingChannel_;
|
||||||
|
SearchPopup *searchPopup =
|
||||||
|
dynamic_cast<SearchPopup *>(this->parentWidget());
|
||||||
|
if (searchPopup != nullptr)
|
||||||
|
{
|
||||||
|
Split *split =
|
||||||
|
dynamic_cast<Split *>(searchPopup->parentWidget());
|
||||||
|
if (split != nullptr)
|
||||||
|
{
|
||||||
|
channel = split->getChannel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
value.replace("{user}", layout->getMessage()->loginName)
|
value.replace("{user}", layout->getMessage()->loginName)
|
||||||
.replace("{channel}", this->channel_->getName())
|
.replace("{channel}", this->channel_->getName())
|
||||||
.replace("{msg-id}", layout->getMessage()->id)
|
.replace("{msg-id}", layout->getMessage()->id)
|
||||||
.replace("{message}", layout->getMessage()->messageText);
|
.replace("{message}", layout->getMessage()->messageText);
|
||||||
|
|
||||||
value = getApp()->commands->execCommand(
|
value = getApp()->commands->execCommand(value, channel, false);
|
||||||
value, this->underlyingChannel_, false);
|
channel->sendMessage(value);
|
||||||
this->underlyingChannel_->sendMessage(value);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue