Commit Graph

5225 Commits

Author SHA1 Message Date
Jessica McKellar 9a40276865 views: don't defer subscribing a new users to their streams until after the tutorial.
We did this as a hack to prevent traffic while you were in the
tutorial. In the revised tutorial, we want you to see your actual
streams while you go through it, and we'll instead store the events
client-side for processing after you finish.

(imported from commit 75af93d0661c9d14b2c85624aef3f71a78053980)
2013-07-02 18:26:16 -04:00
Jessica McKellar c7d289e328 Rip out old tutorial.
(imported from commit a8f2b246f23500e93a56e028e22aa1196c017d8e)
2013-07-02 18:26:16 -04:00
Jessica McKellar bc3837f440 compose: remove tutorial check on sent messages.
We did this to check if you sent a message that would progress the
tutorial. Since the tutorial is getting overhauled we don't need this
anymore.

(imported from commit 25ee55ab034fff42a220ddd7b222b3f7459af3a1)
2013-07-02 18:26:16 -04:00
Kevin Mehall dce1f7f729 Parse @-mentions in bugdown and style them.
* This makes bugdown.convert take a `message` parameter. Properties
    for parsed mentions are added to the message object by the `Pattern`
    for use in do_send_messages.

  * Refactor repeated markdown rendering code into `Message` model methods.

(imported from commit 4f0ed5570104c0210f984b6de21e9048e2b53fa0)
2013-07-02 18:20:26 -04:00
Steve Howell 7604534050 Use get_user_profile_by_email() in tests.
We use get_user_profile_by_email() in all our tests now, as it
gives us code coverage on the function itself, and it should be
faster for tests that call it multiple times.

(imported from commit 51ebffb193980fd6f81b0ef5574d96cd92e87364)
2013-07-02 16:50:11 -04:00
Steve Howell 9e64750083 Use memcache in the test suite.
This uses a new configuration that enables memcache, but we have
to be careful to bounce KEY_PREFIX on every new test, since data
gets rolled back in the databases between tests, but not in
memcached.  We had to break up one test to work around UserProfile
objects actually being cached.

(imported from commit f201cf9cd9e0e4c61d3c384fa8d2bbd5134161e8)
2013-07-02 16:50:10 -04:00
Steve Howell 741929008b Add profiled decorator and a tool to show profiler results.
The goal here is to make it easier to do ad hoc profiling on
our codebase, particularly by running tests.

(imported from commit 71da06feb3a369dec8dc4d8391f7f40e4c2d02ff)
2013-07-02 16:47:34 -04:00
Allen Rabinovich cff0096f3b Make date boundary separators all uppercase, lighter, and letterpressed
(imported from commit 01ffbda9b4dc478732dba091e3cefced9fb1cb7c)
2013-07-02 13:08:44 -07:00
Allen Rabinovich c5e70f08f7 Make the pointer highlight lighter on private messages
(imported from commit 51f95f010336ffcfcbfae19f27efd074ec8d8be5)
2013-07-02 13:08:44 -07:00
Allen Rabinovich 090cb8b436 Switch the private message recipient bar back to a dark background
(imported from commit b172e35bf1f33eda5dc8b352d017a96530bf27b7)
2013-07-02 13:08:44 -07:00
Allen Rabinovich 332116f8fb Change the recipient bar background to a darker gray with less gradient
(imported from commit 7586453625da76623771cff9fe147d22c9f8709d)
2013-07-02 13:08:44 -07:00
Leo Franchi 779ab0e3ca Get apply_markdown value from REQ if it exists
(imported from commit c93b0a96564535c0a0162e827a67379fdf166de9)
2013-07-02 15:04:42 -04:00
Luke Faraone 6eb3d8b8b1 Syntax fix for staging_app_frontend.pp.
(imported from commit c363e6e9c18b08467555a1f0520680736dab2dd1)
2013-07-02 14:54:16 -04:00
Steve Howell 86e89b66e7 Make GetProfileTest tests pass deteministically.
(Make sure users have at least one message in their stream.)

(imported from commit a6654447ae9a9626f5b3d5e01ffaa00dde17c79b)
2013-07-02 13:17:35 -04:00
Luke Faraone 7b30a8e7c0 Explicitly copy over the zulip-staging files in Puppet.
Unlike other directories, we explicitly enumerate the files we want to be
present in sites-available, so the previous commit series did not actually
instruct puppet to make the zulip-staging files accessible.

(imported from commit 22efc4d272eba8d6c869edbaa9114c50e1988288)
2013-07-02 12:14:41 -04:00
Leo Franchi 93765b0568 Keep variable in list comprehension from shadowing
(imported from commit 2d2bbc029d7c13b5e6f125bd5f79ba3d73d3c677)
2013-07-02 12:10:23 -04:00
Luke Faraone 1be1cb121c nginx / Puppet configuration for staging.zulip.com
We create a new sites-available entry which is essentially a duplicate of
sites-available/humbug-staging with s/humbug/zulip, and add the associated
symlink directive in Puppet.

(imported from commit febcb585ce93c21c6849d96458cc2bd096b30538)
2013-07-02 12:04:56 -04:00
Luke Faraone c7ab5c6836 Include certificate for staging.zulip.com.
The key for this certificate is the same as the key for
staging.humbughq.com.

The combined-chain was created according to the manner described in
commit 6544938ef29.

(imported from commit 99d5658d822bdffdd05b30c24f2e77d150ebf06f)
2013-07-02 12:04:56 -04:00
Leo Franchi a2294c05d5 Send the proper Content-Type header on our Tornado responses
(imported from commit 574d2421541449fae0f91509dc3bc018e49bd24d)
2013-07-02 11:46:10 -04:00
Tim Abbott 8dcdf74af8 update-deployment: Wait up to 5 minutes for lock, rather than just failing.
(imported from commit 3677354841d6084f0917acde4baa79f9c8c3d26b)
2013-07-02 11:36:40 -04:00
Tim Abbott 152ba9ccc7 update-deployment: Remove unnecessary arguments.
(imported from commit b28336b1e45de85a7bc24ee89327d19e106cf3cb)
2013-07-02 11:36:40 -04:00
Luke Faraone b1b2af9b2a Add ZULIP.COM and subdomains to ALLOWED_HOSTS
(imported from commit 94e28b5973f4d83ee4f63dbae7c8def0c36b9160)
2013-07-02 11:21:43 -04:00
Tim Abbott f473cb5fbe Use bulk operations in notify_subscription_{added_removed}.
After fixing the high numbers of database queries earlier in this
branch, I found that sending 500 RabbitMQ messages for a bulk change
in subscriptions was consuming more than half the time for these (and
then we'd end up with 500 events in a queue).  To handle this, we
create a "user X subscribed to these N streams" event, rather than
sending one event for each individual subscription.

(imported from commit 44a34a9fab9b67e9f0da6fee53335d8c5030392b)
2013-07-02 10:50:29 -04:00
Tim Abbott 74fd508b2f Remove subscriptions using bulk queries.
This improves the performance of unsubscribing to N streams by more
than a factor of 10 for large N.

(imported from commit a529e6d3ac4452f49c2294908d275280019bbd05)
2013-07-02 10:50:29 -04:00
Tim Abbott 7f3fded612 Add default stream subscriptions using bulk queries.
(imported from commit f6d7415269cc74836c1c331741665b01cb1090cd)
2013-07-02 10:50:29 -04:00
Tim Abbott 703dec0344 Use bulk queries to get the recipients for narrowing to MIT streams.
Otherwise we could in theory make dozens or hundreds of
memcached/database queries to handle a narrow.

(imported from commit 232f38d8c005b9aef6f12f2f9a4d68a19134d038)
2013-07-02 10:50:29 -04:00
Jeff Arnold 45116a0b61 For mit.edu, include unclasses and .d classes in narrowed views
(imported from commit e21aab715c949d4348c447e6e135281b47e06b98)
2013-07-02 10:50:29 -04:00
Tim Abbott dc54a24766 Add util.escape_regexp.
(imported from commit 3ba7caa0d444a64b228bcb5f5c658c8363ddfbf5)
2013-07-02 10:50:29 -04:00
Tim Abbott a4cf528fad Use a bulk query to fetch the streams in list_to_streams.
This substantially improves the performance of all the functions using
this helper.

(imported from commit 9c247e82f392475c8ddf46b4b498ef293911e9f5)
2013-07-02 10:50:29 -04:00
Tim Abbott a66bb508bb Use bulk queries for adding many subscriptions to a single user.
Previously we only used bulk queries when adding many users to a
single stream, resulting in very slow performance when subscribing
users to large numbers of streams (as happens when setting up a new
MIT realm user).

(imported from commit 849fa7b2a1a146c0a9adc1c727c20c9fbfb7b425)
2013-07-02 10:50:28 -04:00
Tim Abbott 738793a962 bulk_add_subscriptions: Remove incorrect comment.
This comment was only ever accurate for prototype versions of
bulk_add_subscriptions prior to it being committed to master.

(imported from commit 89b9dc49423c45553cb6c810d97eea4583ff0f69)
2013-07-02 10:50:28 -04:00
Tim Abbott c6916faca2 Genericize the bulk cache fetching logic.
(imported from commit 52664ce0ad800efff6b583e80c27701638ff6205)
2013-07-02 10:50:28 -04:00
Steve Howell e5a661c47f Remove AuthedTestCase.message_stream.
The two remaining callers just call get_user_messages directly.

(imported from commit 438252687faab7c25e8c7e7f2222974d30d8453d)
2013-07-02 10:50:02 -04:00
Steve Howell 1899584e87 Use most_recent_message() in a couple more places in the tests.
(imported from commit aecaa664db7b9486a38ec9ed375cad7220cdc98e)
2013-07-02 10:50:02 -04:00
Steve Howell 0a42d01003 Speed up and tidy up test_new_message() in UnreadCountsTest.
(imported from commit dee4c591de25b70077d6e765c10a9358a5978120)
2013-07-02 10:50:02 -04:00
Steve Howell a6ceb7dd11 Use Message.objects.count() to speed up tests.
(imported from commit dff1921b00a52929368d8a352f2ce8c05f63ec1f)
2013-07-02 10:50:02 -04:00
Steve Howell a989d5181f Speed up tests with message_stream_count().
The message_stream_count() function uses Django's count() method,
which is more efficient than doing len() on array of full objects.

(imported from commit 9c20a89a2cd02d9d39341132330d03a7f6c8be25)
2013-07-02 10:50:02 -04:00
Steve Howell 504cea7d0c Remove filter_by_subscriptions(). (dead code)
(imported from commit e6a9ef597f2dc281851b0669b64646ee10313480)
2013-07-02 10:50:02 -04:00
Steve Howell d94f91fd43 Simplify do_send_messages() from prior commit.
This change removes an "if True:" that was
introduced to make the prior commit a bit more readable.
It also combines two loops, since the second loop is no
longer conditional.

(imported from commit df58f1e5de72d5669f6468fbff54fb62cd22cedb)
2013-07-02 10:50:02 -04:00
Steve Howell a4db7de330 Actually test callbacks in GetUpdatesTest.
The tests in GetUpdatesTest had some callback logic that has
been dead code for at least three months.  We now fully exercise
the callback codepath and make sure that the callbacks do happen.

(imported from commit f5d8fbab28ecc34dc81d3d0c29058b66c10f378f)
2013-07-02 10:50:02 -04:00
Steve Howell 3f047ec703 Speed up message_stream in tests.py
(imported from commit 042a763cda33e38e370ed7a185e0b8cdd61a806b)
2013-07-02 10:50:01 -04:00
Steve Howell d3e3c21273 Mark more tests as slow.
(imported from commit 3c109d671e790c8025a4924238c921e71b57f67c)
2013-07-02 10:50:01 -04:00
Steve Howell e815433fa0 Cache api key lookups in our back end tests.
(imported from commit 09973c5355aa02c2bdda4a7cecd8721792bb3c3c)
2013-07-02 10:50:01 -04:00
Leo Franchi 975e13a1b8 Update sparkle to our 0.3.0 release
(imported from commit bd02d67fbd13d709b579f93a69d625da5517eec7)
2013-07-02 10:40:12 -04:00
Kevin Mehall 4b6b8cb3f9 Rename timerender.render_time to render_date.
It only renders the date part now.

(imported from commit 6cbfb4175a8ed1b69b99a6f16ee9eaa2cb36e0de)
2013-07-02 10:13:57 -04:00
Kevin Mehall 6b07c2cf27 Don't re-use "Last edited:" strings.
These contain timerender spans with unique IDs. If this string is cached
and re-used in a narrowed view, there are elements with duplicate IDs,
and only one of them is updated at midnight.

(imported from commit 29469fb5f0d8a9b7fe7988849d2936c49d4a038d)
2013-07-02 10:13:57 -04:00
Kevin Mehall 2857d0b4e1 Show time again in "Last edited" message.
As of f69d01b and e4a9f80, timerender only deals with the date part.
Since the time does not change when the friendly dates are updated,
just append the time outside of the span.timerender.

(imported from commit 18ec93550782c6fa8447ebc608f95da79d28dc8d)
2013-07-02 10:13:56 -04:00
Leo Franchi 7036915933 Add windows sparkle files
(imported from commit b7c0770acd34f44e961014a00d2059dfc7bef701)
2013-07-01 16:25:35 -04:00
Luke Faraone cf81c46c77 Omit fonts.css on QtWebKit clients
QTBUG-3467 prevents non-normal-face @font-face fonts from being used when
defined as such in CSS. To work around this, the desktop applications now
ship the Humbug font themselves, and this commit causes the server to no
longer send the problematic CSS rules to those clients.

We have some duplication insofar as we now have two minified CSS files, but
this is better than conditionally applying the CSS at page runtime.

(imported from commit 9a887f9fb8002d44171d366d1249ebbf21cc9c77)
2013-07-01 14:37:58 -04:00
Kevin Mehall 0f839522a7 Increase shown subjects to 8 (+ any unread), per discussion on
corporate > singlehop.

(imported from commit e4c28670e33ca0ea6ecb59d1ce94efb28e86e23a)
2013-07-01 13:35:00 -04:00