Commit Graph

8746 Commits

Author SHA1 Message Date
Zev Benjamin 364bbf08cf Don't drop the public schema when initializing the database
The production database has a public schema.  I thought we had dropped it, but
apparently not.  We should match what exists in prod either way.

(imported from commit 1bf956360029ebbd59afc3cc30fca9a859343adf)
2014-01-31 13:29:10 -05:00
Zev Benjamin 655bacc06d postgres-init-db: Don't duplicate lines in .pgpass
(imported from commit 2a9d56a2aee2a7fcb2c12e4647bdfedabaee390b)
2014-01-31 13:29:10 -05:00
Zev Benjamin 8767c33536 Persist the tsearch_extras extension across rebuilding of the database
We do this by creating a new zulip{_test}_base database that only has the zulip
schema and the tsearch_extras extension.  We then use that as a template when
creating zulip{_test}.

(imported from commit 8adb4b98410e4042a0187902e89c99561eac8c8f)
2014-01-31 13:29:10 -05:00
Zev Benjamin 17826dba42 generate-fixtures: Be more robust to databases being missing
(imported from commit f42d673c433b8d3df4af79159831e57f5db1ee1c)
2014-01-31 13:29:10 -05:00
Zev Benjamin 2b1a5ae141 Fix postgres-init-db shebang line
(imported from commit 408d0ae05e104c076c9875135c7387af89fa8954)
2014-01-31 13:29:10 -05:00
Zev Benjamin 3212ced8e7 Remove unneeded code to delete time.pyc
lib/time.py was removed January 10, 2013

(imported from commit bd48cb7d81e98dd1723cd37553cc64c4f10face1)
2014-01-31 13:29:10 -05:00
Steve Howell c67ae498ff Extract test_external.py
(imported from commit 838dd34f101025ba161291992a56972cd374104b)
2014-01-31 13:14:19 -05:00
Jessica McKellar 9b1090506e Add tests for admins unsubscribing principals.
(imported from commit a2599ddc55ccddde3d39cb125bb1d5079772c652)
2014-01-31 11:23:14 -05:00
Jessica McKellar ec88b3abaf Give admins the ability to unsubscribe people from streams.
(imported from commit 7ec130a233a2976ad0be6f8a7b59c33ce0e0cf3f)
2014-01-31 11:23:14 -05:00
Jessica McKellar c4c5ac210e Convert stream member list to a handlebars template.
We had been concatenating strings.

(imported from commit 2d50d3f750a450029d39553ea9cd99ef824a149b)
2014-01-31 11:23:13 -05:00
Jessica McKellar db4cbcd438 Make /json/subscriptions/remove support principals.
Admins will use this to unsubscribe other people from streams.

(imported from commit 5b42d5852ddcfa2c8776482c45471828c4daf453)
2014-01-31 11:23:13 -05:00
Steve Howell 5acf8ac0b6 Split out zerver/test_messages.py.
(imported from commit 61c40418bad4628a8f98298587a0e0defa9302bd)
2014-01-31 11:22:49 -05:00
Tim Abbott 6e5e5596fd Remove deferred installation of scroll handler.
This is no longer required, now that we're no longer scrolling the
main body of the page.

(imported from commit c2aa0d403c8fd0679b3110fe8e7684d46a7557fa)
2014-01-31 11:15:14 -05:00
Tim Abbott 70df0b933c check-all: Clean up some values that are no longer globals.
(imported from commit 0cd8d5de8b9e30dc40274f1a3d64b9f6e53d26b2)
2014-01-31 11:15:14 -05:00
Jessica McKellar 00673534ba digest: log send failures and unsubscribe hard-bounce emails.
(imported from commit 3ffcc335d4d3ad3955da8981ff1129888fe681a4)
2014-01-31 10:57:31 -05:00
Leo Franchi 2fac412119 Get next local id correctly when all message list is empty
(imported from commit 07208222ea682251927ef13c684e9e89277233bf)
2014-01-30 18:08:48 -05:00
Leo Franchi 01e948ac97 Allow unnarrowing to an empty message list in unread-messages-read case
(imported from commit f377dbce61fe2fc2051bc286f7215e8112f92736)
2014-01-30 18:08:48 -05:00
Leo Franchi 1056078415 Truncate local ids when loading older messages if messages could be local only
(imported from commit b32ae8f3554632aa84ed2dd039a612bb0fa644e2)
2014-01-30 18:08:48 -05:00
Tim Abbott e505583f52 Split out new module people.js for tracking people.
(imported from commit fb9b769819ade25d1d3d6e452e68c7ee8651cfdd)
2014-01-30 17:32:58 -05:00
Tim Abbott d0ae8795c3 Clean up obsolete fields in get_events_params.
Both pointer and last are fields that were removed when we changed the
protocol to use events like a year ago.

This conveniently allows us to stop exporting get_updates_params to
other modules.

(imported from commit 13651ee240ce6e1bafb241b185e5ef653c348cdf)
2014-01-30 17:23:53 -05:00
Tim Abbott 2fb9baafb4 Start running get_events immediately on page load.
Previously, we waited until we'd fully loaded the home view to start
calling get_events, which:
(A) didn't make sense non-message related events
(B) resulted in our throwing "get_updates not started" errors when
users sent a message before the home view was fully loaded.

This commit only fixes problem (B); to fix problem (A) we will need to
change the event capture code to only capture some events.

(imported from commit 2aacd6bdfd1e7d7707e3a724f1fde7da4a556538)
2014-01-30 17:23:53 -05:00
Tim Abbott f27edcd50a Move initial call to get_events to server_events.home_view_loaded.
Note that this makes the event fire after the home view has messages
loaded all the way to current; previously it only waited for the first
batch of messages to load.

(imported from commit a5c408ea0136c761f4cc77e8be4977b13acc6d77)
2014-01-30 17:23:52 -05:00
Tim Abbott 1eb294ed11 Rename get_updates to get_events in the frontend.
We did this rename on the backend ages ago.

(imported from commit 11bdf6aa08d932fe2586de282f6174e3dba7267a)
2014-01-30 17:23:52 -05:00
Steve Howell e60f148a3e Clean up double negatives in message_matches_search_term
(imported from commit 677bb3a76d3404f9899498777e7f1169947422c7)
2014-01-30 17:19:50 -05:00
Steve Howell 189743e813 Extract message_matches_search_term in filter.js.
This diff really just moves code; it's a trivial function extraction.

(imported from commit 8ff82b089e49645a6c6034152a9fc9cd83da0737)
2014-01-30 16:46:51 -05:00
Steve Howell 3a412b35e1 Use _.all() in Filter._build_predicate.
By using _.all() instead of a for loop, we avoid a tiny bit of
confusing between "break" being for a switch statement and being for
the loop.

(imported from commit cd6e7ff788b50f4dadce93e7f0efcb381bc59270)
2014-01-30 16:45:47 -05:00
Steve Howell 15b0f9dcc7 Use operator/operand in narrow.collect_single().
(This is part of converting away from tuples.)

(imported from commit ba3083f8b3242fee1d532d7666aee68af89d8ddc)
2014-01-30 16:15:16 -05:00
Steve Howell 796ebfd007 Do not return raw operators from narrow.operators().
Even in the case where we are running embedded narrows,
we want narrow.operators() to return new-style operators
that you get with Filter objects, so that callees do
not need to support the legacy tuple format.

(imported from commit a6649881a926a2304e9f7cc8ca53b406e2c8828e)
2014-01-30 16:15:14 -05:00
Steve Howell de7708ed6e Handle id:<msg id> searches with multiple terms.
If you do a search like id:5 topic:foo and message #5
does not have the topic "foo", we now return zero results.

(imported from commit 8121fac1dbd79024c51af1f310d831dab9242e36)
2014-01-30 15:57:32 -05:00
Zev Benjamin a2d989b318 Fix typo
(imported from commit dc7ef302a70291063c3ef339f72b6a91e8129dc1)
2014-01-30 15:57:32 -05:00
Zev Benjamin 50e1cb7ab3 socket: Specify reasons everywhere we close the SockJS object
(imported from commit 7314fa975b9408caba2c5f1374c8259d67784ad0)
2014-01-30 15:57:32 -05:00
Zev Benjamin 3df1097c95 socket: Wrap module in an anonymous function call
This is so we can have some class variables.

(imported from commit 6311444bb2739daebc6c5da2b7ea7eabdd88689d)
2014-01-30 15:57:31 -05:00
Zev Benjamin 9020f37141 socket: Add comment about the close() call in _try_to_reconnect()
(imported from commit 87e32adcb9eeb066b6f3ecd85550d00263e0a4e9)
2014-01-30 15:57:30 -05:00
Zev Benjamin b8444daddd socket: Pass wait_time as an option to _try_to_reconnect
(imported from commit 15a88c6da084f4834258868bc08b2cd983899820)
2014-01-30 15:57:29 -05:00
Zev Benjamin 1ed176b5ef socket: Log the reason the SockJS connection was lost
(imported from commit 069067f9f979e7255f97f4943d6513076b2706bd)
2014-01-30 15:57:29 -05:00
Steve Howell b3a551f402 Stop using raw operators in narrow.activate().
Have narrow.activate() user filter.operators() to produce
operators that have operand/operator fields, so that its callees
don't need to be backward compatible with the tuple format.

(imported from commit e408e33074d1be2d112bb3cdc081ec3616c908ee)
2014-01-30 15:57:28 -05:00
Tim Abbott a7b1b29bf0 Move get_updates into a module.
(imported from commit 9a6c0ab1e76dd96abad8626bc5b1fdbd234b2645)
2014-01-30 15:57:28 -05:00
Tim Abbott 33690d1dc6 Clean up argument to get_updates_success.
(imported from commit 2583c79f83e1e3e540a00ba8afae5a07dff70845)
2014-01-30 15:57:28 -05:00
Jason Michalski 90995889fc Fix scroll when muting and unmuting streams
(imported from commit 9bd22cd12dfa50cf8fd9d87eb659a4543c5c78c4)
2014-01-30 01:48:15 -05:00
Jason Michalski bf57839e85 Remove scrollTop workaround for hash changes
Now that we are not scrolling the document we can remove the workaround
to prevent browsers from scrolling on hash changes.

(imported from commit 67fdaa4980d4d54d80ca9c259bbee567b8eeb917)
2014-01-30 01:48:15 -05:00
Jason Michalski 21c2aea755 Fix scroll position on narrow and unnarrow
Change the offset to hold of the selected message as an offset from the
top of the screen. Then use the current offset and scrollTop to compute
the new scrollTop.

(imported from commit 718e95d3435c0f84cbb7663a9bb2bc2789314203)
2014-01-30 01:48:15 -05:00
Jason Michalski b0c5e2dbd0 Fix scroll on opening subscriptions details
Move the animated scroll from body to the app div.

(imported from commit 2d2062d7a917616a60f414a633dd2f827ae840a0)
2014-01-30 01:48:15 -05:00
Jason Michalski 9cc1dc242c Move the mouse handlers from window to app
(imported from commit 0331496a578c47f73b6c9e81d8a79e26e8d7a9a3)
2014-01-30 01:48:15 -05:00
Jason Michalski 198648447f Change viewport to use the app div not the document for size
Now that we are scrolling the app we should have viewport respect this
CSS change.

(imported from commit dec5450563a6f5ac23499819ec382030e3a910dc)
2014-01-30 01:48:15 -05:00
Allen Rabinovich dedd3cf03c Overflow scroll on app instead of body
(imported from commit 2be63b16afe212e95e983745eaa0bc5dc8e1397e)
2014-01-30 01:48:15 -05:00
Steve Howell 967d3c9c65 Use .operator to get operator for mixpanel.
(imported from commit 7c70a592b2efd769acab9b178c08a345785b889b)
2014-01-30 13:24:43 -05:00
Steve Howell 53027b71a4 Use operator/operand inside the Filter instance methods.
Avoid tuples in the methods inside Filter.prototype.

(imported from commit beed799e767d9645735a2bd4eefb5d431c04f17f)
2014-01-30 12:53:08 -05:00
Steve Howell b18307b667 Start using operator/operands internally in Filter class.
By having Filter.canonicalize_tuple() call filter_term(),
we make it so that Filter objects get operator/operand
fields in their terms when we initialize this.

This mostly caused test breakage for tests that were doing
assert.deepEqual; now we just check to make sure that the
field we need are there.

(imported from commit 63b2516dc72edeb11e76a1fa4442570b9c605baa)
2014-01-30 12:53:08 -05:00
Steve Howell 12626ead66 Populate terms with named fields in filter_term().
Consumers of Filter.parse() can now reference
search term parts like so: term.operand, term.operator

(Legacy code can still use term[0] and term[1].)

(imported from commit 06d0da65f13f1eb7e3ba8eac0e69448aab2735ab)
2014-01-30 12:53:08 -05:00
Steve Howell df19f4283d Split up test_parse_and_unparse() into two tests.
(imported from commit da0fd90de110b4789dbcc99d2ce7337169273bd3)
2014-01-30 12:53:07 -05:00