Fixed issue reagarding missing chats

This commit is contained in:
DieGurke 2020-06-11 13:21:16 +02:00
parent c2a627529a
commit 7025cabd2f
2 changed files with 10 additions and 0 deletions

View File

@ -200,4 +200,13 @@ public abstract class LocalDB {
}
});
}
/**
* Creates a new {@link Chat} for all {@link Contact}s that do not have a chat.
*
* @since Envoy Client v0.1-beta
*/
public void createMissingChats() {
users.values().stream().filter(u -> !u.equals(user) && getChat(u.getID()).isEmpty()).map(Chat::new).forEach(chats::add);
}
}

View File

@ -185,6 +185,7 @@ public final class LoginScene {
// Save all users to the local database and flush cache
localDB.setUsers(client.getUsers());
localDB.createMissingChats();
writeProxy.flushCache();
} else
// Set all contacts to offline mode