forked from blue/squawk
downloaded files now stored with squawk:// prefix, that way I can move downloads folder without messing up the database
This commit is contained in:
parent
243edff8bd
commit
d8b5ccb2da
14 changed files with 75 additions and 44 deletions
|
@ -298,6 +298,14 @@ void Core::MessageHandler::performSending(Shared::Message data, bool newMessage)
|
|||
data.setTime(sendTime);
|
||||
}
|
||||
changes.insert("stamp", sendTime);
|
||||
|
||||
//sometimes (when the image is pasted with ctrl+v)
|
||||
//I start sending message with one path, then copy it to downloads directory
|
||||
//so, the final path changes. Let's assume it changes always since it costs me close to nothing
|
||||
QString attachPath = data.getAttachPath();
|
||||
if (attachPath.size() > 0) {
|
||||
changes.insert("attachPath", attachPath);
|
||||
}
|
||||
|
||||
if (ri != 0) {
|
||||
if (newMessage) {
|
||||
|
@ -439,14 +447,15 @@ void Core::MessageHandler::handleUploadError(const QString& jid, const QString&
|
|||
});
|
||||
}
|
||||
|
||||
void Core::MessageHandler::onUploadFileComplete(const std::list<Shared::MessageInfo>& msgs, const QString& path)
|
||||
void Core::MessageHandler::onUploadFileComplete(const std::list<Shared::MessageInfo>& msgs, const QString& url, const QString& path)
|
||||
{
|
||||
for (const Shared::MessageInfo& info : msgs) {
|
||||
if (info.account == acc->getName()) {
|
||||
RosterItem* ri = acc->rh->getRosterItem(info.jid);
|
||||
if (ri != 0) {
|
||||
Shared::Message msg = ri->getMessage(info.messageId);
|
||||
sendMessageWithLocalUploadedFile(msg, path, false);
|
||||
msg.setAttachPath(path);
|
||||
sendMessageWithLocalUploadedFile(msg, url, false);
|
||||
} else {
|
||||
qDebug() << "A signal received about complete upload to" << acc->name << "for pal" << info.jid << "but the object for this pal wasn't found, something went terrebly wrong, skipping send";
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ public slots:
|
|||
void onUploadSlotReceived(const QXmppHttpUploadSlotIq& slot);
|
||||
void onUploadSlotRequestFailed(const QXmppHttpUploadRequestIq& request);
|
||||
void onDownloadFileComplete(const std::list<Shared::MessageInfo>& msgs, const QString& path);
|
||||
void onUploadFileComplete(const std::list<Shared::MessageInfo>& msgs, const QString& path);
|
||||
void onUploadFileComplete(const std::list<Shared::MessageInfo>& msgs, const QString& url, const QString& path);
|
||||
void onLoadFileError(const std::list<Shared::MessageInfo>& msgs, const QString& path, bool up);
|
||||
void requestChangeMessage(const QString& jid, const QString& messageId, const QMap<QString, QVariant>& data);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue