mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
Also added live check on startup.
This commit is contained in:
parent
5fe8ee6117
commit
19268d7ad7
4 changed files with 13 additions and 5 deletions
|
@ -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();
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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 =
|
||||||
|
|
Loading…
Reference in a new issue