saving irc splits now
This commit is contained in:
@@ -4,6 +4,9 @@
|
||||
#include "debug/AssertInGuiThread.hpp"
|
||||
#include "debug/Log.hpp"
|
||||
#include "messages/MessageElement.hpp"
|
||||
#include "providers/irc/Irc2.hpp"
|
||||
#include "providers/irc/IrcChannel2.hpp"
|
||||
#include "providers/irc/IrcServer.hpp"
|
||||
#include "providers/twitch/TwitchServer.hpp"
|
||||
#include "singletons/Fonts.hpp"
|
||||
#include "singletons/Paths.hpp"
|
||||
@@ -612,6 +615,17 @@ void WindowManager::encodeChannel(IndirectChannel channel, QJsonObject &obj)
|
||||
obj.insert("type", "whispers");
|
||||
}
|
||||
break;
|
||||
case Channel::Type::Irc:
|
||||
{
|
||||
if (auto ircChannel =
|
||||
dynamic_cast<IrcChannel *>(channel.get().get()))
|
||||
{
|
||||
obj.insert("type", "irc");
|
||||
obj.insert("server", ircChannel->server()->id());
|
||||
obj.insert("channel", ircChannel->getName());
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -639,6 +653,11 @@ IndirectChannel WindowManager::decodeChannel(const QJsonObject &obj)
|
||||
{
|
||||
return app->twitch.server->whispersChannel;
|
||||
}
|
||||
else if (type == "irc")
|
||||
{
|
||||
return Irc::getInstance().getOrAddChannel(
|
||||
obj.value("server").toInt(-1), obj.value("channel").toString());
|
||||
}
|
||||
|
||||
return Channel::getEmpty();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user