| 313 | } |
| 314 | |
| 315 | DateText ResolveDateText( |
| 316 | DateTextCache &cache, |
| 317 | TimeId date, |
| 318 | crl::time now) { |
| 319 | static crl::time LastNow = 0; |
| 320 | static int LastTodaySerial = 0; |
| 321 | if (!now || LastNow != now) { |
| 322 | LastNow = now; |
| 323 | LastTodaySerial = int(QDate::currentDate().toJulianDay()); |
| 324 | } |
| 325 | if (cache.messageTimeId != date |
| 326 | || cache.todaySerial != LastTodaySerial) { |
| 327 | const auto qdt = base::unixtime::parse(date); |
| 328 | cache.text = Ui::FormatDialogsDate(qdt, GetEnhancedBool("show_seconds")); |
| 329 | cache.width = st::dialogsDateFont->width(cache.text); |
| 330 | cache.messageTimeId = date; |
| 331 | cache.todaySerial = LastTodaySerial; |
| 332 | } |
| 333 | return { cache.text, cache.width }; |
| 334 | } |
| 335 | |
| 336 | DateText Entry::chatListTimestampText( |
| 337 | TimeId date, |
no test coverage detected