Commit Graph

25 Commits

Author SHA1 Message Date
Tim Abbott 7fa3bdba72 Convert /json/update_active_status to use channel.js.
(imported from commit 75c7a1c9701b4ff0db8e52c31126d778054b6c29)
2014-01-10 21:39:00 -05:00
Steve Howell f174038100 Throttle user list updates to 5s intervals.
(imported from commit 908806d1ac00f14802f2a01a40d0abb66778a441)
2013-12-17 11:54:53 -05:00
Steve Howell 1c67fdb95d Move user list unread-count logic to templates.
When we rebuild the user list from scratch, set the unread
counts in the templates to avoid multiple DOM updates.

(imported from commit 2d0c9b0fb99b382332e464ba7c3caad95e05363e)
2013-12-17 10:59:25 -05:00
Zev Benjamin 6f0477f491 Increase number of names shown in group PM list from 2 to 3
(imported from commit eff308fb1405290488f74d9064fd859d33c99558)
2013-12-06 17:54:05 -05:00
Steve Howell 80ec6ff8bc Remove transitional show_huddles flag.
(imported from commit 37f6cdb4f62076faa1e977ec9b0a53cc461f0d11)
2013-12-03 10:45:01 -05:00
Waseem Daher aeaac45fd0 Hide right-sidebar user/group PM list from MIT.
(imported from commit 2e3ba1ffd3a33450580a164c0aa1ced23eee37c2)
2013-11-30 18:31:05 -05:00
Steve Howell 62089aeff6 Make sure unread counts stick for huddles.
Every time we re-render the huddles section, we need to
update the unread count.  We do this is in very similar
fashion to how we update individual users.

(imported from commit 2419365bc602ddaebc609090e119c0dcfad35bb7)
2013-11-08 12:11:28 -05:00
Steve Howell 52ec258122 [staging only] Show Recent Group PMs in right sidebar.
Show up to 10 of your recent group PM conversations in the right
sidebar.  Clicking on the links narrows to the huddle and opens the
compose box for the huddle.  The green circles have opacity
proportional to the number of users present in the huddle.

This is feature flagged to staging only.

Some of this code was written by Allen before commits were squashed.

Known issue: unread counts disappear on certain refresh events.

(imported from commit 3b44665150ba20594d8b0295cb30df03601c1d52)
2013-11-07 16:54:13 -05:00
Steve Howell 7bde1f7716 Add activity.short_huddle_name().
(imported from commit e3f0389298631fd06169dbc9559691470ac19d00)
2013-11-07 16:54:13 -05:00
Steve Howell 9adcba1e6d Add activity.huddle_fraction_present().
Add a method that lets us know what percentage of a huddle is
present.  (We can use this later to set the opacity of huddles
in the UI.)

(imported from commit 8a2383951807d7bfbf9d730a8980d977cf23b379)
2013-11-07 16:54:13 -05:00
Steve Howell 4fb4e04501 Add activity.full_huddle_name().
(imported from commit 304e47ac88d7497fcde49f448912a2e063dd0bd1)
2013-11-05 15:34:29 -05:00
Steve Howell 6d511486cb Add activity.process_loaded_messages() and get_huddles().
Activity.js now has the capability to track huddles that
come through in loaded messages and return them in reverse
chronological order by their most recent message.  Right
now this only connected to a unit test, not any production
code.

(imported from commit 59957086fa2e454e5711472df091f178217aed2b)
2013-11-05 15:34:28 -05:00
Steve Howell a4ff7320fb Remove unused presence_description "away" entry.
(imported from commit 46f377399335ca9757ee52ecd21d6679b52635ed)
2013-11-05 15:34:28 -05:00
Steve Howell 617b0a95d2 Short circuit MIT case earlier in update_users().
This can be squashed with the prior commit, which inlined this
MIT check into update_users() while trying to avoid other
complications.  After inlining the code, it's clear that we
don't need to call the sort_users() line of code for MIT users,
so I moved the MIT guard condition up.

(imported from commit fa5b52e14964ad595b34d40ce6c8450ea93726c5)
2013-11-05 15:34:27 -05:00
Steve Howell 7f3115fa53 Move set_presence_list from ui.js to activity.js.
Since ui.set_presence_list is only called from activity.js, I am
inlining the code into activity.update_users().  This also allows
us to move ui.presence_descriptions into activity.js, which
is the right home for presence-related things.

(imported from commit 0ff239275c544a86c14d517bc386d06726b81cd9)
2013-11-05 15:34:27 -05:00
Steve Howell 82fd0f2b52 Rename user_info -> presence_info inside activity.js.
The user_info var was mapping users to presence information, and
presence_info is a better name for it.  This change is partly tactical,
as it sets us up to inline ui.set_presence_list, which receives
user_list as presence_list and then has a completely different
variable called user_info.

By doing this pre-factoring, the next commit becomes just a pure
code move without more moving parts of renaming variables.

(imported from commit 4b015d19886b43d24905124eb37cd9dd317aa87b)
2013-11-05 15:34:26 -05:00
Steve Howell e83c026a27 Set focus-related flags correctly after a server reload
(imported from commit 408469c0da0cfa5513e6838329816cd88665981f)
2013-09-16 12:29:34 -04:00
Tim Abbott 9fcca3df4e [schema] Collect data on when users are active on site.
These engagement data will be useful both for making pretty graphs of
how addicted our users are as well as for allowing us to check whether
a new deployment is actually using the product or not.

This measures "number of minutes during which each user had checked
the app within the previous 15 minutes".  It should correctly not
count server-initiated reloads.

It's possible that we should use something less aggressive than
mousemove; I'm a little torn on that because you really can check the
app for new messages without doing anything active.

This is somewhat tested but there are a few outstanding issues:

* Mobile apps don't report these data.  It should be as easy as having
  them send in update_active_status queries with new_user_input=true.

* The semantics of this should be better documented (e.g. the
  management script should print out the spec above)x.

(imported from commit ec8b2dc96b180e1951df00490707ae916887178e)
2013-09-10 13:25:59 -04:00
Luke Faraone a305a7de63 Up offline threshold to 140sec and decrease ping interval to 50sec.
This is intended to help us debug what's going on with presence information.

(imported from commit 637ccea594ae51bc7b266620596180479ee754f0)
2013-08-21 14:45:01 -07:00
Luke Faraone a1a5d00e9f Update your presence dot when your activity changes.
(imported from commit ecdc056db987d4404ded01092f5693ac8dd28ae9)
2013-08-21 11:10:31 -04:00
Luke Faraone f17d030272 Send IDLE continuously when idle, interpret a too-old status as offline.
This helps make our statuses more meaningful and should resolve trac #1534.

As part of this, we lower OFFLINE_THRESHOLD_SECS to 1.1̅6 minutes and
mark the user as idle after 5 minutes.

(imported from commit ee6b1ad203554a84b11e16c4c6195be9df5bcf4f)
2013-08-21 11:07:45 -04:00
Zev Benjamin ec9322fc87 Use Dict everywhere we have keys based on potentially dangerous, user-supplied data
There are also one or two places we don't need to use it for security
purposes, but we do so for consistencey.

(imported from commit aa111f5a22a0e8597ec3cf8504adae66d5fb6768)
2013-08-09 17:35:14 -04:00
Steve Howell 6790ed79cc Add a unit test for activity.js.
This includes slightly invasive, but harmless, changes to
the production code.

(imported from commit ff40af504de2360ada866508da262e0d2e9f7ad9)
2013-08-09 13:11:59 -04:00
Scott Feeney 8703134a23 Replace $.each with _.each
In a few cases the $.each was doing something imperatively that was
terser and easier to understand by using a different Underscore method,
so a few of these I rewrote.

Some code was using the fact that jQuery sets `this` in the callback to
be the item; I rewrote those to use an explicit parameter.

Some code was using $(some selector).each(callback). I converted these
to _.each($(some selector), callback).

One function, ui.process_condensing, was written to be a jQuery $.each
callback despite being in a totally different module from code using it.
I noticed this and updated the function's args.

(imported from commit bf5922a35f257c168cc09ec1d077415d6ef19a03)
2013-07-30 12:12:58 -04:00
Tim Abbott 3bba0cc927 Move zephyr/static to just static.
It's not really a part of the server (aka the rest of zephyr/).

(imported from commit 27f6b6b064938ad927075a68d873e4b68710d279)
2013-07-29 12:11:26 -04:00