made message grey out when user it timed out
This commit is contained in:
@@ -325,6 +325,7 @@ void IrcManager::handleClearChatMessage(Communi::IrcMessage *message)
|
||||
return;
|
||||
}
|
||||
|
||||
// check if the chat has been cleared by a moderator
|
||||
if (message->parameters().length() == 1) {
|
||||
std::shared_ptr<Message> msg(
|
||||
Message::createSystemMessage("Chat has been cleared by a moderator."));
|
||||
@@ -336,6 +337,7 @@ void IrcManager::handleClearChatMessage(Communi::IrcMessage *message)
|
||||
|
||||
assert(message->parameters().length() >= 2);
|
||||
|
||||
// get username, duration and message of the timed out user
|
||||
QString username = message->parameter(1);
|
||||
QString durationInSeconds, reason;
|
||||
QVariant v = message->tag("ban-duration");
|
||||
@@ -348,10 +350,21 @@ void IrcManager::handleClearChatMessage(Communi::IrcMessage *message)
|
||||
reason = v.toString();
|
||||
}
|
||||
|
||||
std::shared_ptr<Message> msg(
|
||||
Message::createTimeoutMessage(username, durationInSeconds, reason));
|
||||
// add the notice that the user has been timed out
|
||||
SharedMessage msg(Message::createTimeoutMessage(username, durationInSeconds, reason));
|
||||
|
||||
c->addMessage(msg);
|
||||
|
||||
// disable the messages from the user
|
||||
LimitedQueueSnapshot<SharedMessage> snapshot = c->getMessageSnapshot();
|
||||
for (int i = 0; i < snapshot.getLength(); i++) {
|
||||
if (snapshot[i]->getTimeoutUser() == username) {
|
||||
snapshot[i]->setDisabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
// refresh all
|
||||
WindowManager::getInstance().layoutVisibleChatWidgets(c.get());
|
||||
}
|
||||
|
||||
void IrcManager::handleUserStateMessage(Communi::IrcMessage *message)
|
||||
|
||||
@@ -100,6 +100,7 @@ void ThemeManager::actuallyUpdate(double hue, double multiplier)
|
||||
bool flat = lightTheme;
|
||||
|
||||
ChatBackground = getColor(0, sat, 1);
|
||||
DisabledMessageOverlay = getColor(0, sat, 1, 0.6);
|
||||
ChatBackgroundHighlighted = blendColors(TabSelectedBackground, ChatBackground, 0.8);
|
||||
ChatHeaderBackground = getColor(0, sat, flat ? 1 : 0.9);
|
||||
ChatHeaderBorder = getColor(0, sat, flat ? 1 : 0.85);
|
||||
|
||||
@@ -36,6 +36,7 @@ public:
|
||||
QColor ChatBackgroundHighlighted;
|
||||
QColor ChatBackgroundResub;
|
||||
QColor ChatBackgroundWhisper;
|
||||
QColor DisabledMessageOverlay;
|
||||
|
||||
QColor ChatHeaderBorder;
|
||||
QColor ChatHeaderBackground;
|
||||
|
||||
@@ -35,7 +35,7 @@ static const std::string &getSettingsPath()
|
||||
|
||||
void WindowManager::layoutVisibleChatWidgets(Channel *channel)
|
||||
{
|
||||
this->layout();
|
||||
this->layout(channel);
|
||||
}
|
||||
|
||||
void WindowManager::repaintVisibleChatWidgets(Channel *channel)
|
||||
|
||||
@@ -30,7 +30,7 @@ public:
|
||||
void save();
|
||||
|
||||
boost::signals2::signal<void()> repaintGifs;
|
||||
boost::signals2::signal<void()> layout;
|
||||
boost::signals2::signal<void(Channel *)> layout;
|
||||
|
||||
private:
|
||||
ThemeManager &themeManager;
|
||||
|
||||
Reference in New Issue
Block a user