- /* store posts. */
- database.storePosts(sone, sone.getPosts());
- database.storePostReplies(sone, sone.getReplies());
- for (Album album : storedSone.get().getRootAlbum().getAlbums()) {
- database.removeAlbum(album);
- for (Image image : album.getImages()) {
- database.removeImage(image);
- }
- }
- for (Album album : toAllAlbums.apply(sone)) {
- database.storeAlbum(album);
- for (Image image : album.getImages()) {
- database.storeImage(image);
- }
- }
- synchronized (sones) {
- sone.setOptions(storedSone.get().getOptions());
- sone.setKnown(storedSone.get().isKnown());
- sone.setStatus((sone.getTime() == 0) ? SoneStatus.unknown : SoneStatus.idle);
- if (sone.isLocal()) {
- soneInserters.get(storedSone.get()).setSone(sone);
- touchConfiguration();
- }
- sones.put(sone.getId(), sone);
+ database.storeSone(sone);
+ sone.setOptions(storedSone.get().getOptions());
+ sone.setKnown(storedSone.get().isKnown());
+ sone.setStatus((sone.getTime() == 0) ? SoneStatus.unknown : SoneStatus.idle);
+ if (sone.isLocal()) {
+ touchConfiguration();