diff --git a/src/filetransferinstance.cpp b/src/filetransferinstance.cpp index b6da4cf4a..666cc1201 100644 --- a/src/filetransferinstance.cpp +++ b/src/filetransferinstance.cpp @@ -204,8 +204,8 @@ bool isFileWritable(QString& path) void FileTransferInstance::acceptRecvRequest() { - QString path; - if (!(path = Settings::getInstance().getAutoAcceptDir(Core::getInstance()->getFriendAddress(friendId))).isEmpty()) + QString path = Settings::getInstance().getAutoAcceptDir(Core::getInstance()->getFriendAddress(friendId)); + if (!path.isEmpty()) { QDir dir(path); path = dir.filePath(filename); diff --git a/src/widget/form/chatform.cpp b/src/widget/form/chatform.cpp index ead124f5e..0d317332f 100644 --- a/src/widget/form/chatform.cpp +++ b/src/widget/form/chatform.cpp @@ -36,6 +36,7 @@ #include "src/widget/maskablepixmapwidget.h" #include "src/widget/croppinglabel.h" #include "src/misc/style.h" +#include "src/misc/settings.h" ChatForm::ChatForm(Friend* chatFriend) : f(chatFriend) @@ -178,6 +179,9 @@ void ChatForm::onFileRecvRequest(ToxFile file) previousName = f->getName(); chatWidget->insertMessage(new FileTransferAction(fileTrans, getElidedName(name), QTime::currentTime().toString("hh:mm"), false)); + + if (!Settings::getInstance().getAutoAcceptDir(Core::getInstance()->getFriendAddress(f->friendId)).isEmpty()) + fileTrans->pressFromHtml("btnB"); } void ChatForm::onAvInvite(int FriendId, int CallId, bool video)