fix(plugins): Implement __eq for Channel (#6456)

This commit is contained in:
nerix
2025-09-14 13:28:39 +02:00
committed by GitHub
parent 60c3e1432a
commit c7dea40b6b
5 changed files with 37 additions and 0 deletions
@@ -7,6 +7,7 @@
# include "controllers/plugins/SolTypes.hpp"
# include "providers/twitch/TwitchChannel.hpp"
# include "providers/twitch/TwitchIrcServer.hpp"
# include "util/WeakPtrHelpers.hpp"
# include <sol/sol.hpp>
@@ -159,6 +160,11 @@ QString ChannelRef::to_string()
return QStringView(u"<c2.Channel %1>").arg(chan->getName());
}
bool ChannelRef::operator==(const ChannelRef &other) const noexcept
{
return weakOwnerEquals(this->weak, other.weak);
}
std::optional<ChannelRef> ChannelRef::get_by_name(const QString &name)
{
auto chan = getApp()->getTwitch()->getChannelOrEmpty(name);
@@ -155,6 +155,8 @@ public:
*/
QString to_string();
bool operator==(const ChannelRef &other) const noexcept;
/**
* Static functions
*/