Fix sending files on android

Requires https://github.com/quotient-im/libQuotient/pull/585
This commit is contained in:
Tobias Fella
2022-11-10 00:27:56 +01:00
parent b332993b77
commit f733a2edef

View File

@@ -63,9 +63,9 @@ void ActionsHandler::handleMessage()
{
checkEffects();
if (!m_room->chatBoxAttachmentPath().isEmpty()) {
auto path = m_room->chatBoxAttachmentPath();
path = path.mid(path.lastIndexOf('/') + 1);
m_room->uploadFile(m_room->chatBoxAttachmentPath(), m_room->chatBoxText().isEmpty() ? path : m_room->chatBoxText());
QUrl url(m_room->chatBoxAttachmentPath());
auto path = url.isLocalFile() ? url.toLocalFile() : url.toString();
m_room->uploadFile(path, m_room->chatBoxText().isEmpty() ? path.mid(path.lastIndexOf('/') + 1) : m_room->chatBoxText());
m_room->setChatBoxAttachmentPath({});
m_room->setChatBoxText({});
return;