ChatWidgetView -> ChannelView, added Emote Picker

This commit is contained in:
fourtf
2017-09-16 00:05:06 +02:00
parent 84c23a5d00
commit c7b3480aaf
37 changed files with 532 additions and 407 deletions
+4 -59
View File
@@ -18,55 +18,14 @@ using namespace chatterino::messages;
namespace chatterino {
Channel::Channel(WindowManager &_windowManager, EmoteManager &_emoteManager,
IrcManager &_ircManager, const QString &channelName, bool isSpecial)
: windowManager(_windowManager)
, emoteManager(_emoteManager)
, ircManager(_ircManager)
, name(channelName)
, bttvChannelEmotes(this->emoteManager.bttvChannels[channelName])
, ffzChannelEmotes(this->emoteManager.ffzChannels[channelName])
, _subLink("https://www.twitch.tv/" + name + "/subscribe?ref=in_chat_subscriber_link")
, _channelLink("https://twitch.tv/" + name)
, _popoutPlayerLink("https://player.twitch.tv/?channel=" + name)
, isLive(false)
Channel::Channel()
// , _loggingChannel(logging::get(_name))
{
qDebug() << "Open channel:" << this->name;
if (!isSpecial) {
this->reloadChannelEmotes();
}
}
//
// properties
//
bool Channel::isEmpty() const
{
return name.isEmpty();
}
const QString &Channel::getSubLink() const
{
return _subLink;
}
const QString &Channel::getChannelLink() const
{
return _channelLink;
}
const QString &Channel::getPopoutPlayerLink() const
{
return _popoutPlayerLink;
}
void Channel::setRoomID(std::string id)
{
this->roomID = id;
this->roomIDchanged();
return false;
}
messages::LimitedQueueSnapshot<messages::SharedMessage> Channel::getMessageSnapshot()
@@ -74,9 +33,6 @@ messages::LimitedQueueSnapshot<messages::SharedMessage> Channel::getMessageSnaps
return _messages.getSnapshot();
}
//
// methods
//
void Channel::addMessage(std::shared_ptr<Message> message)
{
std::shared_ptr<Message> deleted;
@@ -90,26 +46,15 @@ void Channel::addMessage(std::shared_ptr<Message> message)
}
this->messageAppended(message);
this->windowManager.repaintVisibleChatWidgets(this);
}
// private methods
void Channel::reloadChannelEmotes()
bool Channel::canSendMessage() const
{
printf("[Channel:%s] Reloading channel emotes\n", qPrintable(this->name));
this->emoteManager.reloadBTTVChannelEmotes(this->name);
this->emoteManager.reloadFFZChannelEmotes(this->name);
return false;
}
void Channel::sendMessage(const QString &message)
{
qDebug() << "Channel send message: " << message;
// Do last message processing
QString parsedMessage = this->emoteManager.replaceShortCodes(message);
this->ircManager.sendMessage(name, parsedMessage);
}
} // namespace chatterino