diff --git a/channel.cpp b/channel.cpp index c80687129..2580eb0ba 100644 --- a/channel.cpp +++ b/channel.cpp @@ -18,10 +18,10 @@ Channel::Channel(const QString &channel) , channelLink("https://twitch.tv/" + name) , popoutPlayerLink("https://player.twitch.tv/?channel=" + name) { - for (int i = 0; i < 40; i++) { - addMessage(std::shared_ptr( - new messages::Message("test xD test"))); - } + // for (int i = 0; i < 40; i++) { + // addMessage(std::shared_ptr( + // new messages::Message("test xD test"))); + // } } QVector> diff --git a/emotes.cpp b/emotes.cpp index e93b7bdff..b8aaed1e8 100644 --- a/emotes.cpp +++ b/emotes.cpp @@ -1,6 +1,8 @@ #include "emotes.h" #include "resources.h" +#include + namespace chatterino { QString Emotes::twitchEmoteTemplate( @@ -26,7 +28,10 @@ Emotes::Emotes() messages::LazyLoadedImage * Emotes::getTwitchEmoteById(const QString &name, long id) { - return Emotes::twitchEmoteFromCache.getOrAdd(id, [&name, id] { + qDebug() << "loading twitch emote: " << id; + + return Emotes::twitchEmoteFromCache.getOrAdd(id, [&name, &id] { + qDebug() << "loading twitch emote: " << id; qreal scale; QString url = getTwitchEmoteLink(id, scale); return new messages::LazyLoadedImage(url, scale, name, @@ -39,8 +44,11 @@ Emotes::getTwitchEmoteLink(long id, qreal &scale) { scale = .5; - return Emotes::twitchEmoteTemplate.replace("{id}", QString::number(id)) - .replace("{scale}", "2"); + QString value = Emotes::twitchEmoteTemplate; + + value.detach(); + + return value.replace("{id}", QString::number(id)).replace("{scale}", "2"); } messages::LazyLoadedImage *