disabled irc and fixed notice messages in write conn not showing

This commit is contained in:
fourtf 2019-09-22 16:16:08 +02:00
parent f27c8eb1b4
commit fc049d8f45
4 changed files with 41 additions and 7 deletions

View file

@ -66,6 +66,7 @@ void IrcServer::initializeConnection(IrcConnection *connection,
connection->setRealName(this->data_->real.isEmpty() ? this->data_->user connection->setRealName(this->data_->real.isEmpty() ? this->data_->user
: this->data_->nick); : this->data_->nick);
#if 0
switch (this->data_->authType) switch (this->data_->authType)
{ {
case IrcAuthType::Sasl: case IrcAuthType::Sasl:
@ -87,6 +88,7 @@ void IrcServer::initializeConnection(IrcConnection *connection,
default: default:
this->open(Both); this->open(Both);
} }
#endif
QObject::connect( QObject::connect(
connection, &Communi::IrcConnection::socketError, this, connection, &Communi::IrcConnection::socketError, this,

View file

@ -1,5 +1,8 @@
#include "TwitchIrcServer.hpp" #include "TwitchIrcServer.hpp"
#include <IrcCommand>
#include <cassert>
#include "Application.hpp" #include "Application.hpp"
#include "common/Common.hpp" #include "common/Common.hpp"
#include "controllers/accounts/AccountController.hpp" #include "controllers/accounts/AccountController.hpp"
@ -15,9 +18,6 @@
#include "providers/twitch/TwitchMessageBuilder.hpp" #include "providers/twitch/TwitchMessageBuilder.hpp"
#include "util/PostToThread.hpp" #include "util/PostToThread.hpp"
#include <IrcCommand>
#include <cassert>
// using namespace Communi; // using namespace Communi;
using namespace std::chrono_literals; using namespace std::chrono_literals;
@ -195,13 +195,40 @@ void TwitchIrcServer::writeConnectionMessageReceived(
const QString &command = message->command(); const QString &command = message->command();
auto &handler = IrcMessageHandler::getInstance(); auto &handler = IrcMessageHandler::getInstance();
// Below commands enabled through the twitch.tv/commands CAP REQ // Below commands enabled through the twitch.tv/commands CAP REQ
if (command == "USERSTATE") if (command == "USERSTATE")
{ {
// Received USERSTATE upon PRIVMSGing // Received USERSTATE upon PRIVMSGing
handler.handleUserStateMessage(message); handler.handleUserStateMessage(message);
} }
else if (command == "NOTICE")
{
static std::unordered_set<std::string> readConnectionOnlyIDs{
"host_on",
"host_off",
"host_target_went_offline",
"emote_only_on",
"emote_only_off",
"slow_on",
"slow_off",
"subs_on",
"subs_off",
"r9k_on",
"r9k_off",
// Display for user who times someone out. This implies you're a
// moderator, at which point you will be connected to PubSub and receive
// a better message from there.
"timeout_success",
"ban_success",
// Channel suspended notices
"msg_channel_suspended",
};
handler.handleNoticeMessage(
static_cast<Communi::IrcNoticeMessage *>(message));
}
} }
void TwitchIrcServer::onReadConnected(IrcConnection *connection) void TwitchIrcServer::onReadConnected(IrcConnection *connection)

View file

@ -31,12 +31,11 @@
#include <QApplication> #include <QApplication>
#include <QDesktopServices> #include <QDesktopServices>
#include <QHeaderView> #include <QHeaderView>
#include <QMenuBar>
#include <QPalette> #include <QPalette>
#include <QShortcut> #include <QShortcut>
#include <QVBoxLayout>
#include <QMenuBar>
#include <QStandardItemModel> #include <QStandardItemModel>
#include <QVBoxLayout>
namespace chatterino { namespace chatterino {

View file

@ -190,6 +190,8 @@ SelectChannelDialog::SelectChannelDialog(QWidget *parent)
auto tab = notebook->addPage(obj.getElement()); auto tab = notebook->addPage(obj.getElement());
tab->setCustomTitle("Irc (Beta)"); tab->setCustomTitle("Irc (Beta)");
tab->setEnable(false);
tab->setVisible(false);
} }
layout->setStretchFactor(notebook.getElement(), 1); layout->setStretchFactor(notebook.getElement(), 1);
@ -217,7 +219,11 @@ SelectChannelDialog::SelectChannelDialog(QWidget *parent)
[=] { this->close(); }); [=] { this->close(); });
// restore ui state // restore ui state
// fourtf: enable when releasing irc
#if 0
this->ui_.notebook->selectIndex(getSettings()->lastSelectChannelTab); this->ui_.notebook->selectIndex(getSettings()->lastSelectChannelTab);
#endif
this->ui_.irc.servers->getTableView()->selectRow( this->ui_.irc.servers->getTableView()->selectRow(
getSettings()->lastSelectIrcConn); getSettings()->lastSelectIrcConn);
} }