Special message when login expired.

This commit is contained in:
fourtf 2019-08-21 02:00:42 +02:00
parent 6d9545157e
commit 3b3791e43a
2 changed files with 15 additions and 4 deletions

View file

@ -197,6 +197,8 @@ TextElement::TextElement(const QString &text, MessageElementFlags flags,
, color_(color) , color_(color)
, style_(style) , style_(style)
{ {
assert(text != "authentication");
for (const auto &word : text.split(' ')) for (const auto &word : text.split(' '))
{ {
this->words_.push_back({word, -1}); this->words_.push_back({word, -1});

View file

@ -516,12 +516,21 @@ void IrcMessageHandler::handleModeMessage(Communi::IrcMessage *message)
std::vector<MessagePtr> IrcMessageHandler::parseNoticeMessage( std::vector<MessagePtr> IrcMessageHandler::parseNoticeMessage(
Communi::IrcNoticeMessage *message) Communi::IrcNoticeMessage *message)
{ {
if (message->content().startsWith("Login auth", Qt::CaseInsensitive))
{
return {MessageBuilder(systemMessage,
"Login expired! Try logging in again.")
.release()};
}
else
{
std::vector<MessagePtr> builtMessages; std::vector<MessagePtr> builtMessages;
builtMessages.emplace_back(makeSystemMessage(message->content())); builtMessages.emplace_back(makeSystemMessage(message->content()));
return builtMessages; return builtMessages;
} }
} // namespace chatterino
void IrcMessageHandler::handleNoticeMessage(Communi::IrcNoticeMessage *message) void IrcMessageHandler::handleNoticeMessage(Communi::IrcNoticeMessage *message)
{ {