Fix emote copying (#687)

* Fix emote copying

* Fix (i.e. no longer add) blank spaces instead of badges

I.e. badges' names do not get copied
This commit is contained in:
hemirt 2018-08-28 19:25:15 +02:00 committed by pajlada
parent ce155299e9
commit 113cfd69b0

View file

@ -1,6 +1,7 @@
#include "messages/layouts/MessageLayoutElement.hpp" #include "messages/layouts/MessageLayoutElement.hpp"
#include "Application.hpp" #include "Application.hpp"
#include "messages/Emote.hpp"
#include "messages/Image.hpp" #include "messages/Image.hpp"
#include "messages/MessageElement.hpp" #include "messages/MessageElement.hpp"
#include "singletons/Theme.hpp" #include "singletons/Theme.hpp"
@ -77,11 +78,12 @@ ImageLayoutElement::ImageLayoutElement(MessageElement &creator, ImagePtr image,
void ImageLayoutElement::addCopyTextToString(QString &str, int from, void ImageLayoutElement::addCopyTextToString(QString &str, int from,
int to) const int to) const
{ {
// str += this->image_->getCopyString(); const auto *emoteElement = dynamic_cast<EmoteElement *>(&this->getCreator());
str += "not implemented"; if (emoteElement) {
str += emoteElement->getEmote()->getCopyString();
if (this->hasTrailingSpace()) { if (this->hasTrailingSpace()) {
str += " "; str += " ";
}
} }
} }