Commit Graph

16453 Commits

Author SHA1 Message Date
Zev Benjamin 9c8a9ac947 Correctly return the message id for already mirrored zephyr messages
This was previously causing us to generate a traceback every time we
hit a duplicated zephyr due to CC'ing.

(imported from commit 240e1559655d0166dcd864e84649ab97b87a29ad)
2013-08-12 15:49:19 -04:00
Steve Howell 878ee2b3fd Move Filter class to filter.js from narrow.js.
1) The class Filter now lives in its own module.
2) The function canonicalized_operators() is now a class method on Filter.
3) The function message_in_home moved to filter.js and became private.
4) Various calling code had to change, of course.
5) Splitting out Filter helped simplify a few tests.

(imported from commit e41d792b46d3d6a30d3bd03db0419f129d0a2a7b)
2013-08-12 13:58:32 -04:00
Zev Benjamin 51beeba854 referral: Prevent empty form submission
(imported from commit cc012e84c21bc424adaaa79611f09415480a2ba5)
2013-08-12 12:50:32 -04:00
Tim Abbott f9c3f77d07 For the CUSTOMER3 realm, include 100 messages in initial message set.
This is an experiment to try to ease the customer3 onboarding process
given that there will be a website with a public feed of recent Zulip
messages, to ensure that those messages appear for new users.

(imported from commit 31fb59c1800728b5e4d8a5ce7282c7dcedb02b21)
2013-08-12 10:17:18 -04:00
Tim Abbott b7e3f608cb Fix setting the initial pointer for users starting with messages.
This if statement stopped working when we made the pointer managed via
the events system.

(imported from commit 382ca5bd055ab85048b211068ff3d43a47607f28)
2013-08-12 10:17:18 -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
Zev Benjamin 0cfc8fae9f Add basic Javascript Dict implementation
(imported from commit 9f2fb089eb6e269549de26b37bd588355757d22c)
2013-08-09 17:20:14 -04:00
Zev Benjamin e0eddabeb1 Add util.enforce_arity
util.enforce_arity takes a function and returns a new version which
throws an error if an incorrect number of arguments (as determined by
the function prototype) are passed.

(imported from commit 20e69a6dc7b6f8455726ab4fae8d5b7b04dc4103)
2013-08-09 17:12:23 -04:00
Tim Abbott dd50f29b3d get_events: Don't return a queue ID unless we allocated one.
(imported from commit 85ad1aa2a0d52247c5efcecfab5212e40b876b88)
2013-08-09 15:35:33 -04:00
Tim Abbott 7fa448cdef Return the message ID when sending a message.
Our API documentation says that we do, and it seems like it could be
useful to clients, so we might as well do it.

(imported from commit c391e4952a09d41df4dc06e3dc6ee094f774822b)
2013-08-09 15:35:33 -04:00
Tim Abbott 9d6627d269 Rewrite documentation for /api/endpoints.
The main changes are:
(1) Changing the input format for the example response so that it is
human-readable and editable
(2) Updating it to use the events API

(imported from commit 308fade9595d6877836d343d2307e3fceff3e7d4)
2013-08-09 15:34:57 -04:00
Jessica McKellar a878f8a668 populate_db: make emailgateway@zulip.com a default user.
(imported from commit 000d03f59afbb1da125d5d610e1fff6b54d5dbd0)
2013-08-09 15:22:59 -04:00
Jessica McKellar a228bb6671 Implement a v1 email-to-zulip forwarder.
(imported from commit 5f91fd69ee2075413d0d4aedf71b878bf98c640e)
2013-08-09 15:22:58 -04:00
Jessica McKellar 639aac964e Add a management command to generate hashes for all streams that need them.
(imported from commit b3a05e47dfe69b44f984185e360d79bf04f7885b)
2013-08-09 14:59:27 -04:00
Jessica McKellar c020545e02 [schema] models: add an email_token field to Streams.
The e-mail forwarder will use this. Set it to nullable temporarily to
accomodate existing streams; later commits will a) provide a script to
give all streams a token, and b) make the field non-null.

Realm administrators will eventually have a UI to regenerate stream
tokens.

(imported from commit a084d0a7012eb9665e4da095cbc46aa9ef354eaa)
2013-08-09 14:59:26 -04:00
Jessica McKellar 3f8dfc7b9b Move to a common random token generation function instead of several one-offs.
(imported from commit 3217de5384088deff68fbffc6bd481c045a76817)
2013-08-09 14:59:26 -04:00
Jessica McKellar 28a4c1e971 Give API superusers the ability to send messages to arbitrary realms.
(imported from commit e7d1e89844cd2c32c14ad852d848e93b5861eac1)
2013-08-09 14:59:26 -04:00
Jessica McKellar 62a20cf0ef Make emailgateway@zulip.com an API superuser.
(imported from commit 02b6c98123bbc10bd8feca29382a091b43d5b65a)
2013-08-09 14:59:26 -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
Steve Howell db33028b98 Added tools/test-js-with-casper symlink.
The test-all script now calls the symlink, and the run script
has been cleaned up to be symlink friendly.

(imported from commit 8abb5c1e5744416e94ff843e50c53e0d0f7e1316)
2013-08-09 13:04:52 -04:00
Steve Howell cf1d94edef Add a test for stream_color.js (pick_color).
(imported from commit a49f96a4a7b61ef51c057e8a3f11c116d77ebb49)
2013-08-09 12:29:02 -04:00
Steve Howell cef72fd8b8 Add tests for the Filter class.
(imported from commit ef0917bd7911c5cc6f6d20d356c156d483ba723f)
2013-08-09 12:04:43 -04:00
Steve Howell cc73619a9d Add unit tests to narrow.js.
This includes slightly invasive, but harmless, changes to
production code.

(imported from commit 847557c11088b75c836cc399d0af75353a8faa3a)
2013-08-09 11:59:32 -04:00
Steve Howell 50b28dec49 Add node-based unit tests for util.js.
(imported from commit df666a5b96d378787e911c2cd6e509b7d42e1cb4)
2013-08-08 17:25:24 -04:00
Waseem Daher 49849a214f New onboarding step: Set up an integration.
(imported from commit 2c6cc6f703e893b44b2871c9510e858743d417ad)
2013-08-08 17:23:27 -04:00
Steve Howell 8eb15a5436 Don't show inactive users as stream subscribers.
This fixes trac #1660.  A deactivated user may still have the
active flag set to "true" on their subscriptions, but this is
just to help future reactivations; they are not actually
valid subscribers while deactivated, so we add UserProfile.is_active
to our filter in the query in get_subscribers_backend().

(imported from commit 8598b2e180faea618371293e42b794898e645004)
2013-08-08 16:29:18 -04:00
Steve Howell 164215bc78 Support API for changing user's API key.
(imported from commit b9f5594cf809965c996115c8420a359820dad3ff)
2013-08-08 13:03:09 -04:00
Steve Howell 0b4c37ef8d Autocomplete names w/spaces in search.
See trac #1356.

(imported from commit 6aaf122c0f6d7b1d92bb074e8f3fbb93d0b63ceb)
2013-08-08 12:54:20 -04:00
Kevin Mehall 0b9497305f Add defensive checks against undefined messages to _is_summarized_message.
Should fix the issue with empty realms.

(imported from commit afca70ebf3b7b74ae0d0c269c72b4f8d54fc254b)
2013-08-08 12:47:23 -04:00
Tim Abbott 9181c7c75b Move generate-fixtures to tools/.
(imported from commit 3d452b17e315ba9adf91e33408a7711d16b069a2)
2013-08-08 10:22:32 -04:00
Tim Abbott 2ea1bb05a5 Rename ~/.humbugrc to ~/.zuliprc.
(imported from commit a0d53dd20097a56971874dc1d84c6f95267e84f2)
2013-08-08 10:22:31 -04:00
Jessica McKellar d6c87f35e2 Move domain validation from a form field validator to a data cleaning check.
We need to be able to let a user through if they are trying to sign up
for a completely open realm like CUSTOMER3.

(imported from commit 1e33ab0ce94545f217739d501e9227dfb48e1123)
2013-08-08 10:12:22 -04:00
Jessica McKellar 99b2a90440 Move completely_open to models.py.
It will have new callers soon and that's as fine a place as any to
avoid circular imports.

(imported from commit 089a724e9ad06cb5a51ffe80f1729d789238e5f6)
2013-08-08 10:12:22 -04:00
Tim Abbott 7b9305b06f Rename Django project to zproject.
This includes a hack to preserve humbug/backends.py as a symlink, so
that we don't need to regenerate all our old sessions.

(imported from commit b7918988b31c71ec01bbdc270db7017d4069221d)
2013-08-07 11:04:03 -04:00
Kevin Mehall eac6463031 Implement message summarization experiment.
When you read messages in a narrow and then un-narrow, collapse
adjacent messages read in the narrow into a summary row that can
be clicked to expand those messages.

Scoped to staging with feature flags.

The implementation of this within our current MessageList is rather ugly.

(imported from commit bcb3a39d8c0c334136fe86318f18ead03f0f50bf)
2013-08-07 10:24:03 -04:00
Tim Abbott 4c8fdec554 Rename humbug => zulip in comments.
(imported from commit 26f305fa9351135a1b874f3c2106f03aed7683cb)
2013-08-07 10:00:08 -04:00
Tim Abbott ae615dfb4d Rename humbug => zulip in some settings.
(imported from commit 4d10e6213cf828f16b833ecba98b950972c32442)
2013-08-07 10:00:08 -04:00
Tim Abbott d59ba39518 Rename humbug_finish to zulip_finish.
(imported from commit a73ef9302d16a4068c7d050d4882d2eba699488d)
2013-08-07 10:00:08 -04:00
Tim Abbott 661ca38b58 Change humbug => zulip in some local variables.
(imported from commit 88caa4a87ea0fd269ab741645c124c5d07d69c0a)
2013-08-07 10:00:08 -04:00
Tim Abbott 2db6dc6c88 Change humbug => zulip in populate_db variables.
(imported from commit 14f8e072fd87478e8877925912fde113a75aba2c)
2013-08-07 10:00:08 -04:00
Tim Abbott 41433e552f Remove old sqlite path zephyrdb from .gitignore files.
(imported from commit 1d9c9849de46854ace1caa4c32d5fe4c86d2ff5c)
2013-08-07 10:00:08 -04:00
Tim Abbott d8f78a5e2d Fix some remaining references to zephyr.
(imported from commit 2072d3451cc08bc32b997d7fafaafd7b6ac568df)
2013-08-07 10:00:08 -04:00
Tim Abbott d6e32668c8 Change Humbug => Zulip in name of exception filter module.
(imported from commit 87d4a45834f605a83fa5f9286217258dafaa1b92)
2013-08-07 10:00:07 -04:00
Tim Abbott d63a398716 Change Humbug => Zulip in name of error limiter module.
(imported from commit 55c5deba463faecc50da22e9745fd13ad8b11fd8)
2013-08-07 10:00:07 -04:00
Tim Abbott 6083ad7244 Change Humbug => Zulip in name of finder module.
(imported from commit 2f5391da2c3ce667531a3c6155c759309b9249f5)
2013-08-07 10:00:07 -04:00
Tim Abbott 034c96ef77 Change Humbug => Zulip in name of storage module.
(imported from commit 37d7994b36e5140962866d5c11d98ca05ad15d62)
2013-08-07 10:00:07 -04:00
Tim Abbott 3a470aa9c7 Change Humbug => Zulip in names of error reporting handlers.
(imported from commit 12e5486321303c80f6676c1f516ff35c3dcb676d)
2013-08-07 10:00:07 -04:00
Tim Abbott 1f1af26048 Change Humbug => Zulip in text/comments.
(imported from commit 2f9d73431ae40e1b9e9e11bc2f4f62f566ae758a)
2013-08-07 10:00:07 -04:00
Tim Abbott e05979d4c4 Rename humbug_realm to zulip_realm.
(imported from commit b36dcc7e5240159357a0f30036394a2af9b85844)
2013-08-07 10:00:07 -04:00
Steve Howell 57f518c9c2 Add node JS unit tests for MessageList.
(imported from commit 486a343add91fd5037431504e1ce4a750bfa9fbf)
2013-08-07 09:25:13 -04:00
Steve Howell 9f9c7c3e3b Loosen up emoji regex. (i.e. More emojis! 👍)
Now parsed: 🍺,🍺;🍺!

 If \w characters surround :foo:, we still say it's NOT an
 emoji, but we used to do this for \S characters, so it's loosened up.

(imported from commit 49b33d2f0ffdcfde8947ae411a4addcf4c24af9c)
2013-08-06 18:20:30 -04:00
Steve Howell 3aa5930191 Streamline search suggestions when query has trailing space.
If you entered "stream:Denmark " in the search box, we would show
you two suggestions for "stream Denmark", despite our duplicate
detection, because we didn't canonicalize the suggestion that is
literally based off the user typed query, and so the other way
of generating the "stream Denmark" suggestion created a duplicate.

Now all the suggestions we generate are canonicalized, so the
generalized duplicate detection can work.

(imported from commit 52bf08ccf9bb2e2260ca8c20690169aead3732ab)
2013-08-06 14:04:29 -04:00
Tim Abbott e111a2f9a5 [manual] Rename Django app from zephyr to zerver.
This needs to be deployed to both staging and prod at the same
off-peak time (and the schema migration run).

At the time it is deployed, we need to make a few changes directly in
the database:

(1) UPDATE django_content_type set app_label='zerver' where app_label='zephyr';
(2) UPDATE south_migrationhistory set app_name='zerver' where app_name='zephyr';

(imported from commit eb3fd719571740189514ef0b884738cb30df1320)
2013-08-06 07:39:36 -04:00