mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-29 22:28:49 +03:00
Don't send url, if we send an encrypted file
Fix issues when sending images to some clients.
This commit is contained in:
parent
f23d733cff
commit
147ae68c31
1 changed files with 20 additions and 7 deletions
|
@ -361,10 +361,13 @@ TimelineViewManager::queueImageMessage(const QString &roomid,
|
||||||
image.info.size = dsize;
|
image.info.size = dsize;
|
||||||
image.info.blurhash = blurhash.toStdString();
|
image.info.blurhash = blurhash.toStdString();
|
||||||
image.body = filename.toStdString();
|
image.body = filename.toStdString();
|
||||||
image.url = url.toStdString();
|
|
||||||
image.info.h = dimensions.height();
|
image.info.h = dimensions.height();
|
||||||
image.info.w = dimensions.width();
|
image.info.w = dimensions.width();
|
||||||
|
|
||||||
|
if (file)
|
||||||
image.file = file;
|
image.file = file;
|
||||||
|
else
|
||||||
|
image.url = url.toStdString();
|
||||||
|
|
||||||
auto model = models.value(roomid);
|
auto model = models.value(roomid);
|
||||||
if (!model->reply().isEmpty()) {
|
if (!model->reply().isEmpty()) {
|
||||||
|
@ -388,8 +391,11 @@ TimelineViewManager::queueFileMessage(
|
||||||
file.info.mimetype = mime.toStdString();
|
file.info.mimetype = mime.toStdString();
|
||||||
file.info.size = dsize;
|
file.info.size = dsize;
|
||||||
file.body = filename.toStdString();
|
file.body = filename.toStdString();
|
||||||
file.url = url.toStdString();
|
|
||||||
|
if (encryptedFile)
|
||||||
file.file = encryptedFile;
|
file.file = encryptedFile;
|
||||||
|
else
|
||||||
|
file.url = url.toStdString();
|
||||||
|
|
||||||
auto model = models.value(roomid);
|
auto model = models.value(roomid);
|
||||||
if (!model->reply().isEmpty()) {
|
if (!model->reply().isEmpty()) {
|
||||||
|
@ -413,7 +419,11 @@ TimelineViewManager::queueAudioMessage(const QString &roomid,
|
||||||
audio.info.size = dsize;
|
audio.info.size = dsize;
|
||||||
audio.body = filename.toStdString();
|
audio.body = filename.toStdString();
|
||||||
audio.url = url.toStdString();
|
audio.url = url.toStdString();
|
||||||
|
|
||||||
|
if (file)
|
||||||
audio.file = file;
|
audio.file = file;
|
||||||
|
else
|
||||||
|
audio.url = url.toStdString();
|
||||||
|
|
||||||
auto model = models.value(roomid);
|
auto model = models.value(roomid);
|
||||||
if (!model->reply().isEmpty()) {
|
if (!model->reply().isEmpty()) {
|
||||||
|
@ -436,8 +446,11 @@ TimelineViewManager::queueVideoMessage(const QString &roomid,
|
||||||
video.info.mimetype = mime.toStdString();
|
video.info.mimetype = mime.toStdString();
|
||||||
video.info.size = dsize;
|
video.info.size = dsize;
|
||||||
video.body = filename.toStdString();
|
video.body = filename.toStdString();
|
||||||
video.url = url.toStdString();
|
|
||||||
|
if (file)
|
||||||
video.file = file;
|
video.file = file;
|
||||||
|
else
|
||||||
|
video.url = url.toStdString();
|
||||||
|
|
||||||
auto model = models.value(roomid);
|
auto model = models.value(roomid);
|
||||||
if (!model->reply().isEmpty()) {
|
if (!model->reply().isEmpty()) {
|
||||||
|
|
Loading…
Reference in a new issue