Commit Graph

1441 Commits

Author SHA1 Message Date
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 5bb922200a Add test_exclude_muting_conditions() to test_messages
(imported from commit 6b6809f34af0b5802195ae0ac30352a020b871ec)
2014-02-27 20:25:36 -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
Steve Howell f47a3c62e8 Add test_use_first_unread_anchor() test.
(imported from commit e2b4d30730725fd08e76868d9af6f36ddfd3b6f2)
2014-02-27 20:25:35 -05:00
Steve Howell 630187d91b Avoid glitches running single tests involving SqlAlchemy connections.
(imported from commit 90b34ead998e2daf9e73fff867c3efb78076f4e1)
2014-02-27 20:25:35 -05:00
Waseem Daher 243c327d0a Properly preview images from Dropbox photo albums.
Reported by jhurwitz (sorta).

(imported from commit 8ae4c5f7af86c5492842142b89be8cab1a2c3fae)
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
Luke Faraone 7658886b02 email_mirror: Use internal_send_message instead of the API
Previously, the email mirror queue worker used the API bindings to send
messages to Zulip, as if it were any other API client.

This is inefficient since we're running the worker inside the Django
context on a machine with database access; we can instead just use the
internal message-sending functions we use elsewhere. This also resolves
potential issues with SSL certificates, etc. that might occur when we
were previously making a HTTPS connection.

(imported from commit 6de8015829bec440f1af0199a2138828e86ed2a4)
2014-02-27 20:25:33 -05:00
Luke Faraone f304b93b91 Quote "/"s in stream/topic names for digest emails
Previously, digest emails provided links to Zulip that didn't correctly
encode "/" if it occurred in a stream name or topic. By explicitly
specifying «safe=""», we can request that urllib.quote escape such
slashes.

Closes trac #2294.

(imported from commit 2e6334672969d4cf4032d2ea5dc80091af96d672)
2014-02-27 20:25:30 -05:00
Allen Rabinovich 13045f953f Fix casper tests
(imported from commit 9376ba39e827794e0c7bd2404c08d702596786a4)
2014-02-27 20:25:28 -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
Steve Howell 71de0ac565 Add a test for rendering realm-specific emojis in JS.
(imported from commit 5909c02f9a7931f03d7131ae16b5fb70c74746aa)
2014-02-27 20:25:26 -05:00
Steve Howell 7f2f1ad533 Add test coverage for stream_data.home_view_stream_names.
As part of this, I also made test_basics() have a third
stream that makes false positives in the test less likely.

(imported from commit d5ba64ec9346741818e30abe9e9594788c339fab)
2014-02-27 20:25:26 -05:00
Jessica McKellar f9d5a02710 Fix bug that hid digest email settings box for customers.
(imported from commit 6c1e3f53998eca0232fbfe66c62ab87b009bccd8)
2014-02-27 20:25:26 -05:00
Leo Franchi f22885223f Remove message id list from group divs
(imported from commit 620a219b5e11db79bfea971fe40deb09173deb10)
2014-02-27 20:25:24 -05:00
Leo Franchi 7ebe3bf824 Add template unit tests for new message groups
(imported from commit 7e520630b5ae74850fcdd6ecccc114101f9feddb)
2014-02-27 20:25:24 -05:00
Leo Franchi 568c33f294 Render messages as groups of divs instead of individual rows
Now that we no longer use tables for our message list, we can
more logically group messages together.

(imported from commit 9923a092f91a45fe3ef06f2f00e23e4e3fb62a37)
2014-02-27 20:25:23 -05:00
Steve Howell ca92292550 Test people.update() more thoroughly.
(imported from commit 48b1a5af4f3849b7d21960181149dc99b74ba660)
2014-02-27 20:25:21 -05:00
Steve Howell e16da5db45 Add test for people.get_rest_of_realm
(imported from commit 7cda63da29f7764e3932ce677bf3270adb6ea630)
2014-02-27 20:25:21 -05:00
Steve Howell 666252d749 Improve test coverage for get_topic_suggestions.
(imported from commit bba858e1f1f396f42d50e1e823ae0673d8013f53)
2014-02-27 20:25:21 -05:00
Steve Howell ef92c345ea Test that "te" matches "Bob Terry" in search suggestions.
(imported from commit 777b7d554278170765e04fc9e1041826c509e8a2)
2014-02-27 20:25:21 -05:00
Steve Howell 75c3e91a15 Add test_stream_completion() to search_suggestion unit tests.
(imported from commit 84d1b1a7e0a667e3851b46e915a4f87d146013d4)
2014-02-27 20:25:20 -05:00
Steve Howell 2ca0015c0a Cover more variations of narrowing in test_describe()
(imported from commit 145e9f624ea460c62a62f3da2d8e328642c5e2d6)
2014-02-20 11:38:51 -05:00
Steve Howell 55a862cc23 Test that narrow_stream is excluded from filter.public_operators()
(imported from commit 11c38d7108243f1496262a2cce982ec583c41894)
2014-02-20 11:38:51 -05:00
Steve Howell c729965b69 Test negated topic searches in Filter.unparse
(imported from commit 0e1e74b25b7eb1874b93dd7d62e50563caff1ebe)
2014-02-20 11:38:51 -05:00
Steve Howell b67d976809 Add test for parsing negated searches.
(imported from commit 91f79aa9cfdf939f7249c67a37d4420203c2ac63)
2014-02-20 11:38:51 -05:00
Steve Howell 3a9bdec149 Fix false positives in assert_same_operators in filter tests.
(imported from commit 8d15ec1ce113fabafbe791fb1068e4921508abeb)
2014-02-20 11:38:50 -05:00
Steve Howell 47b877357d Fix test to actually test Filter with default parameters.
(imported from commit 55b4557c8742bd2f1c8b1aa1e99a487d581fcfc4)
2014-02-20 11:38:50 -05:00
Steve Howell 1c4dcda639 Add test for in-home search when in our special narrow mode.
(imported from commit e6bc9fbd7b87377c7ed1d42e84a9b5cd369bb4fe)
2014-02-20 11:38:50 -05:00
Leo Franchi 38a4011a52 Return the realm domain if the requesting client requests it
(imported from commit c8e6e388460931076ae3d12b0c5a5dde46b39ffa)
2014-02-20 10:57:35 -05:00
Steve Howell 2a5dd139c8 Add node tests for hashchange.js
(imported from commit 20309e13dfea28400341e30a42e8f775479de773)
2014-02-19 16:19:16 -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
Steve Howell 8ce5404777 Describe negated search terms correctly.
This changes Filter.describe and Filter.operator_to_prefix
to handle negated terms correctly.

(imported from commit 673c0d3a5a77784e95772c14e12534ad2daecda2)
2014-02-19 11:05:31 -05:00
Steve Howell e645574b14 Add more test coverage to Filter.describe()
(imported from commit 9249af23e19b307f2ae168227aa73bba56b1a991)
2014-02-19 11:05:30 -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
Jason Michalski 320c2b8eaf Fix casper tests for redesign
Commit "ecf0eb85 Redesign styles for message pane" removed the
right_part class, updates the tests to not use it.

(imported from commit 277eb3748913895b13ab7bdca11e668033c9f9b3)
2014-02-18 12:50:31 -07:00
Steve Howell de8509e40d Fix broken template test.
(imported from commit a5d935ab84fd16d5fb83ff25fd773b251486c5cd)
2014-02-18 12:50:31 -07:00
Steve Howell 8bae4d746d Remove unused json_to_list function.
(imported from commit 9da59ee4edd3c569f798710267db5400b9abdb30)
2014-02-18 14:24:04 -05:00
Steve Howell 4bc76b2d6d Handle more types of data in extract_recipients.
We now allow the list of recipients to be sent as a
comma-delimited string with optional JSON encoding.

(imported from commit e928b037bbd258348eb5b2ecca486d0bb77f593e)
2014-02-18 14:24:04 -05:00
Steve Howell 6edb758136 Add test_extract_recipients.
(imported from commit 13a5d1287fd489664c7f667d5b75a513f5f744c1)
2014-02-18 14:24:03 -05:00
Steve Howell bbfd33185c Remove narrowing options from message chevron menu.
Remove the options to narrow by topic/person from the menu,
because there are better ways to do this in the UI, and
remove the time travel option, because the "Link to this
conversation" achieves mostly the same effect.

(imported from commit b7e0cfe64c0760e5a7bf7a8c9c05ed1a5b747300)
2014-02-18 13:19:39 -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
Jason Michalski fa285fd1a9 Use case insensitive matching when linkifying tweets
(imported from commit c8a897f05a79a2b23998ffe186c77a9f7af4ae7f)
2014-02-15 15:33:22 -05:00
Leo Franchi 54e24a5765 Disable push notifications regardless of idle status for zulip.com
(imported from commit a1a1d551b7bf1423ecb31cf6a230f59c888a8a82)
2014-02-14 13:35:27 -05:00