feat: include more data when copying messages as JSON (#5600)

This commit is contained in:
nerix
2024-09-28 12:40:15 +02:00
committed by GitHub
parent edf18a7a0f
commit e149be3820
16 changed files with 504 additions and 33 deletions
+20
View File
@@ -3,6 +3,8 @@
#include "messages/Image.hpp"
#include "singletons/Settings.hpp"
#include <QJsonObject>
namespace chatterino {
ImageSet::ImageSet()
@@ -135,4 +137,22 @@ bool ImageSet::operator!=(const ImageSet &other) const
return !this->operator==(other);
}
QJsonObject ImageSet::toJson() const
{
QJsonObject obj;
if (!this->imageX1_->isEmpty())
{
obj[u"1x"] = this->imageX1_->url().string;
}
if (!this->imageX2_->isEmpty())
{
obj[u"2x"] = this->imageX2_->url().string;
}
if (!this->imageX3_->isEmpty())
{
obj[u"3x"] = this->imageX3_->url().string;
}
return obj;
}
} // namespace chatterino