Also added live check on startup.

This commit is contained in:
Cranken 2017-09-05 23:54:45 +02:00
parent 5fe8ee6117
commit 19268d7ad7
4 changed files with 13 additions and 5 deletions

View file

@ -63,6 +63,12 @@ const QString &Channel::getPopoutPlayerLink() const
return _popoutPlayerLink;
}
void Channel::setRoomID(std::string id)
{
this->roomID = id;
this->roomIDchanged();
}
messages::LimitedQueueSnapshot<messages::SharedMessage> Channel::getMessageSnapshot()
{
return _messages.getSnapshot();

View file

@ -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<messages::SharedMessage> getMessageSnapshot();
// methods
@ -59,6 +55,9 @@ public:
QString streamGame;
QString streamUptime;
void setRoomID(std::string id);
boost::signals2::signal<void()> roomIDchanged;
private:
// variables
messages::LimitedQueue<messages::SharedMessage> _messages;

View file

@ -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);
}

View file

@ -91,6 +91,9 @@ std::shared_ptr<Channel> &ChatWidget::getChannelRef()
void ChatWidget::setChannel(std::shared_ptr<Channel> _newChannel)
{
this->channel = _newChannel;
this->channel->roomIDchanged.connect([this](){
this->header.checkLive();
});
// on new message
this->messageAppendedConnection =