2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 22:55:11 +00:00

Request dialog list entries when needed.

Also save the original server-side int32 date in HistoryItems.
This commit is contained in:
John Preston
2018-02-03 22:52:35 +03:00
parent 0c5efb935d
commit 8bacc74d8b
50 changed files with 719 additions and 549 deletions

View File

@@ -39,7 +39,8 @@ public:
};
bool canAddItem(not_null<const HistoryItem*> item) const {
return (ComputeType(item) == _type && item->date.date() == _date);
return (ComputeType(item) == _type)
&& (ItemDateTime(item).date() == _date);
}
void addItem(not_null<HistoryItem*> item) {
Expects(canAddItem(item));
@@ -117,7 +118,7 @@ private:
BoxController::Row::Row(not_null<HistoryItem*> item)
: PeerListRow(item->history()->peer, item->id)
, _items(1, item)
, _date(item->date.date())
, _date(ItemDateTime(item).date())
, _type(ComputeType(item)) {
refreshStatus();
}
@@ -162,7 +163,7 @@ void BoxController::Row::refreshStatus() {
return;
}
auto text = [this] {
auto time = _items.front()->date.time().toString(cTimeFormat());
auto time = ItemDateTime(_items.front()).time().toString(cTimeFormat());
auto today = QDateTime::currentDateTime().date();
if (_date == today) {
return lng_call_box_status_today(lt_time, time);