2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-30 22:16:14 +00:00

Show slowmode button in chat.

This commit is contained in:
John Preston
2019-07-16 15:59:50 +02:00
parent 055c145af5
commit 01d0479335
6 changed files with 48 additions and 11 deletions

View File

@@ -597,12 +597,11 @@ TimeId ChannelData::slowmodeLastMessage() const {
return (hasAdminRights() || amCreator()) ? 0 : _slowmodeLastMessage;
}
void ChannelData::setSlowmodeLastMessage(TimeId when) {
const auto time = when ? when : base::unixtime::now();
if (_slowmodeLastMessage == time) {
void ChannelData::growSlowmodeLastMessage(TimeId when) {
if (_slowmodeLastMessage >= when) {
return;
}
_slowmodeLastMessage = time;
_slowmodeLastMessage = when;
Notify::peerUpdatedDelayed(this, UpdateFlag::ChannelSlowmode);
}