Commit Graph

5 Commits

Author SHA1 Message Date
Steve Howell 03386f1485 avatar live updates: Do full re-render.
We now sweep all active messages for avatar changes and update
the message items and re-render, rather than patching the
DOM.  This avoids some quirks that happen when subsequent messages
get sent and we re-render previous messages out of the message
store.

Our approach here is similar to how we do full-name updates.
2017-02-22 22:46:44 -08:00
Steve Howell 3e3444848d Remove avatar timestamp logic in the client.
We use to have client-side logic that would append timestamps
or random numbers to avatar URLs to force browsers to
refresh their cache.

We no longer need this now that the back end maintains
versions for avatar changes and puts the version in the URLs.
2017-02-17 10:19:56 -08:00
Steve Howell 97243dcd52 Live update full names for senders in the message pane.
Note that this only works for people who are currently logged in.
Folks that log in after you may pick up the old full name from
the message.  (I'll address this in a separate commit.)
2017-01-30 11:49:19 -08:00
Steve Howell 0fc2f18c1d bug fix: Fix already-rendered messages for avatar updates.
Most of the magic happens in message_live_update.update_avatar().

The prior code was buggy, as it was using person.id instead of
person.user_id, and it was not setting the image resolution.
2017-01-21 21:45:12 -08:00
Steve Howell 90fa797f9b Use stream id to live-update messages for name changes.
When we change a stream name, we now use the stream id as the
key to find messages we need to live update.  This eliminates
some possible race conditions from two users renaming a stream.

This commit introduces message_live_update.js.

The new call stack is this:

    subs.update_subscription_properties
    subs.update_stream_name
    message_live_update.update_stream_name
    message_list.update_stream_name
2017-01-05 15:32:45 -08:00