mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
An error should now be printed if you connect with bad credentials.
This fix relies on #163 being closed, so for now #132 will be left open.
This commit is contained in:
parent
caddb2c778
commit
7d259fe7e6
1 changed files with 11 additions and 20 deletions
|
@ -449,7 +449,16 @@ void IrcManager::handleNoticeMessage(Communi::IrcNoticeMessage *message)
|
|||
{
|
||||
auto rawChannelName = message->target();
|
||||
|
||||
assert(rawChannelName.length() >= 2);
|
||||
bool broadcast = rawChannelName.length() < 2;
|
||||
std::shared_ptr<Message> msg(Message::createSystemMessage(message->content()));
|
||||
|
||||
if (broadcast) {
|
||||
this->channelManager.doOnAll([msg](const auto &c) {
|
||||
c->addMessage(msg); //
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
auto trimmedChannelName = rawChannelName.mid(1);
|
||||
|
||||
|
@ -461,27 +470,11 @@ void IrcManager::handleNoticeMessage(Communi::IrcNoticeMessage *message)
|
|||
return;
|
||||
}
|
||||
|
||||
std::shared_ptr<Message> msg(Message::createSystemMessage(message->content()));
|
||||
|
||||
c->addMessage(msg);
|
||||
}
|
||||
|
||||
void IrcManager::handleWriteConnectionNoticeMessage(Communi::IrcNoticeMessage *message)
|
||||
{
|
||||
auto rawChannelName = message->target();
|
||||
|
||||
assert(rawChannelName.length() >= 2);
|
||||
|
||||
auto trimmedChannelName = rawChannelName.mid(1);
|
||||
|
||||
auto c = this->channelManager.getTwitchChannel(trimmedChannelName);
|
||||
|
||||
if (!c) {
|
||||
debug::Log("[IrcManager:handleNoticeMessage] Channel {} not found in channel manager",
|
||||
trimmedChannelName);
|
||||
return;
|
||||
}
|
||||
|
||||
QVariant v = message->tag("msg-id");
|
||||
if (!v.isValid()) {
|
||||
return;
|
||||
|
@ -495,9 +488,7 @@ void IrcManager::handleWriteConnectionNoticeMessage(Communi::IrcNoticeMessage *m
|
|||
return;
|
||||
}
|
||||
|
||||
std::shared_ptr<Message> msg(Message::createSystemMessage(message->content()));
|
||||
|
||||
c->addMessage(msg);
|
||||
this->handleNoticeMessage(message);
|
||||
}
|
||||
|
||||
void IrcManager::onConnected()
|
||||
|
|
Loading…
Reference in a new issue