Commit Graph

8 Commits

Author SHA1 Message Date
Anders Kaseorg 44767dd653 tippyjs: Avoid unsafe allowHTML API in favor of <template> elements.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-03-03 10:13:24 -08:00
Anders Kaseorg d22fca7a78 timerender: Fix object-shorthand ESLint error.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-03-01 14:37:48 -08:00
Anders Kaseorg e090027adc CVE-2022-23656: Fix cross-site scripting vulnerability in tooltips.
An attacker could maliciously craft a full name for their account and
send messages to a topic with several participants; a victim who then
opens an overflow tooltip including this full name on the recent
topics page could trigger execution of JavaScript code controlled by
the attacker.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-03-01 14:26:42 -08:00
Aman Agrawal 27b985e868 recent_topics: Standardize format of last message time.
We follow how other apps present older messages, e.g. Gmail,
Facebook Messenger, etc. display it.

Specifically, the logic we use is:

If the time is <24hr ago, show an absolute time, like "21:30" (or "9:30pm").
Otherwise, show what day it was, and not a time
  If the day was yesterday, say "Yesterday".
  Otherwise, if it was <7 days ago, say the day of week, like "Friday".
  Otherwise, if it was <1 year ago, say the month and day, like "Sep 6".
  Otherwise, say the year, month, and day, like "Sep 9, 2020".

With some tweaks from Tim Abbott to better handle the future case.

Fixes #19775
2022-02-25 16:33:47 -08:00
Anders Kaseorg 21cd1c10b3 docs: Add missing space in “time zone”.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-02-24 14:05:12 -08:00
Anders Kaseorg f7a7cfea62 js: Fix @typescript-eslint/restrict-plus-operands.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-09-22 18:06:06 -07:00
Anders Kaseorg af1e34b348 timerender: Use date-fns for absolute_time.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-09-22 18:06:06 -07:00
Priyank Patel 0d91472c64 ts: Convert timerender module to TypeScript. 2021-09-15 17:19:39 -07:00