diff --git a/src/channel.cpp b/src/channel.cpp index 76de2d168..af979c6a4 100644 --- a/src/channel.cpp +++ b/src/channel.cpp @@ -63,6 +63,12 @@ const QString &Channel::getPopoutPlayerLink() const return _popoutPlayerLink; } +void Channel::setRoomID(std::string id) +{ + this->roomID = id; + this->roomIDchanged(); +} + messages::LimitedQueueSnapshot Channel::getMessageSnapshot() { return _messages.getSnapshot(); diff --git a/src/channel.hpp b/src/channel.hpp index 2284ee1a8..5d4c8cbce 100644 --- a/src/channel.hpp +++ b/src/channel.hpp @@ -39,10 +39,6 @@ public: const QString &getSubLink() const; const QString &getChannelLink() const; const QString &getPopoutPlayerLink() const; - bool getIsLive() const; - int getStreamViewerCount() const; - const QString &getStreamStatus() const; - const QString &getStreamGame() const; messages::LimitedQueueSnapshot getMessageSnapshot(); // methods @@ -59,6 +55,9 @@ public: QString streamGame; QString streamUptime; + void setRoomID(std::string id); + boost::signals2::signal roomIDchanged; + private: // variables messages::LimitedQueue _messages; diff --git a/src/ircmanager.cpp b/src/ircmanager.cpp index eff587d49..ca2d1a972 100644 --- a/src/ircmanager.cpp +++ b/src/ircmanager.cpp @@ -283,7 +283,7 @@ void IrcManager::handleRoomStateMessage(Communi::IrcMessage *message) std::string roomID = iterator.value().toString().toStdString(); auto channel = QString(message->toData()).split("#").at(1); - channelManager.getChannel(channel)->roomID = roomID; + channelManager.getChannel(channel)->setRoomID(roomID); this->resources.loadChannelData(roomID); } diff --git a/src/widgets/chatwidget.cpp b/src/widgets/chatwidget.cpp index 44970153e..22af801f7 100644 --- a/src/widgets/chatwidget.cpp +++ b/src/widgets/chatwidget.cpp @@ -91,6 +91,9 @@ std::shared_ptr &ChatWidget::getChannelRef() void ChatWidget::setChannel(std::shared_ptr _newChannel) { this->channel = _newChannel; + this->channel->roomIDchanged.connect([this](){ + this->header.checkLive(); + }); // on new message this->messageAppendedConnection =