Tim Abbott
66e72d4705
Ignore slow queries on certain non-customer-facing URLs.
...
(imported from commit c3f53883d93a75d805b15f617f391ccd1a492ce8)
2013-12-19 17:20:43 -05:00
Tim Abbott
e77b34ed82
api: Extract client strings from UserAgent.
...
(imported from commit 22468dd0eb06bb52ed7273f3067ae3e2461ee0a5)
2013-12-19 17:20:43 -05:00
Tim Abbott
453a05996e
Update client strings for webhooks to match UserAgent style.
...
(imported from commit 0bbed9b0f37e7d57fd7a1607d6fd0e938349e586)
2013-12-19 17:20:43 -05:00
Tim Abbott
8c8c5337ef
UserPresenceTests: Fix use of API auth with json view.
...
While it does work, it's more an accident than intentional behavior
and not something we want to be encouraging (and it's messier code).
(imported from commit 3797147fc21836135a6304412bd3f958873a0576)
2013-12-19 17:20:43 -05:00
Leo Franchi
0e8fc2a26a
Match new User-Agent format for the desktop app in discrimination
...
(imported from commit 51c296570f506f2280556956b3bf9c26e95cc2f8)
2013-12-19 16:53:45 -05:00
Tim Abbott
a70072f5cf
socket: Don't throw traceback when sessions are expired.
...
(imported from commit 16c876b5bbd0c6ecd5ef48369a7f71ca74d1183f)
2013-12-19 16:52:53 -05:00
Tim Abbott
2ca5f43f05
Report json format 500 errors from all json format views.
...
Previously, we only did this via rest_dispatch.
(imported from commit b0edfdccea294378292b64677a64d5b01f936b08)
2013-12-19 16:48:51 -05:00
Tim Abbott
b30afe432e
Return a nice JSON error when CSRF errors happen in JSON views.
...
(imported from commit 916166c115f9b3ba0fdc93f8d917ff37ae22c2ae)
2013-12-19 16:48:51 -05:00
Tim Abbott
014b5e8a91
Add a per-request realm filters cache.
...
This avoids doing hundreds of memcached queries in get_old_messages.
(imported from commit 8b64cac3e4e91d46762a13d6812bd3c6f517e9ef)
2013-12-19 14:04:55 -05:00
Tim Abbott
c91415f318
Improve names for per-request display recipient cache.
...
It incorrectly advertises itself as per-process.
(imported from commit faf7ca7374d020058e80249bb16a4c6afbcb3e44)
2013-12-19 14:04:55 -05:00
Steve Howell
7cded2a956
Show realm history on the main activity page.
...
This shows the number of messages sent by humans for the last
eight 24-hour periods, for each realm. "Messages sent" isn't a
perfect metric of activity, but it's easier to query with our
current data model than certain other statistics.
(imported from commit 9de3c479640a0b9dbc017b245dda21d951f4efa4)
2013-12-18 16:01:44 -05:00
Steve Howell
ab9f6b301f
Validate msg_ids in messages_in_narrow_backend.
...
(imported from commit fde39d8766b2de9e41dee52e3372ce4aa27c353b)
2013-12-18 16:00:16 -05:00
Steve Howell
ea42d0bb16
Validate narrow in events_register_backend.
...
(imported from commit 5b873846fece98f7fbf0b6cb6ed5c098e72ac7f4)
2013-12-18 16:00:16 -05:00
Steve Howell
f7ec8cccc7
Validate subscriptions in add_subscriptions_backend.
...
(imported from commit 3d4b669ade135dfa85c01238db110a5e4c1362b2)
2013-12-18 16:00:16 -05:00
Steve Howell
48319f9763
Validate subscriptions in remove_subscriptions_backend.
...
(imported from commit 9cbbaf35791b204c78a56d7598cff9775901c5ed)
2013-12-18 16:00:16 -05:00
Steve Howell
28b5b175a3
Validate messages in update_message_flags.
...
(imported from commit e4905fb0f56f56e5486828eb177493c42a0792f2)
2013-12-18 16:00:16 -05:00
Jessica McKellar
0d7ea7353f
Don't show broken images in digest and missed PMs emails.
...
(imported from commit 92297b4c8f020e30b5c00e93bf32df6e19069dd8)
2013-12-18 14:31:04 -05:00
Jessica McKellar
96ea91056e
Support displaying emoji in digest and missed PM emails.
...
(imported from commit b440da2501ccb6dd95dc79c3fbce1e81b17c38f4)
2013-12-18 14:31:04 -05:00
Jessica McKellar
2f59f69a1f
digest: tweak sender information.
...
(imported from commit fafc54d4b9c9cda447c42f2bd24845aee62624c2)
2013-12-18 14:31:03 -05:00
Steve Howell
be1857ceb3
Add blank line to check_list (cosmetic).
...
(imported from commit 20a9eed98846e976c7fa2cfdb43e25e1c43c850d)
2013-12-18 12:47:32 -05:00
Steve Howell
9df608c612
Validate muted_topics variable in json_set_muted_topics.
...
(imported from commit 1f6250bb170212af9b5f79a4ef07d57cdaab641d)
2013-12-18 12:45:30 -05:00
Steve Howell
6f573feaeb
Add "length" option to check_list validator.
...
(imported from commit 4f8e203f964d1c936fe548b2f77a2e4aae745ae9)
2013-12-18 12:45:29 -05:00
Steve Howell
b2bffc26f9
Validate alert_words is a list of strings.
...
(imported from commit f6776c17ce4fcc84b9a6a75858154837c6122789)
2013-12-18 12:45:28 -05:00
Steve Howell
e7a42ffd02
Add test for /json/set_alert_words.
...
(imported from commit 307d87331870a89713030e8178b1aa14a31cfdfd)
2013-12-18 12:45:28 -05:00
Luke Faraone
0311bf8e4b
Don't crash if prereg_user doesn't have default streams set
...
(imported from commit 8d24ecd1bac801f3b8502116933ed4470f4fad9e)
2013-12-18 11:33:34 -05:00
Steve Howell
b764bb427b
Validate invitee_emails better in json_bulk_invite_users().
...
(imported from commit a446a361677bcb0501d9a340f7b5bb3614c7481b)
2013-12-17 16:24:59 -05:00
Steve Howell
94e3c02649
Add test_bulk_invite_users().
...
(imported from commit bc8ab756dae0fd82e73b5b2a9655974c5fc839b0)
2013-12-17 16:24:59 -05:00
Tim Abbott
3b7bf691e7
Add tool to query our usage stats as of a given date.
...
This contains the various fixes that needed to be made in order to get
accurate statistics.
Most notably, the active_users_between function in the previous
version of zerver/lib/statistics.py was broken for end dates in the
past, because it used the UserActivity table to get its data -- so in
fact it really was querying "users last active between".
This commit isn't super clean, but I figure we're probably better off
having our latest code for historical usage data in git so it doesn't
bitrot and anyone can improve on it.
(imported from commit 24ff2f24a22e5bdc004ea8043d8da12deb97ff2f)
2013-12-17 15:34:44 -05:00
Steve Howell
1c67fdb95d
Move user list unread-count logic to templates.
...
When we rebuild the user list from scratch, set the unread
counts in the templates to avoid multiple DOM updates.
(imported from commit 2d0c9b0fb99b382332e464ba7c3caad95e05363e)
2013-12-17 10:59:25 -05:00
Jessica McKellar
a8cd91d6c7
digest: send emails if you've been active for slightly less than a day.
...
That way if all you do is briefly check Zulip because you got the
email, we'll send you another one tomorrow.
(imported from commit fcbbd264c5e5fea7352f0fee6989e000af7b7bed)
2013-12-17 10:47:17 -05:00
Jessica McKellar
6b64ef6be3
digest: log when we enqueue emails.
...
(imported from commit 1b34e05bc2eebedb818673a4c9a3944e1db15c6d)
2013-12-17 10:47:17 -05:00
Jessica McKellar
71f5b4e0ae
Enable digest emails for zulip.com.
...
(imported from commit f676f96c2b516b33269b8f5c72deaf5c985e8ccd)
2013-12-17 10:47:17 -05:00
Jessica McKellar
1d11e2cce0
digest: don't show new users for MIT.
...
(imported from commit b7453cb30e6fcf5b36a5e3e53f67faeb17e74048)
2013-12-17 10:47:16 -05:00
Tim Abbott
150ca939b1
Disable some buttons in embedded widget.
...
(imported from commit 7d6d4725b139ea71c579dfd7d19c38d7bb11ee44)
2013-12-16 17:46:02 -05:00
Tim Abbott
2276c6e524
Add support for loading a narrows-only embedded Zulip window.
...
Features:
* Only shows messages in the narrow
* New messages in the narrow will arrive as they are sent
* Works even for streams you're not subscribed to
* Automatically subscribes you to a stream on send
* Doesn't update your pointer
* All searches etc. automatically have the narrow added
(imported from commit 2e12b76849f6ca0f53dda5985dad477a04f7bbac)
2013-12-16 17:46:02 -05:00
Tim Abbott
7c829c4024
Extract adding clients to the various dicts to a function.
...
(imported from commit 667e5736710c23becdf4ebe5688a31421ac632f5)
2013-12-16 17:46:02 -05:00
Tim Abbott
af347acf99
Fix narrow stream event queues with all event types.
...
(imported from commit 69c2f6f1be3dd864b5da85104b83235f0dd4df50)
2013-12-16 17:46:02 -05:00
Tim Abbott
28c03e3f0d
Simpify interface for editing/accessing unencoded page_params.
...
(imported from commit c7c7dce2ecc886f4bd9e5da798b1007887e77642)
2013-12-16 17:46:01 -05:00
Tim Abbott
1ca8804468
Fix renaming streams.
...
(imported from commit 63c41d7f1175f132dc835e76362d679f00800d3f)
2013-12-16 10:32:55 -05:00
Steve Howell
3b0a563730
Use REQ(validator=) style for update_subscriptions_backend.
...
(imported from commit 48e16695f7ab9f32b10370751c528dc27583ada7)
2013-12-13 18:23:40 -05:00
Steve Howell
cc2779c80e
Use REQ(validator=) style for event_types in events_register_backend.
...
(imported from commit 3af787fcc87355866107d197ef2c9e9552151a8a)
2013-12-13 18:23:40 -05:00
Steve Howell
a20270dbc7
Use REQ(validator=) style for principals in add_subscriptions_backend.
...
(imported from commit 307ce32cc0c56f8a226244cf1128b1c0633852f7)
2013-12-13 18:19:10 -05:00
Steve Howell
bfb54b5a4d
Add validator support to REQ and has_request_variables.
...
Validators are similar to converters, but they don't have
to parse JSON, and they are told the name of the request
variable to help format error messages.
(imported from commit 3c33e301892519c67e70675006d5686d9f013353)
2013-12-13 18:19:10 -05:00
Steve Howell
60917c83d6
Add test_REQ_converter.
...
(imported from commit 4425c68a532dc8a6db3b76397156c4e9d92a5b44)
2013-12-13 18:19:10 -05:00
Steve Howell
668c0ab529
Validate principals in add_subscriptions_backend.
...
Make sure that principles is a list a of strings (unless it
is None). This includes a unit test.
(imported from commit c2e3f1c0cafc207ceca67d5a174ef4e29a32c6ca)
2013-12-13 18:19:10 -05:00
Steve Howell
7e04b205fa
Add type checking to events_register_backend.
...
(imported from commit bb3ddbfc0e471f276858d47fbdb65c890af41606)
2013-12-13 18:19:09 -05:00
Steve Howell
0cdcf102a0
Validate parameters in update_subscriptions_backend.
...
w/unit tests added
(imported from commit a0c0d779279b35ffc5bf1fbe4c5c5a25af263c10)
2013-12-13 18:19:08 -05:00
Steve Howell
6b70e9ddb7
Add SubscriptionRestApiTest.test_basic_add_delete.
...
(imported from commit 735d6a0657952790de1d58c62cc983320ec402e8)
2013-12-13 18:19:08 -05:00
Steve Howell
4184b9d56f
Add validators.py (with tests).
...
This sets up a scheme to validate complex data structures and
give specific error messages for improperly typed parameters.
(imported from commit 33b2f070d993da4ee929119dd41503bd0128c8eb)
2013-12-13 18:19:07 -05:00
Tim Abbott
7800a34d84
Fix json_unhandled_exception handling of JsonableError.
...
(imported from commit 16ed6c213cbda3b60a16a01af32c56d6802b7acc)
2013-12-13 18:13:43 -05:00