use of im.actor.core.api.rpc.RequestLoadHistory in project actor-platform by actorapp.
the class ConversationHistoryActor method onLoadMore.
private void onLoadMore() {
if (isFreezed || historyLoaded) {
return;
}
isFreezed = true;
api(new RequestLoadHistory(buidOutPeer(peer), historyMaxDate, null, LIMIT, ApiSupportConfiguration.OPTIMIZATIONS)).chain(r -> updates().applyRelatedData(r.getUsers(), r.getGroups())).chain(r -> updates().loadRequiredPeers(r.getUserPeers(), r.getGroupPeers())).flatMap(r -> {
Log.d("HistoryActor", "Apply " + historyMaxDate);
return applyHistory(peer, r.getHistory());
}).map(r -> {
Log.d("HistoryActor", "Applied");
isFreezed = false;
unstashAll();
return null;
});
}
Aggregations