qq99/echoplexus

Proper time ago with smart updating

qq99 opened this issue · 2 comments

qq99 commented

For the most part, the timestamps on chat messages work pretty well. You don't really notice they're broken until you look at how they're implemented.

However, if you left the window open for a long time, you'd notice that the latest message always display "a few minutes ago" (< this does not seem to be the case!)

Similarly, if you left the window open for a very long time, spanning days, you'd see "22:48:49" but it should really say, "2 days ago"

When you refresh, it gets redrawn properly.

There's gotta be a good way to be smart about redrawing the timestamps without wasting CPU:

  1. channel is in focus
  2. window has become focused
  3. attempt to redraw timestamps
  4. place a lock on redrawing timestamps for some sensible period OR only redraw those of messages that occurred today on a schedule?
qq99 commented

A good example of a long running client:
screen shot 2014-02-19 at 6 01 52 pm

I tried to be smart about updating the timeago properly, but apparently, not smart enough!

qq99 commented

Fixed in pgp branch