Commit Graph

1056 Commits

Author SHA1 Message Date
Zev Benjamin 8a39292b5d Fix bouncy pointer from pointer updates
The previous code path was buggy.  We now do separate pointer update
checking for the cases where get_updates returns immediately vs. when
it returns from a callback.

(imported from commit f236a80cd0b94bc097dbd17f113d7a9d27368025)
2012-10-23 16:39:04 -04:00
Zev Benjamin 5ee6982a7e Use a different format function when we don't respond to a get_updates immediately
For now, the new function, format_delayed_updates_response, just
calls format_updates_response.

(imported from commit dd332125fe0d47cb3990373f74e85e64604f58a3)
2012-10-23 16:39:04 -04:00
Zev Benjamin c8dd5229ed Rename updater_session to pointer_updater
(imported from commit 7646b8e636393d64ef07d0251f8c83beecf114aa)
2012-10-23 16:39:04 -04:00
Zev Benjamin 6c4b56517f Revert "Temporarily disable pointer sync"
This reverts commit 7d8f673559ca6359923aa0bdd48edebe0955e921.

(imported from commit 32f7ad925cc4df72220a191602487620a9970f43)
2012-10-23 16:39:04 -04:00
Keegan McAllister e7746e97e8 select_message: Fall back to the last, not first, message
This seems more likely to be what people want when e.g. viewing all huddles.
Later we can get more clever and select the nearest huddle, or something.

(imported from commit 8ec1aa02c050dd25eb868b1e317d114743525c7b)
2012-10-23 16:31:05 -04:00
Keegan McAllister 37ac9d2a91 select_message: Misc cleanup
We can safely call .is(':hidden') on an empty jQuery result and get false.

(imported from commit a73932f63b8fec7c43d8603fca95adcd4f164317)
2012-10-23 16:28:40 -04:00
Keegan McAllister d34bebc584 select_message: Properly fall back to the first visible message
Our old selector here was picking up the floating recipient label, or
something.  This was breaking narrow-to-all-huddles when on a stream message --
you get no selection and the code is sad.

(imported from commit d25fab03bd6d745df6d787c0b1b6452c8c539e32)
2012-10-23 16:28:40 -04:00
Keegan McAllister b049749cb2 New hotkeys for narrowing
- s for stream or huddle
  - S for subject
  - p for all personals (still buggy)

We've eliminated the 'g' prefix entirely.  And the old 'g-a' un-narrow sequence
has no new equivalent, but you can still use Esc.

(imported from commit 6bdaacce9639e3f749418e06622a317937e7d014)
2012-10-23 15:28:07 -04:00
Zev Benjamin ce3ea9f019 Temporarily disable pointer sync
(imported from commit 74e6bb347e0b8c01b6450914a50448b78b9749c9)
2012-10-23 15:24:00 -04:00
Waseem Daher f69bd6ad4b Fixup display of huddle messages.
(imported from commit 981fc7998c695b8e6a75d7b00da0a63e0cc4164a)
2012-10-23 13:55:34 -04:00
Waseem Daher cd62827158 Fix issue with border on huddle messages.
(imported from commit 6a671dee15bb407207d34f7495987cbcd012d9a0)
2012-10-23 13:31:52 -04:00
Keegan McAllister 86159813df Hide the "Load older messages" button in narrowed view
Ideally this would be part of hiding zhome, but right now zhome/zfilt are
assumed to the tables themselves, and changing that seems unfortunately
invasive.  And it's not crazy to think of the "loading controls" as a logically
separate thing that we might show/hide independently.

Longer term, we may want an indication in narrowed view that there could be
more messages on the server.

(imported from commit eb72d720da7c03f6f1378ae18ab6e973bf98247f)
2012-10-23 13:28:08 -04:00
Luke Faraone a139f8b6b2 Fix incorrect references to userprofile in the API
(imported from commit 77c062b54c545185aee28189726f61a874a1fe77)
2012-10-23 12:05:56 -04:00
Zev Benjamin fca4cade34 Ignore long-poll successes with no data
The server will occationally return successfully with no data during
a restart.  Previously, when we would get such responses, the page
would stop working because of JS errors.

(imported from commit 39b89907dc5ae9a9eb54ebf60d0069281e401786)
2012-10-23 12:03:56 -04:00
Tim Abbott 9779ca9e5c Shorten get_updates timeout to under a minute.
(imported from commit fcc87011051c25051861e3c36e442398cd3ca3c0)
2012-10-23 11:31:32 -04:00
Tim Abbott 386b48e80f Don't log tabbott/extra test messages.
(imported from commit 8e1adecca14e5440298fd93b41e1a43da37c807f)
2012-10-23 11:08:27 -04:00
Tim Abbott fdeab96b4c Add a default client name for the API.
(imported from commit a14b2f8bd9ff604c5f522c85842d296be38d33e6)
2012-10-23 10:54:36 -04:00
Zev Benjamin ed05e28e55 Update server when selected message changes via scrolling
(imported from commit a763baf064e73d358632f3754aba940d188f733d)
2012-10-23 10:30:59 -04:00
Tim Abbott a9667d81a8 Fix performance regression caused by last commit.
(imported from commit f0abf93dbab92c5627903284fafad310de039fe6)
2012-10-22 22:01:55 -04:00
Tim Abbott 8c16295301 populate_db: Fix replaying personal messages from logs.
(imported from commit 685a426fe59fa240c8ae5cf357a43d4df0a3f05d)
2012-10-22 21:36:32 -04:00
Tim Abbott 846469c39c [schema]: Rename userprofile to user_profile.
(imported from commit adfb6152b7ec32557e3465d961695eb870506d5a)
2012-10-22 18:55:45 -04:00
Keegan McAllister cec9649b0d Brighten the hover color for huddle recipients bar
The Bootstrap default color is too dark against a black background.

(imported from commit 2a0b320564d004ddc606856d004864ba21763a94)
2012-10-22 18:34:12 -04:00
Tim Abbott 93616039bc Use the new client data model to deduplicate mirroring.
(imported from commit 6ac38534aea11b1e7f8f332e76251f9501f9ab3e)
2012-10-22 18:31:36 -04:00
Zev Benjamin 899d5c776f Check reason_empty on client when there are no new messages
This fixes a problem where the client would never stop asking for old
messages (bug introduced during rebase)

(imported from commit eef9f19e1e9982b1e0a954eb36a81e1b7ee5b564)
2012-10-22 18:19:14 -04:00
Tim Abbott 1b1d5cb577 Fix all mirrored stream messages appearing to be from me.
(imported from commit 777f98a564d3f169d3c69fcda980ce5993910d88)
2012-10-22 17:59:21 -04:00
Keegan McAllister 4ca720a0cd bugdown: Install autolink pattern after link pattern
This fixes explicit links.

(imported from commit 6867d271344d35c2c8d54b3393219113a095bc4f)
2012-10-22 17:48:48 -04:00
Tim Abbott 2b1902dcc7 Return a user_profile from create_user_if_needed.
(imported from commit d71a9b1f326f783e387bb70b5215c934799fb5f2)
2012-10-22 17:47:05 -04:00
Keegan McAllister 05c08b41c4 bugdown: Disallow ()[]{}<> in linkified URLs.
This allows us to handle messages like

    my website (available at http://google.com)

(imported from commit 51330507947fc039b6f29f06dfa1c6d21f779aa4)
2012-10-22 17:32:39 -04:00
Keegan McAllister 1c4bbd6a49 bugdown: Start a URL with a word boundary, not a space
This fixes the bug where we were eating the preceding space.

(imported from commit 9eca01e6ad828ccc31ad10693339f381333e76a7)
2012-10-22 17:32:39 -04:00
Zev Benjamin 0f474285bf Up idle timeout for reload
(imported from commit 7d9c7dbd77f49865d7e1922ddcee08cd963f4abf)
2012-10-22 17:30:26 -04:00
Tim Abbott bce793005d Fix mirroring of personals.
(imported from commit 91ae9e6bb20389a708bd6b1945c898b98b96ee4a)
2012-10-22 17:21:07 -04:00
Zev Benjamin f817bf6144 Pass the session that updated the pointer from Django to Tornado
This allows us to check whether the session that updated the pointer
is the same as a session that is doing a long poll to avoid sending
new pointer information when that information is coming from the same
session.

We still return from the long poll early, though, which is sub-optimal.

(imported from commit 7d4be0956f112eacefb7d198ea929957cd2b05e3)
2012-10-22 17:16:47 -04:00
Tim Abbott d17db6687c Improve validation of zephyr mirror data.
(imported from commit 9ebc43d17d1f4040da2deff271ba7e158908a29b)
2012-10-22 17:08:09 -04:00
Zev Benjamin 732ca19729 Synchronize the pointer across sessions
The client may now optionally send its current pointer during
get_updates and the server will return the latest pointer if it
differs and was updated more recently by a different session.

(imported from commit e43b377d7dfb52f83cefb0b1003863d5407caf80)
2012-10-22 16:44:57 -04:00
Zev Benjamin 7e4b7fb881 Add message selection option to not update the server
(imported from commit a5ef9506be24fee7652cd5479cb74789aa365216)
2012-10-22 16:06:38 -04:00
Zev Benjamin bb64eb717f Make select_message and friends take an options argument
The select_and_show_by_id function is now subsumed by select_message_by_id.

(imported from commit 3dbe9cf9d253b64733f269b6dc78c144100927ca)
2012-10-22 16:06:38 -04:00
Zev Benjamin 35bb3613cd Rate limit pointer updates to avoid hammering the server
(imported from commit e1add1b64779f3d0caf5426eb99233e78de278ae)
2012-10-22 16:06:38 -04:00
Zev Benjamin 66d7678423 Add UserProfile callback for pointer updates
(imported from commit bfa9c15d82f092a1810cfcee1a88e1e292bc4cb8)
2012-10-22 16:06:38 -04:00
Zev Benjamin 2a4c3b5bff Abstract the callbacks table in preparation for more kinds of callbacks
(imported from commit 695d5bceb4657ef25ba5983212082ee0c76b9d33)
2012-10-22 16:06:38 -04:00
Zev Benjamin 7ac0625e39 Add model field indicating which session most recently modified the pointer
(imported from commit 819ab358d9fa6f22ad8ccee56fe723ea7711ebc5)
2012-10-22 16:06:38 -04:00
Keegan McAllister fcc21bec21 5xx: Reformat text
(imported from commit eaafd17560714729b23df8947a94ebd1815cec23)
2012-10-22 15:22:49 -04:00
Keegan McAllister ba85e3babf Add a static 5xx error page, for nginx
(imported from commit e0ca9ba4e88f4825954c3b70c7b1acadb5b37779)
2012-10-22 15:16:04 -04:00
Tim Abbott b353fd4abd Use sending_client to check whether messages are mirrored.
(imported from commit 6202739e21dfb308ed551656a8a0cdf7311972f7)
2012-10-22 14:52:08 -04:00
Tim Abbott a695732bda Seed the populate_db random number generator.
This makes it not to produce 10 copies of each message.

(imported from commit 35ab5f14ec104b4ea52137dac4fa2840194f3777)
2012-10-22 13:59:46 -04:00
Tim Abbott f26a614bb3 Fix Client handling in the test suite.
(imported from commit 56841a00052c3aa85f2eeb45133439a46f3caf82)
2012-10-22 13:23:16 -04:00
Keegan McAllister 7cf8f842f7 Allow in stream names any character classified by Unicode as alphanumeric
Also correct a comment.

(imported from commit 5c03032b90dbaf38d880651004733e4399b422ee)
2012-10-22 12:58:39 -04:00
Keegan McAllister 189d42428a bugdown: Log Markdown parser failures
(imported from commit 9e225a32b71edbfd9007cc2fbae32be31896233d)
2012-10-21 23:07:03 -04:00
Keegan McAllister 4a0cf8e608 bugdown: Disable builtin 'autolink' feature
This only linkifies inside angle brackets, per

    print md.inlinePatterns['autolink'].getCompiledRegExp().pattern

We have our own linkification extension.

(imported from commit 20cab11aaafee075e0caf933d8d197717976988c)
2012-10-21 21:03:18 -04:00
Keegan McAllister 00a4da5f9b bugdown: Disable automatic mailto links for <foo@bar>
This feature was throwing exceptions on input like

    <@`x`>

Reported upstream as https://github.com/waylan/Python-Markdown/issues/155

(imported from commit 6b14a65599def0346f76cf017be66dd80f42db49)
2012-10-21 21:03:18 -04:00
Keegan McAllister 4db8587805 bugdown: Decrease code duplication
(imported from commit 40158134b60e477d8a353d050fa62c9ded0e9e9f)
2012-10-21 21:03:18 -04:00