mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 06:07:06 +02:00
Divide groupId of scheduled / normal messages.
This commit is contained in:
parent
2d50e893b5
commit
40deda1e9b
3 changed files with 15 additions and 6 deletions
|
@ -41,7 +41,6 @@ private:
|
|||
|
||||
not_null<Session*> _data;
|
||||
std::map<MessageGroupId, Group> _groups;
|
||||
std::map<MessageGroupId, MessageGroupId> _alias;
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -63,13 +63,17 @@ struct FileOrigin;
|
|||
} // namespace Data
|
||||
|
||||
struct MessageGroupId {
|
||||
PeerId peer = 0;
|
||||
uint64 peerAndScheduledFlag = 0;
|
||||
uint64 value = 0;
|
||||
|
||||
MessageGroupId() = default;
|
||||
static MessageGroupId FromRaw(PeerId peer, uint64 value) {
|
||||
static MessageGroupId FromRaw(
|
||||
PeerId peer,
|
||||
uint64 value,
|
||||
bool scheduled) {
|
||||
auto result = MessageGroupId();
|
||||
result.peer = peer;
|
||||
result.peerAndScheduledFlag = peer.value
|
||||
| (scheduled ? (1ULL << 55) : 0);
|
||||
result.value = value;
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -317,7 +317,10 @@ HistoryItem::HistoryItem(
|
|||
setText(_media ? textWithEntities : EnsureNonEmpty(textWithEntities));
|
||||
if (const auto groupedId = data.vgrouped_id()) {
|
||||
setGroupId(
|
||||
MessageGroupId::FromRaw(history->peer->id, groupedId->v));
|
||||
MessageGroupId::FromRaw(
|
||||
history->peer->id,
|
||||
groupedId->v,
|
||||
_flags & MessageFlag::IsOrWasScheduled));
|
||||
}
|
||||
setReactions(data.vreactions());
|
||||
applyTTL(data);
|
||||
|
@ -507,7 +510,10 @@ HistoryItem::HistoryItem(
|
|||
setMedia(media);
|
||||
setText(textWithEntities);
|
||||
if (groupedId) {
|
||||
setGroupId(MessageGroupId::FromRaw(history->peer->id, groupedId));
|
||||
setGroupId(MessageGroupId::FromRaw(
|
||||
history->peer->id,
|
||||
groupedId,
|
||||
flags & MessageFlag::IsOrWasScheduled));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue