mirror of
https://github.com/vale981/tdesktop
synced 2025-03-06 10:11:41 -05:00
fixed new not important message adding
This commit is contained in:
parent
559a74847b
commit
844e375fac
2 changed files with 12 additions and 6 deletions
|
@ -759,12 +759,12 @@ HistoryItem *ChannelHistory::addNewToBlocks(const MTPMessage &msg, NewMessageTyp
|
||||||
|
|
||||||
if (prev && prev->type() == HistoryItemGroup) {
|
if (prev && prev->type() == HistoryItemGroup) {
|
||||||
static_cast<HistoryGroup*>(prev)->uniteWith(item);
|
static_cast<HistoryGroup*>(prev)->uniteWith(item);
|
||||||
return prev;
|
} else {
|
||||||
|
QDateTime date = prev ? prev->date : item->date;
|
||||||
|
HistoryBlock *block = prev ? prev->block() : pushBackNewBlock();
|
||||||
|
addItemToBlock(HistoryGroup::create(this, item, date), block);
|
||||||
}
|
}
|
||||||
|
return item;
|
||||||
QDateTime date = prev ? prev->date : item->date;
|
|
||||||
HistoryBlock *block = prev ? prev->block() : pushBackNewBlock();
|
|
||||||
return addItemToBlock(HistoryGroup::create(this, item, date), block);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// when we are receiving channel dialog rows we get one important and one not important
|
// when we are receiving channel dialog rows we get one important and one not important
|
||||||
|
|
|
@ -1163,7 +1163,10 @@ public:
|
||||||
return !_block;
|
return !_block;
|
||||||
}
|
}
|
||||||
void attachToBlock(HistoryBlock *block, int index) {
|
void attachToBlock(HistoryBlock *block, int index) {
|
||||||
t_assert(_block == nullptr && _indexInBlock < 0);
|
t_assert(_block == nullptr);
|
||||||
|
t_assert(_indexInBlock < 0);
|
||||||
|
t_assert(block != nullptr);
|
||||||
|
t_assert(index >= 0);
|
||||||
|
|
||||||
_block = block;
|
_block = block;
|
||||||
_indexInBlock = index;
|
_indexInBlock = index;
|
||||||
|
@ -1172,6 +1175,9 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void setIndexInBlock(int index) {
|
void setIndexInBlock(int index) {
|
||||||
|
t_assert(_block != nullptr);
|
||||||
|
t_assert(index >= 0);
|
||||||
|
|
||||||
_indexInBlock = index;
|
_indexInBlock = index;
|
||||||
}
|
}
|
||||||
int indexInBlock() const {
|
int indexInBlock() const {
|
||||||
|
|
Loading…
Add table
Reference in a new issue