mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-09-02 07:25:46 +00:00
pin/unpin messages in supergroups, local hide for pinned messages
This commit is contained in:
@@ -556,6 +556,69 @@ namespace {
|
||||
lskSavedGifs = 0x0f, // no data
|
||||
};
|
||||
|
||||
enum {
|
||||
dbiKey = 0x00,
|
||||
dbiUser = 0x01,
|
||||
dbiDcOptionOld = 0x02,
|
||||
dbiChatSizeMax = 0x03,
|
||||
dbiMutePeer = 0x04,
|
||||
dbiSendKey = 0x05,
|
||||
dbiAutoStart = 0x06,
|
||||
dbiStartMinimized = 0x07,
|
||||
dbiSoundNotify = 0x08,
|
||||
dbiWorkMode = 0x09,
|
||||
dbiSeenTrayTooltip = 0x0a,
|
||||
dbiDesktopNotify = 0x0b,
|
||||
dbiAutoUpdate = 0x0c,
|
||||
dbiLastUpdateCheck = 0x0d,
|
||||
dbiWindowPosition = 0x0e,
|
||||
dbiConnectionType = 0x0f,
|
||||
// 0x10 reserved
|
||||
dbiDefaultAttach = 0x11,
|
||||
dbiCatsAndDogs = 0x12,
|
||||
dbiReplaceEmojis = 0x13,
|
||||
dbiAskDownloadPath = 0x14,
|
||||
dbiDownloadPathOld = 0x15,
|
||||
dbiScale = 0x16,
|
||||
dbiEmojiTabOld = 0x17,
|
||||
dbiRecentEmojisOld = 0x18,
|
||||
dbiLoggedPhoneNumber = 0x19,
|
||||
dbiMutedPeers = 0x1a,
|
||||
// 0x1b reserved
|
||||
dbiNotifyView = 0x1c,
|
||||
dbiSendToMenu = 0x1d,
|
||||
dbiCompressPastedImage = 0x1e,
|
||||
dbiLang = 0x1f,
|
||||
dbiLangFile = 0x20,
|
||||
dbiTileBackground = 0x21,
|
||||
dbiAutoLock = 0x22,
|
||||
dbiDialogLastPath = 0x23,
|
||||
dbiRecentEmojis = 0x24,
|
||||
dbiEmojiVariants = 0x25,
|
||||
dbiRecentStickers = 0x26,
|
||||
dbiDcOption = 0x27,
|
||||
dbiTryIPv6 = 0x28,
|
||||
dbiSongVolume = 0x29,
|
||||
dbiWindowsNotifications = 0x30,
|
||||
dbiIncludeMuted = 0x31,
|
||||
dbiMegagroupSizeMax = 0x32,
|
||||
dbiDownloadPath = 0x33,
|
||||
dbiAutoDownload = 0x34,
|
||||
dbiSavedGifsLimit = 0x35,
|
||||
dbiShowingSavedGifs = 0x36,
|
||||
dbiAutoPlay = 0x37,
|
||||
dbiAdaptiveForWide = 0x38,
|
||||
dbiHiddenPinnedMessages = 0x39,
|
||||
|
||||
dbiEncryptedWithSalt = 333,
|
||||
dbiEncrypted = 444,
|
||||
|
||||
// 500-600 reserved
|
||||
|
||||
dbiVersion = 666,
|
||||
};
|
||||
|
||||
|
||||
typedef QMap<PeerId, FileKey> DraftsMap;
|
||||
DraftsMap _draftsMap, _draftCursorsMap;
|
||||
typedef QMap<PeerId, bool> DraftsNotReadMap;
|
||||
@@ -1266,6 +1329,15 @@ namespace {
|
||||
cSetEmojiVariants(v);
|
||||
} break;
|
||||
|
||||
|
||||
case dbiHiddenPinnedMessages: {
|
||||
Global::HiddenPinnedMessagesMap v;
|
||||
stream >> v;
|
||||
if (!_checkStreamStatus(stream)) return false;
|
||||
|
||||
Global::SetHiddenPinnedMessages(v);
|
||||
} break;
|
||||
|
||||
case dbiDialogLastPath: {
|
||||
QString path;
|
||||
stream >> path;
|
||||
@@ -1510,6 +1582,9 @@ namespace {
|
||||
size += sizeof(quint32) + sizeof(qint32) + (cRecentStickersPreload().isEmpty() ? cGetRecentStickers().size() : cRecentStickersPreload().size()) * (sizeof(uint64) + sizeof(ushort));
|
||||
size += sizeof(quint32) + _stringSize(cDialogLastPath());
|
||||
size += sizeof(quint32) + 3 * sizeof(qint32);
|
||||
if (!Global::HiddenPinnedMessages().isEmpty()) {
|
||||
size += sizeof(quint32) + sizeof(qint32) + Global::HiddenPinnedMessages().size() * (sizeof(PeerId) + sizeof(MsgId));
|
||||
}
|
||||
|
||||
EncryptedDescriptor data(size);
|
||||
data.stream << quint32(dbiSendKey) << qint32(cCtrlEnter() ? dbiskCtrlEnter : dbiskEnter);
|
||||
@@ -1553,6 +1628,9 @@ namespace {
|
||||
}
|
||||
data.stream << quint32(dbiRecentStickers) << v;
|
||||
}
|
||||
if (!Global::HiddenPinnedMessages().isEmpty()) {
|
||||
data.stream << quint32(dbiHiddenPinnedMessages) << Global::HiddenPinnedMessages();
|
||||
}
|
||||
|
||||
FileWriteDescriptor file(_userSettingsKey);
|
||||
file.writeEncrypted(data);
|
||||
|
Reference in New Issue
Block a user