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

links preview done

This commit is contained in:
John Preston
2015-04-04 23:01:34 +03:00
parent 868d5f60f3
commit f3bb155b0a
67 changed files with 2712 additions and 1416 deletions

View File

@@ -183,6 +183,22 @@ DeclareSetting(RecentHashtagPack, RecentSearchHashtags);
DeclareSetting(bool, PasswordRecovered);
DeclareSetting(int32, PasscodeBadTries);
DeclareSetting(uint64, PasscodeLastTry);
inline bool passcodeCanTry() {
if (cPasscodeBadTries() < 3) return true;
uint64 dt = getms(true) - cPasscodeLastTry();
switch (cPasscodeBadTries()) {
case 3: return dt >= 5000;
case 4: return dt >= 10000;
case 5: return dt >= 15000;
case 6: return dt >= 20000;
case 7: return dt >= 25000;
}
return dt >= 30000;
}
inline void incrementRecentHashtag(RecentHashtagPack &recent, const QString &tag) {
RecentHashtagPack::iterator i = recent.begin(), e = recent.end();
for (; i != e; ++i) {