Implement resync after update monitor reconnect
This commit is contained in:
@@ -34,7 +34,15 @@ public class MessageListModel : Object, ListModel
|
||||
|
||||
public void watch_updates() {
|
||||
if (this.handler_id == 0) {
|
||||
this.handler_id = Repository.get_instance().messages_updated.connect(got_messages_updated);
|
||||
weak MessageListModel self = this;
|
||||
this.handler_id = Repository.get_instance().messages_updated.connect((conversation_guid) => {
|
||||
self.got_messages_updated(conversation_guid);
|
||||
});
|
||||
|
||||
this.handler_id = Repository.get_instance().reconnected.connect(() => {
|
||||
// On reconnect, reload the messages that we're looking at now.
|
||||
self.load_messages();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user