2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

Allow sending typing/send actions for Replies section.

This commit is contained in:
John Preston
2020-09-18 14:50:47 +03:00
parent f73b0f0b0d
commit a287dec242
4 changed files with 74 additions and 48 deletions

View File

@@ -62,7 +62,6 @@ constexpr auto kStatusShowClientsideUploadFile = 6000;
constexpr auto kStatusShowClientsideChooseLocation = 6000;
constexpr auto kStatusShowClientsideChooseContact = 6000;
constexpr auto kStatusShowClientsidePlayGame = 10000;
constexpr auto kSetMyActionForMs = 10000;
constexpr auto kNewBlockEachMessage = 50;
constexpr auto kSkipCloudDraftsFor = TimeId(3);
@@ -421,29 +420,6 @@ bool History::updateSendActionNeedsAnimating(
return updateSendActionNeedsAnimating(now, true);
}
bool History::mySendActionUpdated(Api::SendProgressType type, bool doing) {
const auto now = crl::now();
const auto i = _mySendActions.find(type);
if (doing) {
if (i == end(_mySendActions)) {
_mySendActions.emplace(type, now + kSetMyActionForMs);
} else if (i->second > now + (kSetMyActionForMs / 2)) {
return false;
} else {
i->second = now + kSetMyActionForMs;
}
} else {
if (i == end(_mySendActions)) {
return false;
} else if (i->second <= now) {
return false;
} else {
_mySendActions.erase(i);
}
}
return true;
}
bool History::paintSendAction(
Painter &p,
int x,