Commit Graph

5577 Commits

Author SHA1 Message Date
Tim Abbott 802b3dc3b2 Add API endpoint to render some message content without sending a message.
(imported from commit e1604b3bf4fc65e958db22f280eba1b5d2ba1e90)
2013-08-01 14:01:58 -04:00
Tim Abbott 365db42a6e Return a proper JSON error on HTTP authorization errors.
(imported from commit da0249b4e8585d8adbd9c769e3ba85dc4b9d28de)
2013-08-01 14:01:58 -04:00
Tim Abbott 9c60ecb479 Escape @ when mirroring content back to Zephyr.
(imported from commit 0ab58b5e8a30c66fb6aeaccaebbe498092de1cd5)
2013-08-01 14:01:58 -04:00
Waseem Daher 0663c7243c Enable always-open-compose for MIT, CUSTOMER4, Zulip.
(imported from commit 43602ebeed5396de038c59240a9d695ec411db89)
2013-08-01 13:00:15 -04:00
Waseem Daher 86cf40c8a9 Move feature_flags into its own file.
(imported from commit b775f85a24422d236b0079810b98b6b984cb60a2)
2013-08-01 13:00:15 -04:00
Tim Abbott f792adfa6a Disallow single-statement if statements without a brace.
(imported from commit e52f90a0f3e7340a764d391b1f38f1820e953ae7)
2013-08-01 11:47:54 -04:00
Tim Abbott 5a320db3c1 Add curly braces for all javascript if statements lacking them.
(imported from commit 32c7643d1a6ecdfaf634424d217938c8a368dade)
2013-08-01 11:47:54 -04:00
Kevin Mehall 112d37de86 Fade message dots faster when marked read by cursor.
(imported from commit a31b0601bf13bce377c24fff96a818023d5bdd1f)
2013-08-01 11:26:55 -04:00
Kevin Mehall 0cbee97ffd Change mark-as-read behavior.
Mark messages as read when with the pointer, but mark all messages
read if the last message is visible.

(imported from commit 4c1a928bd6966111f0f34c5207723656b5f193b9)
2013-08-01 11:26:55 -04:00
Kevin Mehall 0e0ed886e1 Add feature_flags mechanism to enable experiments.
In the future, this could come from the server to enable individual
experiments on a per-realm basis.

(imported from commit 8fd1ba1910b3cfd131f58bab8efbd11a42053bc3)
2013-08-01 11:26:55 -04:00
Zev Benjamin 39a44cc661 Fix migration 36
It was not regenerated after being rebased.

(imported from commit b4555b05813201943f5991552dd4a0d53f7ae005)
2013-08-01 11:26:33 -04:00
Steve Howell 0ed73df475 Rename some functions related to bot avatars.
(imported from commit 6f88ee71dda263bfe7b5c15baed02aaf00d35f15)
2013-08-01 11:05:40 -04:00
Steve Howell f7ca0117e6 Allow users to upload new avatars for their bots.
(imported from commit 9d7895a658740815f454c8bba400d7cff821b7f9)
2013-08-01 11:05:40 -04:00
Steve Howell d0060f24ed Add close() method to avatar objects.
The close() method will let you release handlers, as well as
doing everything clear() does.

(imported from commit 3a67c3f2226918cee10cf43598e0408fb186408a)
2013-08-01 11:05:40 -04:00
Steve Howell d505d494c8 avatar.set_up_file_input returns object now
The set_up_file_input() function now returns an object to the user
with a clear field.  This object will grow soon.

(imported from commit 7b3761eafddb392bd2c84a1685aa8d1811028a0f)
2013-08-01 11:05:39 -04:00
Steve Howell 784cab9df2 Use jQuery on() consistently in avatar.js.
(imported from commit c14105dbaa174ef9aec4fc11a12a44f25e74a246)
2013-08-01 11:05:39 -04:00
Steve Howell ab23c534b9 Use POST, not PATCH, for patching bots.
This is a temporary expedient measure to work around our
PATCH not supporting file uploads in our current Django setup.

(imported from commit c3146b23d5d7d134c2b80507eb87033ca375a4db)
2013-08-01 11:05:39 -04:00
Tim Abbott 7803cadd66 Prevent realm_filters from breaking apart Markdown links.
E.g. if the Zulip realm, if you ever put "#15" in a Markdown link, you
surely don't want it to be auto-replaced with a Trac link.

(imported from commit 2e117a7bbbd9c82f8c0ba4d390472770f4425589)
2013-08-01 10:48:11 -04:00
Scott Feeney 0d53253f7b Darken the left border on blockquotes
This is a compromise between the old color when selected and when not
selected. It makes the border a little easier to see while still being
subtle.

(imported from commit 7177d8f688af3de15f3e309d6a9c7c248acb1db4)
2013-08-01 10:18:41 -04:00
Scott Feeney 315d27076b Don't change code bg & quote border when selected
Since we no longer change the selected message's background color, it
doesn't make sense for these other colors to still change when the
message is selected.

(imported from commit a7c387e7d390b7f2973dc6bd3168651d88880139)
2013-08-01 10:18:41 -04:00
Scott Feeney 38abee8e66 Refactor code to show/hide "All messages" link
Code prior to this commit was functionally working, but semantically
flawed — returning false does not short-circuit _.each like it does with
$.each. It now uses _.every, as suggested by Steve.

In addition I renamed the function to be more descriptive, added a
comment, and eliminated needless double negation.

(imported from commit b0666dfa01b2677b4eaf577fe9ced90ed0db2438)
2013-08-01 10:16:32 -04:00
Scott Feeney 1e642ae158 Use _.any instead of _.some
They are synonyms, and Zukeeper consensus is that _.any makes it clearer
what the function does.

(imported from commit 847383e27ccefeaff1ecff15f4cb4177c9e40c25)
2013-08-01 10:16:32 -04:00
Zev Benjamin 905354f7a1 For mit.edu, include .d instances in narrowed views
(imported from commit 502b36d1a62f3f8f7b956c701fd10f580e1927d7)
2013-07-31 18:30:28 -04:00
Zev Benjamin bae5924b53 Fix whitespace
(imported from commit 96937f8225bc7039f2a98163deb9b5b142c71c7f)
2013-07-31 18:30:28 -04:00
Zev Benjamin a637fadd18 Fix regexes for MIT narrows that include un- and -.d streams
The previous regex didn't escape the period in '.d' and was doing a
case-sensitive match to find the base stream name.

(imported from commit 43ef13733987e50dcead06b7bd3e768cb4395998)
2013-07-31 18:30:28 -04:00
Tim Abbott 7b44451c3a Remove old code for backing up sqlite version of trac database.
(imported from commit 2b5c461a8426e9b93ce46f48ce14dbef1b099ae2)
2013-07-31 16:54:09 -04:00
Waseem Daher a563776978 Don't Trac-linkify #1 - #9.
If you really want to link to those tickets, tough.

(imported from commit 54fccbe793662fade2b8f0f53d3f0e6cfa997398)
2013-07-31 16:32:08 -04:00
Tim Abbott d6acd8fce9 Add support for narrowing to a single message ID.
This is mostly useful for sending someone a link to a single Humbug
message.

(imported from commit b0994a2bf503c84690b13ce89bbcf5bab829bf0c)
2013-07-31 14:59:05 -04:00
Tim Abbott ed6f5ac470 Fix time travel by adding new near: operator.
(imported from commit 727a68016090164b586cbe59e692676a00e8cd3a)
2013-07-31 14:59:01 -04:00
Scott Feeney 473a96fd1f Fix #1629 (wrong scroll pos on narrow)
(imported from commit ac78077f104b079406e745c3eb9ff11b759d033e)
2013-07-31 14:35:48 -04:00
Luke Faraone b13361708f Warn users when sshing in to lb0.zulip.net
(imported from commit df30627fa6ee5eaf5589eb833879c7e03b204d5c)
2013-07-31 10:50:19 -04:00
Zev Benjamin 394deb4a72 Remove stray debugging 'print' statement
(imported from commit 261b3b6ee93ec596a1a971494761d92e7c27891d)
2013-07-30 18:29:33 -04:00
Zev Benjamin a3a1e8f351 [schema] Update our full text search vector and index asynchronously
We now write the fact that a message was created or updated to a log
table and actually update the tsvector asynchronously from a worker
process.

This also means that when running locally, one now needs to run the
process_fts_updates script in order to have new messages indexed for
full text search.

(imported from commit ebb11b08d30be2a45242dafe146e8e861a0f050a)
2013-07-30 18:13:05 -04:00
Zev Benjamin 0008edc9d5 [manual] Add worker process for processing asynchronous FTS updates
Unlike the other workers, this process runs on the database server.
To prevent duplicate work, only the worker on the master actually
processes updates.

To deploy, we in theory just need to apply the new puppet config.  In
practice, the database servers aren't on wheezy yet, so the changes
should be applied by hand to postgres0 and postgres1.  This only
needs to be done on deploy to staging.

(imported from commit d679ffc0838f9fc8c7f0bede08a5568b339b7ddb)
2013-07-30 18:13:05 -04:00
Tim Abbott d05ddce624 Remove unused client_id argument to get_updates/messages.
Note that it's still handed out by get_profile since the Android app
expects it.

(imported from commit dc7222449192bff363399d1a5f01652988b3f475)
2013-07-30 17:59:46 -04:00
Tim Abbott ba20221df8 Fix whitespace in request_event_queue.
(imported from commit ee9c63a25db765a4b879e6047a27027ae69ebacb)
2013-07-30 17:59:46 -04:00
Tim Abbott 53e06a0bb5 Use rest_dispatch for accessing Tornado URLs.
(imported from commit f129f5e3dc9e83f40fa9ea1b95d97a9b9f5a6831)
2013-07-30 17:59:46 -04:00
Tim Abbott eff18f46eb Refactor apply_markdown code to avoid nested @has_request_variables.
(imported from commit ad331bd62b8b576167f30aa49a7a85c90f057e65)
2013-07-30 17:59:46 -04:00
Scott Feeney ec58dcfa4e Add missing newline to unminified stacktrace output
(imported from commit 6abc3d1aced29de546a890b40fdbe486c6e80aed)
2013-07-30 17:59:10 -04:00
Zev Benjamin e8112ff1c1 test-js-with-node: Fix searching for node binary
Previously, when the first `which` failed, the entire script would
fail with exist status 1 because we pass `-e` to the interpreter.

(imported from commit 601de3b3e3edd90110fc478f7874e644009d1b62)
2013-07-30 17:58:06 -04:00
Luke Faraone 7637574345 Install molly-guard on our servers
(imported from commit 8c065763e649a86e50754c738458f09e7d0cf71d)
2013-07-30 17:45:20 -04:00
Zev Benjamin b950121fc2 Account for nodejs sometimes being installed as 'node' and sometimes as 'nodejs'
(imported from commit 751216c9544671106dd555823e31ad9d4553a7aa)
2013-07-30 17:29:47 -04:00
Tim Abbott 102b495609 api: Fix error reporting when result is not JSON.
Previously, we would return a JSONDecodeError to the user in the event
that the server returned a 500 error (or other non-JSON content).

(imported from commit 1624dfec6ac65d34216f4de91e33116a54e414fa)
2013-07-30 16:32:13 -04:00
Scott Feeney c5045b64f2 Generate API keys in a more secure way
The documentation for the Python `random` module explains that it "is
completely unsuitable for cryptographic purposes." This new way of
generating API keys replaces use of the random module with
`os.urandom()`, which is intended to be suitable for such uses. As a
bonus, the code is simpler and clearer.

(imported from commit cc3697a5048f2da53f0fce6689167f9d1cbb6466)
2013-07-30 13:54:50 -04:00
Scott Feeney c56353138d Fix tracebacks on reload while composing
(imported from commit 5ba1c93b8af015197e77bd16ef9178a6e743a849)
2013-07-30 13:10:50 -04:00
Scott Feeney a35fff90cc Replace $.extend
(imported from commit 2c1ee3c2714d388f2a71398fe81c049cc54ff94d)
2013-07-30 12:12: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
Scott Feeney 5842d5c335 Replace $.inArray with _.indexOf
(imported from commit 6bd9c87ac98b8951411fc050e1bff83684cf8618)
2013-07-30 12:12:03 -04:00
Scott Feeney 375b1f9eb3 Replace $.map with _.map
(imported from commit 97c7a6612d8d56d19f8650db0ea8906afc0f20ef)
2013-07-30 12:09:18 -04:00
Scott Feeney 88952fb2b1 Replace $.grep with _.filter
(imported from commit 3a8830f697551a91f94f06b37d01a3687d8c583d)
2013-07-30 12:06:22 -04:00