Fix file not being sent (2)
这个提交包含在:
父节点
5f0d2ea7b1
当前提交
03f6e63b69
共有 2 个文件被更改,包括 2 次插入 和 7 次删除
|
|
@ -248,13 +248,7 @@ public class DatabaseController {
|
|||
// Handle messages containing a file
|
||||
String filePath = "NULL";
|
||||
if (message instanceof FileMessage) {
|
||||
try {
|
||||
filePath = "'" + ((FileMessage) message).storeFile() + "'";
|
||||
} catch (IOException e) {
|
||||
Log.e(getClass().getSimpleName(), "Error while saving the file", e);
|
||||
errorCallback.onError(e);
|
||||
return;
|
||||
}
|
||||
filePath = "'" + ((FileMessage) message).getPath() + "'";
|
||||
}
|
||||
|
||||
String recipientId = message.getRecipient().id;
|
||||
|
|
|
|||
|
|
@ -66,6 +66,7 @@ public class PeerUser extends User implements Comparable<PeerUser> {
|
|||
"Sending file message to " + this.getUsername() + " / " + this.getId() + ": " + msg);
|
||||
try {
|
||||
final FileMessage message = new FileMessage(CurrentUser.getInstance(), this, new Date(), msg, file.getPath());
|
||||
message.storeFile();
|
||||
connection.send(message, () -> history.addMessage(message, errorCallback), errorCallback);
|
||||
} catch (IOException e) {
|
||||
Log.e(this.getClass().getSimpleName(), "Could not send message: error while opening file", e);
|
||||
|
|
|
|||
正在加载…
在新工单中引用