Skip to content

Commit

Permalink
Remove experimental IRC support (#5547)
Browse files Browse the repository at this point in the history
  • Loading branch information
pajlada authored Aug 18, 2024
1 parent cc8bd53 commit 998920d
Show file tree
Hide file tree
Showing 44 changed files with 478 additions and 2,841 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
- Minor: Replying to a message will now display the message being replied to. (#4350, #5519)
- Minor: Links can now have prefixes and suffixes such as parentheses. (#5486, #5515)
- Minor: Added support for scrolling in splits with touchscreen panning gestures. (#5524)
- Minor: Removed experimental IRC support. (#5547)
- Bugfix: Fixed tab move animation occasionally failing to start after closing a tab. (#5426)
- Bugfix: If a network request errors with 200 OK, Qt's error code is now reported instead of the HTTP status. (#5378)
- Bugfix: Fixed restricted users usernames not being clickable. (#5405)
Expand Down
2 changes: 1 addition & 1 deletion mocks/include/mocks/EmptyApplication.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ class EmptyApplication : public IApplication
return nullptr;
}

IAbstractIrcServer *getTwitchAbstract() override
ITwitchIrcServer *getTwitchAbstract() override
{
assert(false && "EmptyApplication::getTwitchAbstract was called "
"without being initialized");
Expand Down
32 changes: 32 additions & 0 deletions mocks/include/mocks/TwitchIrcServer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,38 @@ class MockTwitchIrcServer : public ITwitchIrcServer
{
}

void connect() override
{
}

void sendRawMessage(const QString &rawMessage) override
{
}

ChannelPtr getOrAddChannel(const QString &dirtyChannelName) override
{
assert(false && "unimplemented getOrAddChannel in mock irc server");
return {};
}

ChannelPtr getChannelOrEmpty(const QString &dirtyChannelName) override
{
assert(false && "unimplemented getChannelOrEmpty in mock irc server");
return {};
}

void addFakeMessage(const QString &data) override
{
}

void addGlobalSystemMessage(const QString &messageText) override
{
}

void forEachChannel(std::function<void(ChannelPtr)> func) override
{
}

void forEachChannelAndSpecialChannels(
std::function<void(ChannelPtr)> func) override
{
Expand Down
9 changes: 1 addition & 8 deletions src/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include "controllers/sound/ISoundController.hpp"
#include "providers/bttv/BttvEmotes.hpp"
#include "providers/ffz/FfzEmotes.hpp"
#include "providers/irc/AbstractIrcServer.hpp"
#include "providers/links/LinkResolver.hpp"
#include "providers/seventv/SeventvAPI.hpp"
#include "providers/seventv/SeventvEmotes.hpp"
Expand All @@ -33,7 +32,6 @@
#include "providers/bttv/BttvLiveUpdates.hpp"
#include "providers/chatterino/ChatterinoBadges.hpp"
#include "providers/ffz/FfzBadges.hpp"
#include "providers/irc/Irc2.hpp"
#include "providers/seventv/eventapi/Dispatch.hpp"
#include "providers/seventv/eventapi/Subscription.hpp"
#include "providers/seventv/SeventvBadges.hpp"
Expand Down Expand Up @@ -224,11 +222,6 @@ void Application::initialize(Settings &settings, const Paths &paths)
if (!this->args_.isFramelessEmbed)
{
getSettings()->currentVersion.setValue(CHATTERINO_VERSION);

if (getSettings()->enableExperimentalIrc)
{
Irc::instance().load();
}
}

this->accounts->load();
Expand Down Expand Up @@ -546,7 +539,7 @@ ITwitchIrcServer *Application::getTwitch()
return this->twitch.get();
}

IAbstractIrcServer *Application::getTwitchAbstract()
ITwitchIrcServer *Application::getTwitchAbstract()
{
assertInGuiThread();

Expand Down
6 changes: 3 additions & 3 deletions src/Application.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ class SeventvEmotes;
class SeventvEventAPI;
class ILinkResolver;
class IStreamerMode;
class IAbstractIrcServer;

class IApplication
{
Expand Down Expand Up @@ -84,7 +83,7 @@ class IApplication
virtual HighlightController *getHighlights() = 0;
virtual NotificationController *getNotifications() = 0;
virtual ITwitchIrcServer *getTwitch() = 0;
virtual IAbstractIrcServer *getTwitchAbstract() = 0;
virtual ITwitchIrcServer *getTwitchAbstract() = 0;
virtual PubSub *getTwitchPubSub() = 0;
virtual ILogging *getChatLogger() = 0;
virtual IChatterinoBadges *getChatterinoBadges() = 0;
Expand Down Expand Up @@ -195,7 +194,8 @@ class Application : public IApplication
NotificationController *getNotifications() override;
HighlightController *getHighlights() override;
ITwitchIrcServer *getTwitch() override;
IAbstractIrcServer *getTwitchAbstract() override;
[[deprecated("use getTwitch()")]] ITwitchIrcServer *getTwitchAbstract()
override;
PubSub *getTwitchPubSub() override;
ILogging *getChatLogger() override;
FfzBadges *getFfzBadges() override;
Expand Down
17 changes: 0 additions & 17 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -339,22 +339,8 @@ set(SOURCE_FILES
providers/ffz/FfzUtil.cpp
providers/ffz/FfzUtil.hpp

providers/irc/AbstractIrcServer.cpp
providers/irc/AbstractIrcServer.hpp
providers/irc/Irc2.cpp
providers/irc/Irc2.hpp
providers/irc/IrcAccount.cpp
providers/irc/IrcAccount.hpp
providers/irc/IrcChannel2.cpp
providers/irc/IrcChannel2.hpp
providers/irc/IrcCommands.cpp
providers/irc/IrcCommands.hpp
providers/irc/IrcConnection2.cpp
providers/irc/IrcConnection2.hpp
providers/irc/IrcMessageBuilder.cpp
providers/irc/IrcMessageBuilder.hpp
providers/irc/IrcServer.cpp
providers/irc/IrcServer.hpp

providers/links/LinkInfo.cpp
providers/links/LinkInfo.hpp
Expand Down Expand Up @@ -576,9 +562,6 @@ set(SOURCE_FILES
widgets/dialogs/EditHotkeyDialog.hpp
widgets/dialogs/EmotePopup.cpp
widgets/dialogs/EmotePopup.hpp
widgets/dialogs/IrcConnectionEditor.cpp
widgets/dialogs/IrcConnectionEditor.hpp
widgets/dialogs/IrcConnectionEditor.ui
widgets/dialogs/LastRunCrashDialog.cpp
widgets/dialogs/LastRunCrashDialog.hpp
widgets/dialogs/LoginDialog.cpp
Expand Down
4 changes: 0 additions & 4 deletions src/common/Channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
#include "Application.hpp"
#include "messages/Message.hpp"
#include "messages/MessageBuilder.hpp"
#include "providers/irc/IrcChannel2.hpp"
#include "providers/irc/IrcServer.hpp"
#include "providers/twitch/IrcMessageHandler.hpp"
#include "singletons/Emotes.hpp"
#include "singletons/Logging.hpp"
Expand Down Expand Up @@ -36,8 +34,6 @@ Channel::Channel(const QString &name, Type type)
{
this->platform_ = "twitch";
}

// Irc platform is set through IrcChannel2 ctor
}

Channel::~Channel()
Expand Down
3 changes: 0 additions & 3 deletions src/common/Channel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ class Channel : public std::enable_shared_from_this<Channel>
TwitchLive,
TwitchAutomod,
TwitchEnd,
Irc,
Misc,
};

Expand Down Expand Up @@ -183,8 +182,6 @@ constexpr magic_enum::customize::customize_t
return "live";
case Type::TwitchAutomod:
return "automod";
case Type::Irc:
return "irc";
case Type::Misc:
return "misc";
default:
Expand Down
62 changes: 0 additions & 62 deletions src/common/IrcColors.hpp

This file was deleted.

13 changes: 0 additions & 13 deletions src/controllers/commands/builtin/twitch/SendWhisper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
#include "messages/MessageElement.hpp"
#include "providers/bttv/BttvEmotes.hpp"
#include "providers/ffz/FfzEmotes.hpp"
#include "providers/irc/IrcChannel2.hpp"
#include "providers/irc/IrcServer.hpp"
#include "providers/twitch/api/Helix.hpp"
#include "providers/twitch/TwitchAccount.hpp"
#include "providers/twitch/TwitchIrcServer.hpp"
Expand Down Expand Up @@ -242,17 +240,6 @@ QString sendWhisper(const CommandContext &ctx)
return "";
}

// we must be on IRC
auto *ircChannel = dynamic_cast<IrcChannel *>(ctx.channel.get());
if (ircChannel == nullptr)
{
// give up
return "";
}

auto *server = ircChannel->server();
server->sendWhisper(target, message);

return "";
}

Expand Down
Loading

0 comments on commit 998920d

Please sign in to comment.