fix(plugins): Implement __eq for Channel (#6456)
This commit is contained in:
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user