Commit Graph

396 Commits

Author SHA1 Message Date
acrefoot c3543b06f0 Honor exclude_commits for github integration
We weren't before :(

(imported from commit 3691066a50f1b67c227dbfc056dc8cdf2c06eea8)
2014-03-11 13:06:18 -04:00
Zev Benjamin 27aaa3b1bf Rename mit_to_mit -> same_realm_zephyr_user for uniformity and clarity
(imported from commit 74063d6c8bb9e9fbf62c24dcd8a18294b8f7b51f)
2014-03-06 21:59:55 -05:00
Zev Benjamin cc9fe19a9f Special case Jabber mirroring same-realm check for ist.mit.edu
We can't just check that the realms are the same because ist.mit.edu is an open
realm and uses @mit.edu email addresses.

(imported from commit 7dbaa81cea6e4f82563dfc0cfe67a61fe9378911)
2014-03-06 21:59:55 -05:00
Steve Howell e7769d9004 Add back end support for in-home/in-all narrows.
(imported from commit bfa54fbb8c7eaced19e354514536d75c30a24b15)
2014-03-05 14:56:34 -05:00
Jason Michalski 280575aff0 Refactor json_set_avatar and patch_bot_backend to use do_change_avatar_source
(imported from commit eba0ff8a5c4409ac01c710455fe200b28f953b56)
2014-03-05 14:16:20 -05:00
Jason Michalski 64ba85aa19 Refactor regenerate_api_key and regenerate_bot_api_key to use do_regenerate_api_key
(imported from commit 5c54e4771b6730a8ebe304f6b6e86722d28eca8d)
2014-03-05 14:16:20 -05:00
Jason Michalski c17ed8dc8c Add bots to page_params and send events on bot creation
(imported from commit ce418b4f056576d57f82d26af621473c730c12d8)
2014-03-05 14:16:19 -05:00
Jason Michalski 846dfd5105 Update patch bot API to support setting stream defaults
Adds APIs edit a bot's default_to_stream, default_events_register_stream
and default_all_public_streams.

(imported from commit c848a94b7932311143dad770c901d6688c936b6d)
2014-03-05 14:16:18 -05:00
Jason Michalski 50db83508b Add API support for setting defaults in the add bot API
Support setting default_to_stream, default_events_register_stream, and
default_all_public_streams during in the bot creation API.

(imported from commit bef484dd8be9f8aacd65a959594075aea8bdf271)
2014-03-05 14:16:18 -05:00
Jason Michalski f3180b774b [schema] Add default user_profile options for register events
Allow bot owners to set which streams their will receive events for
without needing to change a configuration file.

(imported from commit 2b69e519dbc12ffbdba072031a7f7196c9e50e33)
2014-03-05 14:16:18 -05:00
Jason Michalski de545d5fa0 [schema] Add a default to stream option to user profile
This allows bot owners to configure which streams messages are delivered
to without needing to change webhook URLs or configuration files.

(imported from commit 32a0c26657c145b001cd8cb3ce0a0364d48902ce)
2014-03-05 14:16:18 -05:00
Steve Howell 82a935080d Support has:* searches on the back end.
(imported from commit a6a6f465ce0343d4a5313ee54f6ff427940a03ab)
2014-03-05 13:58:53 -05:00
acrefoot eabd9341b6 Fixup 'force pushed' message when creating branches in Github
Github flags pushes as either `forced` or not. However, it always marks new branches as
forced pushes--but we don't necessarily agree with them. This commit checks for the `created`
flag as well.

This resolves Trac #2346

(imported from commit 960bd3ad707a4d1ad431e21dcd79389e8d4b297b)
2014-03-04 16:42:34 -05:00
Zev Benjamin 5c44fa9a29 Move bulk of get_streams_backend to actions.py
(imported from commit 3601444a2aabd1c613db61d71e6bc9fd6b4984d5)
2014-03-03 17:30:57 -05:00
Zev Benjamin 406e3025fb Recognize new-style client name for Jabber mirror
(imported from commit 3c1f8120f4daa809e0844602bc8bea659837d84e)
2014-03-03 17:29:53 -05:00
Jessica McKellar fae92685ae Convert /json/subscriptions/property to supporting bulk property updates.
This includes removing GET support for the endpoint, which is unused
and doesn't map well to this being a bulk endpoint.

(imported from commit 348ff9dfa84be1661368c6d7d35aebf2ae2a9ae0)
2014-03-03 16:08:33 -05:00
Jessica McKellar 87635b9e32 Convert settings from static HTML to a template.
This will make life much easier for handling update events.

(imported from commit 66b101eb5fae89b4eec6fc797fee8be26ac99bfb)
2014-03-03 16:08:32 -05:00
Jessica McKellar e0bd15669a Don't post checkbox data directly to /json/notify_settings/change.
They have weird properties like not sending anything for unchecked
boxes, which makes it hard to wrap a client-agnostic API around.

(imported from commit fef73a57a55b218b55dab6be3453dd6eac73c789)
2014-03-03 16:08:32 -05:00
Jessica McKellar 53021bf7d3 Pass per-stream notification settings between frontend and backend.
(imported from commit 42e9b80a4c55e0911d457991d53ce71ca31625bb)
2014-03-03 16:08:31 -05:00
Jessica McKellar c673b3b0b1 Pass global stream notification settings between frontend and backend.
(imported from commit 28ec021e8e5166d3b270c81c5a4ad543d2185aa5)
2014-03-03 16:08:30 -05:00
Steve Howell 4bc50c3560 Rename NarrowBuilder.__call__ to add_term().
We also call the objects "builder" instead of "build."

(imported from commit aa3fcedc8eb97c21f29aa651cf1f6852ff311e7d)
2014-02-27 20:25:38 -05:00
Steve Howell c9140a6def Exclude muted streams in exclude_muting_conditions().
If we call exclude_muting_conditions() with a non-stream
narrow, it will now include a condition to exclude streams
that are not in your home view.  As of now, this code only
executes during testing, but it sets the stage for doing
better in:home queries on the back end.

(imported from commit bbd764bd0e9588a50e4a82c915e82a2c1b99d73e)
2014-02-27 20:25:37 -05:00
Steve Howell b822c83b02 Avoid redundant query clauses for muted topics.
If we are already narrowing to a stream, then we can disregard
muted topics in all the other streams and create a simpler query
for the DB to execute.

(imported from commit 35a074a76eec99922034a381741355da3fdd5b39)
2014-02-27 20:25:36 -05:00
Steve Howell fab6b0f7ae Handle non-existent streams in exclude_muting_conditions().
Due to the way we store muted topics, it is possible that a
muted topic stream name may no longer exist, and we need to
handle that case gracefully.

(imported from commit 4d18ec55e45213657a67e160848229678f212765)
2014-02-27 20:25:36 -05:00
Steve Howell 9d21787cd7 Extract exclude_muting_conditions() in messages.py
(imported from commit 97144097406377eb40383c7d1314c74dd713719c)
2014-02-27 20:25:35 -05:00
Leo Franchi b80293c80d JIRA: Show all updated fields as long as one is not truthy
(imported from commit 543204b84a0b5625c4185b9ae32d5a3725cd9f9e)
2014-02-27 20:25:35 -05:00
acrefoot 7390b6ec53 Use 'forced' when available to determine if it's a force-push
(imported from commit afbd1ed2efe2ce86ebd9639d514837211b7517b4)
2014-02-27 20:25:28 -05:00
Zev Benjamin 1a6929d9ae Handle get_old_messages case where num_before = 0 and num_after = 0 and a narrow is specified
Previously, we assumed that num_before or num_after would be always be non-zero
after adjustment for the anchor.  However, we don't adjust num_before or
num_after when a narrow is specified.

(imported from commit 9239fef140e109b11bdfbeef42e9fbed78660ad1)
2014-02-19 12:24:17 -05:00
Jason Michalski 0244b50f0b Split bot deactivation from user deactivation
(imported from commit 153a870b244e040e3b5976f639866dbace5563f6)
2014-02-18 15:09:22 -05:00
Jason Michalski d177f49a96 Change the create bot API to use rest_dispatch
(imported from commit 0fac290be2ed04178c4df866f5bc958441b2d320)
2014-02-18 15:09:20 -05:00
Jason Michalski 9d973ff106 Change get_bots API to use rest_dispatch
(imported from commit 921895dd636ba118a0f57e60a7bcb9dca1c7c605)
2014-02-18 15:09:19 -05:00
Steve Howell ebce82b136 Eliminate json_to_dict and use check_dict instead.
All usages of json_to_dict were replaced with the check_dict
validator.  The check_dict validations can eventually be
extended to validate the keys and values of incoming data,
but now we just use check_dict([]) in all the places where
we had json_to_dict, which means we aren't checking for any
specific keys; we are just making sure it's a dictionary.

(imported from commit fc5add9a7ef149dfac2a9a6d9a153799c4c0c24d)
2014-02-18 13:02:08 -05:00
Steve Howell 3d04f5f738 Use check_list instead of json_to_list.
(imported from commit 9ead12bc2a4744b94a747ca27054124aacde7ae4)
2014-02-18 13:02:08 -05:00
Steve Howell 8b58d8574b Use check_bool instead of json_to_bool.
(imported from commit 52eb892a92e293d6ecb854c51bd7bd32355206c9)
2014-02-18 13:02:08 -05:00
Steve Howell 0b0b9b9379 Remove custom code for customer14.invalid
(imported from commit efdc02e02c0dbdd29a09002897a294b5e820530f)
2014-02-14 11:15:50 -05:00
Leo Franchi acec697fe7 Report unnarrow times as well as narrow times
(imported from commit b3a889aa11dc112508c5a1d213f68e5223a879fc)
2014-02-13 14:45:22 -05:00
Steve Howell 91445035bc Add NarrowBuilder support for negated search conditions.
(imported from commit cdc426e342a6d735d321d78b6753ca5ad7c79c6f)
2014-02-13 14:14:25 -05:00
Steve Howell fb27cbcd01 Handle negated streams in ok_to_include_history.
(imported from commit 0a049364e1d14f45db9f8e9aa5392039a01231eb)
2014-02-13 14:14:25 -05:00
Steve Howell 11ba6a17ab Extract ok_to_include_history() method in messages.py.
(imported from commit a88f5455bf658a8c52c92e7f0bedc301a605020b)
2014-02-13 14:14:25 -05:00
Steve Howell 2fb7c0059d Support negated searches on staging.
Behind a feature flag you can now do searches like this:

    -pm-with:othello@example.com is:private

The "-" in front of "pm-with" tells us to exclude messages
with Othello from our search.  We support "-" in front of
all operators, although the behavior for "-search:" and
and "-near:" doesn't really change in this commit.

Note that the filtering out of "negated" predicates only
happens on the client side in this commit.  On the server
side we ignore negated predicates and send back a superset
of the results.

(imported from commit 6cdeaf32f2d493fbbb838630f0da3da880b1ca18)
2014-02-13 14:14:24 -05:00
Steve Howell 90bb689e13 Extract "cond" local var in NarrowBuilder methods.
This commit doesn't change any functionality, and it is
designed to make diffs for upcoming changes related to
negated conditions a bit easier to read.  This diff
looks a bit noiser than it really is due to some
reindentation of continuation lines.

(imported from commit 64c1cba98faa4bad4eaad122dd3de119caa880c0)
2014-02-12 16:58:07 -05:00
Zev Benjamin 25d461c8f5 Exclude messages on muted topics when finding the first unread message in a narrow
(imported from commit 3151c401f689cc77e53cf34ffc49c7fd7d0a771a)
2014-02-12 16:23:34 -05:00
Steve Howell ea8d9efa00 Support dictionary-style narrows in back end API.
(We continue to support tuple-style narrows as well.)

(imported from commit 0154c1cba7503471b112ce22f280b619133e0211)
2014-02-11 13:15:42 -05:00
Steve Howell a2acce2905 Phase out search tuple data structure in messages.py.
The narrow_parameter convert now converts tuples of
(operator, operand) into dictionaries so that downstream
functions/classes deal in dictionaries.  This
affects get_old_messages_backend, messages_in_narrow_backend,
and NarrowBuilder.

(imported from commit 7e8cb887f7872ec687acd8c4857d1d5222ab0d5f)
2014-02-11 11:52:31 -05:00
Steve Howell 2ad006aac9 Make page_params.narrow be a list of dictionaries, not tuples.
This is part of deprecating the old tuple syntax.

(imported from commit f57fe08e0042792b1381c69d1a7f10f92369e838)
2014-02-11 11:45:44 -05:00
Steve Howell 0366659bee Return stream_id in /json/get_public_streams.
(imported from commit 985d4e01bd3b589d10e57886d159cfdabe594dd4)
2014-02-06 12:09:52 -05:00
Tim Abbott d595714a1c Send Zulip notifications when users fill out our interest form.
(imported from commit 2db4b29df8ac2c4cf1929a3df3015809f3faf895)
2014-02-06 10:25:35 -05:00
Tim Abbott f26af47fb6 Center on-page-load narrows on first unread message.
This implementation is somewhat hackish in large part because I think
we're going to be wanting to redo the get_old_messages API somewhat
soon, and this may naturally become a lot cleaner as a result, but
this isn't a lot of code and fixes #2235 part (A) and substantially
mitigates #1510.

(imported from commit 47a2160a44befa9d83190c5cc95b90e92cc5b4cc)
2014-02-03 13:32:02 -05:00
Jessica McKellar 1c5110dbad Send you a registration email if you try to sign up for an existing realm.
(imported from commit 9104096b424f31a22ee7c8b72378f05309bb978b)
2014-01-31 16:40:19 -05:00
acrefoot 171005a9de Make realm-specific lines in api_github_landing shorter
(imported from commit 0b205256de1b6ad30d42a0aa59bf1fe62ab88847)
2014-01-31 15:51:50 -05:00