2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Fix shortcut messages sizing / emoji panel.

This commit is contained in:
John Preston
2024-02-29 14:41:17 +04:00
parent aad8e989d8
commit 8545a14763
21 changed files with 253 additions and 82 deletions

View File

@@ -60,7 +60,8 @@ constexpr auto kRequestTimeLimit = 60 * crl::time(1000);
MTP_int(data.vttl_period().value_or_empty()));
}, [&](const MTPDmessage &data) {
return MTP_message(
MTP_flags(data.vflags().v | MTPDmessage::Flag::f_quick_reply_shortcut_id),
MTP_flags(data.vflags().v
| MTPDmessage::Flag::f_quick_reply_shortcut_id),
data.vid(),
data.vfrom_id() ? *data.vfrom_id() : MTPPeer(),
MTPint(), // from_boosts_applied

View File

@@ -96,6 +96,18 @@ public:
[[nodiscard]] static constexpr DraftKey ScheduledEdit() {
return kScheduledDraftIndex + kEditDraftShift;
}
[[nodiscard]] static constexpr DraftKey Shortcut(
BusinessShortcutId shortcutId) {
return (shortcutId < 0 || shortcutId >= ServerMaxMsgId)
? None()
: (kShortcutDraftShift + shortcutId);
}
[[nodiscard]] static constexpr DraftKey ShortcutEdit(
BusinessShortcutId shortcutId) {
return (shortcutId < 0 || shortcutId >= ServerMaxMsgId)
? None()
: (kShortcutDraftShift + kEditDraftShift + shortcutId);
}
[[nodiscard]] static constexpr DraftKey FromSerialized(qint64 value) {
return value;
@@ -156,6 +168,7 @@ private:
static constexpr auto kScheduledDraftIndex = -3;
static constexpr auto kEditDraftShift = ServerMaxMsgId.bare;
static constexpr auto kCloudDraftShift = 2 * ServerMaxMsgId.bare;
static constexpr auto kShortcutDraftShift = 3 * ServerMaxMsgId.bare;
static constexpr auto kEditDraftShiftOld = 0x3FFF'FFFF;
int64 _value = 0;