Update last_activity before received_file signal to keep UI in sync (#811)

Fixes #791 where a signal to update the UI is sent to
late when sending files, resulting in an out of sync
conversations list.
This commit is contained in:
kmq 2020-04-18 15:18:25 +00:00 committed by GitHub
parent fcad6720e6
commit 2419bf3b15
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -63,6 +63,7 @@ public class FileManager : StreamInteractionModule, Object {
yield save_file(file_transfer); yield save_file(file_transfer);
file_transfer.persist(db); file_transfer.persist(db);
conversation.last_active = file_transfer.time;
received_file(file_transfer, conversation); received_file(file_transfer, conversation);
} catch (Error e) { } catch (Error e) {
file_transfer.state = FileTransfer.State.FAILED; file_transfer.state = FileTransfer.State.FAILED;
@ -113,7 +114,6 @@ public class FileManager : StreamInteractionModule, Object {
yield file_sender.send_file(conversation, file_transfer, file_send_data, file_meta); yield file_sender.send_file(conversation, file_transfer, file_send_data, file_meta);
conversation.last_active = file_transfer.time;
} catch (Error e) { } catch (Error e) {
warning("Send file error: %s", e.message); warning("Send file error: %s", e.message);
file_transfer.state = FileTransfer.State.FAILED; file_transfer.state = FileTransfer.State.FAILED;