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

Use crl::time/now instead of TimeMs/getms.

This commit is contained in:
John Preston
2019-02-19 10:57:53 +04:00
parent d208236994
commit fe618bd652
310 changed files with 1133 additions and 1141 deletions

View File

@@ -78,7 +78,7 @@ public:
const Passport::SavedCredentials *passportCredentials() const;
void rememberPassportCredentials(
Passport::SavedCredentials data,
TimeMs rememberFor);
crl::time rememberFor);
void forgetPassportCredentials();
Storage::Cache::Database &cache();
@@ -205,34 +205,34 @@ public:
void notifySavedGifsUpdated();
[[nodiscard]] rpl::producer<> savedGifsUpdated() const;
bool stickersUpdateNeeded(TimeMs now) const {
bool stickersUpdateNeeded(crl::time now) const {
return stickersUpdateNeeded(_lastStickersUpdate, now);
}
void setLastStickersUpdate(TimeMs update) {
void setLastStickersUpdate(crl::time update) {
_lastStickersUpdate = update;
}
bool recentStickersUpdateNeeded(TimeMs now) const {
bool recentStickersUpdateNeeded(crl::time now) const {
return stickersUpdateNeeded(_lastRecentStickersUpdate, now);
}
void setLastRecentStickersUpdate(TimeMs update) {
void setLastRecentStickersUpdate(crl::time update) {
_lastRecentStickersUpdate = update;
}
bool favedStickersUpdateNeeded(TimeMs now) const {
bool favedStickersUpdateNeeded(crl::time now) const {
return stickersUpdateNeeded(_lastFavedStickersUpdate, now);
}
void setLastFavedStickersUpdate(TimeMs update) {
void setLastFavedStickersUpdate(crl::time update) {
_lastFavedStickersUpdate = update;
}
bool featuredStickersUpdateNeeded(TimeMs now) const {
bool featuredStickersUpdateNeeded(crl::time now) const {
return stickersUpdateNeeded(_lastFeaturedStickersUpdate, now);
}
void setLastFeaturedStickersUpdate(TimeMs update) {
void setLastFeaturedStickersUpdate(crl::time update) {
_lastFeaturedStickersUpdate = update;
}
bool savedGifsUpdateNeeded(TimeMs now) const {
bool savedGifsUpdateNeeded(crl::time now) const {
return stickersUpdateNeeded(_lastSavedGifsUpdate, now);
}
void setLastSavedGifsUpdate(TimeMs update) {
void setLastSavedGifsUpdate(crl::time update) {
_lastSavedGifsUpdate = update;
}
int featuredStickerSetsUnreadCount() const {
@@ -329,7 +329,7 @@ public:
int withUnreadDelta,
int mutedWithUnreadDelta);
void selfDestructIn(not_null<HistoryItem*> item, TimeMs delay);
void selfDestructIn(not_null<HistoryItem*> item, crl::time delay);
[[nodiscard]] not_null<PhotoData*> photo(PhotoId id);
not_null<PhotoData*> processPhoto(const MTPPhoto &data);
@@ -508,7 +508,7 @@ public:
std::optional<bool> silentPosts = std::nullopt);
bool notifyIsMuted(
not_null<const PeerData*> peer,
TimeMs *changesIn = nullptr) const;
crl::time *changesIn = nullptr) const;
bool notifySilentPosts(not_null<const PeerData*> peer) const;
bool notifyMuteUnknown(not_null<const PeerData*> peer) const;
bool notifySilentPostsUnknown(not_null<const PeerData*> peer) const;
@@ -634,8 +634,8 @@ private:
PhotoData *photo,
DocumentData *document);
bool stickersUpdateNeeded(TimeMs lastUpdate, TimeMs now) const {
constexpr auto kStickersUpdateTimeout = TimeMs(3600'000);
bool stickersUpdateNeeded(crl::time lastUpdate, crl::time now) const {
constexpr auto kStickersUpdateTimeout = crl::time(3600'000);
return (lastUpdate == 0)
|| (now >= lastUpdate + kStickersUpdateTimeout);
}
@@ -648,7 +648,7 @@ private:
const NotifySettings &defaultNotifySettings(
not_null<const PeerData*> peer) const;
void unmuteByFinished();
void unmuteByFinishedDelayed(TimeMs delay);
void unmuteByFinishedDelayed(crl::time delay);
void updateNotifySettingsLocal(not_null<PeerData*> peer);
template <typename Method>
@@ -661,7 +661,7 @@ private:
const MTPMessageMedia &media,
TimeId date);
void step_typings(TimeMs ms, bool timer);
void step_typings(crl::time ms, bool timer);
void setWallpapers(const QVector<MTPWallPaper> &data, int32 hash);
@@ -701,11 +701,11 @@ private:
rpl::event_stream<> _stickersUpdated;
rpl::event_stream<> _savedGifsUpdated;
TimeMs _lastStickersUpdate = 0;
TimeMs _lastRecentStickersUpdate = 0;
TimeMs _lastFavedStickersUpdate = 0;
TimeMs _lastFeaturedStickersUpdate = 0;
TimeMs _lastSavedGifsUpdate = 0;
crl::time _lastStickersUpdate = 0;
crl::time _lastRecentStickersUpdate = 0;
crl::time _lastFavedStickersUpdate = 0;
crl::time _lastFeaturedStickersUpdate = 0;
crl::time _lastSavedGifsUpdate = 0;
rpl::variable<int> _featuredStickerSetsUnreadCount = 0;
Stickers::Sets _stickerSets;
Stickers::Order _stickerSetsOrder;
@@ -722,7 +722,7 @@ private:
std::vector<FullMsgId> _selfDestructItems;
// When typing in this history started.
base::flat_map<not_null<History*>, TimeMs> _sendActions;
base::flat_map<not_null<History*>, crl::time> _sendActions;
BasicAnimation _a_sendActions;
std::unordered_map<