mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +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;
|
not_null<Session*> _data;
|
||||||
std::map<MessageGroupId, Group> _groups;
|
std::map<MessageGroupId, Group> _groups;
|
||||||
std::map<MessageGroupId, MessageGroupId> _alias;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -63,13 +63,17 @@ struct FileOrigin;
|
||||||
} // namespace Data
|
} // namespace Data
|
||||||
|
|
||||||
struct MessageGroupId {
|
struct MessageGroupId {
|
||||||
PeerId peer = 0;
|
uint64 peerAndScheduledFlag = 0;
|
||||||
uint64 value = 0;
|
uint64 value = 0;
|
||||||
|
|
||||||
MessageGroupId() = default;
|
MessageGroupId() = default;
|
||||||
static MessageGroupId FromRaw(PeerId peer, uint64 value) {
|
static MessageGroupId FromRaw(
|
||||||
|
PeerId peer,
|
||||||
|
uint64 value,
|
||||||
|
bool scheduled) {
|
||||||
auto result = MessageGroupId();
|
auto result = MessageGroupId();
|
||||||
result.peer = peer;
|
result.peerAndScheduledFlag = peer.value
|
||||||
|
| (scheduled ? (1ULL << 55) : 0);
|
||||||
result.value = value;
|
result.value = value;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
@ -317,7 +317,10 @@ HistoryItem::HistoryItem(
|
||||||
setText(_media ? textWithEntities : EnsureNonEmpty(textWithEntities));
|
setText(_media ? textWithEntities : EnsureNonEmpty(textWithEntities));
|
||||||
if (const auto groupedId = data.vgrouped_id()) {
|
if (const auto groupedId = data.vgrouped_id()) {
|
||||||
setGroupId(
|
setGroupId(
|
||||||
MessageGroupId::FromRaw(history->peer->id, groupedId->v));
|
MessageGroupId::FromRaw(
|
||||||
|
history->peer->id,
|
||||||
|
groupedId->v,
|
||||||
|
_flags & MessageFlag::IsOrWasScheduled));
|
||||||
}
|
}
|
||||||
setReactions(data.vreactions());
|
setReactions(data.vreactions());
|
||||||
applyTTL(data);
|
applyTTL(data);
|
||||||
|
@ -507,7 +510,10 @@ HistoryItem::HistoryItem(
|
||||||
setMedia(media);
|
setMedia(media);
|
||||||
setText(textWithEntities);
|
setText(textWithEntities);
|
||||||
if (groupedId) {
|
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