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; return _popoutPlayerLink;
} }
void Channel::setRoomID(std::string id)
{
this->roomID = id;
this->roomIDchanged();
}
messages::LimitedQueueSnapshot<messages::SharedMessage> Channel::getMessageSnapshot() messages::LimitedQueueSnapshot<messages::SharedMessage> Channel::getMessageSnapshot()
{ {
return _messages.getSnapshot(); return _messages.getSnapshot();

View file

@ -39,10 +39,6 @@ public:
const QString &getSubLink() const; const QString &getSubLink() const;
const QString &getChannelLink() const; const QString &getChannelLink() const;
const QString &getPopoutPlayerLink() const; const QString &getPopoutPlayerLink() const;
bool getIsLive() const;
int getStreamViewerCount() const;
const QString &getStreamStatus() const;
const QString &getStreamGame() const;
messages::LimitedQueueSnapshot<messages::SharedMessage> getMessageSnapshot(); messages::LimitedQueueSnapshot<messages::SharedMessage> getMessageSnapshot();
// methods // methods
@ -59,6 +55,9 @@ public:
QString streamGame; QString streamGame;
QString streamUptime; QString streamUptime;
void setRoomID(std::string id);
boost::signals2::signal<void()> roomIDchanged;
private: private:
// variables // variables
messages::LimitedQueue<messages::SharedMessage> _messages; messages::LimitedQueue<messages::SharedMessage> _messages;

View file

@ -283,7 +283,7 @@ void IrcManager::handleRoomStateMessage(Communi::IrcMessage *message)
std::string roomID = iterator.value().toString().toStdString(); std::string roomID = iterator.value().toString().toStdString();
auto channel = QString(message->toData()).split("#").at(1); auto channel = QString(message->toData()).split("#").at(1);
channelManager.getChannel(channel)->roomID = roomID; channelManager.getChannel(channel)->setRoomID(roomID);
this->resources.loadChannelData(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) void ChatWidget::setChannel(std::shared_ptr<Channel> _newChannel)
{ {
this->channel = _newChannel; this->channel = _newChannel;
this->channel->roomIDchanged.connect([this](){
this->header.checkLive();
});
// on new message // on new message
this->messageAppendedConnection = this->messageAppendedConnection =