Commit Graph

17 Commits

Author SHA1 Message Date
Scott Feeney 4313f2ff1e Set initial user presences in O(n), not O(n²) time
Previous code iteratively called set_user_status() once for each user;
which in turn was rerendering the user sidebar, also once for each user.

I changed the API a bit by replacing activity.set_user_status() with
activity.set_user_statuses(), plural, that takes an object and updates
all the user statuses in one go before rendering.

(imported from commit 1111c9029264f892f25e76d2e5e5ff996dcbc7ca)
2013-07-11 16:48:29 -04:00
Tim Abbott a0bdefb71d Fix 'undefined is not an object' traceback with update_active_status.
This seems to only happen with Firefox for some reason.  We've had
similar issues with other ajax endpoints, so this is probably not the
long-term solution, but I'd like to get this traceback fixed now.

(imported from commit aa552fb56882ae2c73e352c7baf9532a88c5cf0a)
2013-06-12 16:21:10 -04:00
Zev Benjamin 96129b1cf0 Speed up string comparison for sorting
The String.localeCompare function is really slow, at least partially
because it creates a locale-aware collator object each time.  So now,
when we can, we create and cache a locale-aware collator object.
However, this is not supported on most browsers, so we fall back to a
non-locale-aware comparison.  This is not ideal, but for now we are
mostly working with English-speaking customers.

(imported from commit 51aa02e3b9fe4a0ef0cb084874fe26e91c57f65e)
2013-05-07 11:47:12 -04:00
Leo Franchi 0da2f51ddb Calculate presence information with delta between server timestamp
(imported from commit b4b367ed620878e6d01287cb1aaae0730c7475c8)
2013-05-06 13:52:23 -04:00
Leo Franchi 302cfcd48c Send client information for initial presence and process time differential
(imported from commit 99a51b7cc8b6c51c4e82757a984d07603b2980e3)
2013-04-12 09:11:40 -04:00
Leo Franchi 5d4b2305fe Send presence updates when a new user logs in for the first time, and when returning from inactive
This commit will incorrectly list past-online users as active, a shortcoming that is
addressed in the next commit

(imported from commit b018767df686f88c0ca939c067c573e4d7cea357)
2013-04-12 09:11:40 -04:00
Keegan McAllister 6d9aca5f1a Move "page parameters" (email, enter_sends, etc) into a single object
(imported from commit 842b2371bf6364982f1358f1cd2d91118c7fb2bf)
2013-03-26 13:50:03 -04:00
Tim Abbott 99d4bc114b Move Zephyr mirroring liveness check to the UserPresence queries.
It's closer to a presence query than an update, and more importantly
this moves this out of Tornado -- previously Tornado was spending at
least 3ms per recipient on messages sent to the MIT realm fetching all
this data to return back to users.  This should save around 100ms per
message sent to a popular stream the MIT realm -- but more
importantly, each such event is 100ms during which Tornado is not
processing other messages.

(imported from commit 134169f0fdcd9f6640fda957edc4a28b07783d8e)
2013-03-13 17:41:29 -04:00
Waseem Daher e662db9c68 Increase the time we mark you as green or yellow.
One of Matt Goldstein's comments is that we often make you look
like you're not at your computer, even when you are, just because
you haven't checked Humbug for a while.

While it's important to have this be accurate, right now I think
we err on the side of showing you as not present. So I increased
some of the timeouts in an attempt to fix that.

(imported from commit 9fd8f432e6684ec1b33d1d932f37caa99c627959)
2013-03-05 11:26:55 -05:00
Keegan McAllister cb45d88cea Get rid of constants activity.user_{active,away,idle}
We don't typically have these (see message type, etc.) and removing
them will allow simplifying the code.

(imported from commit fbefb08ee9b08c73f32c8150a6fa1060957aa8ad)
2013-02-19 18:27:36 -05:00
Leo Franchi a1234afc4b Make sure we have a full name for a user before accessing it
(imported from commit 20165ada3f04edd714e5d2e8ee31a388a1ff00de)
2013-02-15 15:56:14 -05:00
Leo Franchi ddef0c3b28 Sort user list by name not email
(imported from commit cc13d1c65625727a923616e402e4c9fd2b5afbb4)
2013-02-13 23:03:18 -05:00
Waseem Daher 0f798c7783 Add an orange dot "away" status for presence information.
(imported from commit 7adaff6bee4e3ba3164d2d47b32da28e136c56af)
2013-02-12 17:34:57 -05:00
Leo Franchi 7e09166f45 Remove sort by PM status in activity list
Now the sorting is done by activity status, then alphabetical.

(imported from commit 202df275f7502eb1c97d6f04880e67392f5cde0d)
2013-02-12 14:41:24 -05:00
Leo Franchi 495f7835c8 Make linter happy.
(imported from commit 0c30f2ef176249cd1a06a21946e51a20d6ca7a32)
2013-02-12 10:40:21 -05:00
Leo Franchi b30e277f5a One minute interval for keep-alive pings
(imported from commit f41ffc853c42e75a2e2cb365b73cceac44b7d723)
2013-02-12 10:22:11 -05:00
Leo Franchi 83011f7f47 Show a user activity list in the sidebar
(imported from commit 95aaa55c7e4cc39f844518b5308866bedf2cd1c5)
2013-02-11 18:05:57 -05:00