Commit Graph

1919 Commits

Author SHA1 Message Date
Tim Abbott
e9158dd520 lint: Clean up E121 PEP-8 rule. 2017-01-23 21:02:39 -08:00
Tim Abbott
6f0d2a9445 lint: Clean up E115 PEP-8 rule. 2017-01-23 20:55:37 -08:00
Tim Abbott
22d1aa396b lint: Clean up W503 PEP-8 warning. 2017-01-23 20:50:04 -08:00
Tim Abbott
bde2da7dfd lint: clean up PEP-8 W391 rule. 2017-01-23 20:39:02 -08:00
Tim Abbott
0f7f9dc0fb update_message_backend: Log number of changed messages.
This will be helpful for debugging potential performance problems.
2017-01-23 17:22:40 -08:00
Rohith Asrk
9088c46e4c templates: Fix filename ending with .html.txt.
Fixes a part of #3136.
2017-01-21 22:44:13 -08:00
Tim Abbott
00d48bff7d Digest: Fix URIs for emoji and friends in email links.
It turns out we were using malformed URLs in the image tags
(containing just a hostname, but no http(s)!) in what we were passing
to the Django templates for our digest/, which resulted in the Django
templates treating these URLs as http.  Gmail recently cracked down on
loading images in HTTP, causing the emoji links to appear broken in
emails Zulip sends.

Fixes #3258.
2017-01-21 22:25:51 -08:00
Tim Abbott
c0c9dfb66d populate_db: Fix crash by removing do_send_message.
This old helper has for years been used only by populate_db, and got
buggy (as of a recent refactoring).  So we just call do_send_messages
directly instead.

Fixes the provisioning error we currently get in Travis CI.
2017-01-21 22:07:36 -08:00
Steve Howell
4ea7e80be1 Change our_person() in apply_events() to use user_id.
This is a pretty minor change, but it makes it clear that we
have user_id in all the relevant states/events, so we might as
well use that for the check, since email is mutable and
slightly more difficult to reason about.
2017-01-21 21:45:12 -08:00
Steve Howell
e2afab142a Add user_id to payload for is_admin updates. 2017-01-21 21:45:12 -08:00
Steve Howell
1137ef4e40 Mark up mention buttons with data-user-id on the backend.
We use data-user-id now in the buttons for at-mentions when
we render messages.  A previous commit already made the front
end support this new style.
2017-01-21 21:45:12 -08:00
Tim Abbott
5d52f1ec17 bugdown: Move realm_filters_key logic out of callers.
This gets rid of the confusing duplicate realm_filters_key and
message_realm arguments that previously were passed to bugdown.
2017-01-21 21:37:57 -08:00
Sampriti Panda
34a4a1378d bugdown: Use specified realm, not sender realm, for rendering.
This changes bugdown to use the realm passed in by the caller (if any)
for rendering, fixing a problem where bots such as the notification
bot would have their messages rendering using the admin realm's
settings, not the settings of the realm their messages are being sent
into.

Also adds a test for the notification bot case.

Fixes #3215.
2017-01-21 21:37:57 -08:00
Tim Abbott
01e0acb282 render_incoming_message: Require a realm object. 2017-01-21 21:37:57 -08:00
Tim Abbott
76509a251b do_send_message: Pass the realm object in. 2017-01-21 21:37:57 -08:00
Tim Abbott
bc138f72f4 render_markdown: Refactor realm_filters_key logic.
This moves the realm_filter_key variable, primarily used for clarity,
up from Bugdown into the render_markdown function.

We'll need this for the upcoming commits.
2017-01-21 21:37:57 -08:00
Tim Abbott
99c5563bc6 internal_send_message: Make realm argument mandatory.
A lot of care has been taken to ensure we're using the realm that the
message is being sent into, not the realm of the sender, to correctly
handle the logic for cross-realm bot users such as the notifications
bot.
2017-01-21 21:37:30 -08:00
Tim Abbott
8ba7d2080c internal_prep_message: Make realm argument mandatory.
In order to correctly handle messages sent by cross-realm bots, we
need to specify the realm that the messages are being sent into in the
send message code path.  The commit and its successors convert that
code path to include the realm the message is being sent to explicitly.
2017-01-21 21:16:18 -08:00
Tomasz Kolek
cc13104780 Add Zapier integration. 2017-01-20 10:43:18 -08:00
Tim Abbott
42612161df tornado: Remove unused caching code. 2017-01-19 16:36:31 -08:00
Yago González
ade5e762fb integrations: Add documentation for OpenShift. 2017-01-17 16:04:55 -08:00
Umair Khan
378bab6304 Create validate_email function. 2017-01-17 15:49:35 -08:00
Umair Khan
9fecbcecf5 subdomains: Don't show login page on root aliases. 2017-01-17 15:29:24 -08:00
Tommy Ip
c407919db3 Add /authors page.
Contributor visualization showing the avatar, user name and number
of commits for each contributors. The JSON data would be updated
upon deployment, triggered by the `update-prod-static` script.
2017-01-17 13:35:55 -08:00
Tim Abbott
19cb5013d3 emoji: Extract zerver.lib.emoji. 2017-01-16 23:45:28 -08:00
Tim Abbott
19b89eb050 bugdown: Rename realm_id to realm_filters_key.
This should substantially improve the clarity of the code, since
inside bugdown, this is only being used as a hash key that happens to
usually be a realm ID, not used as a Realm ID.
2017-01-16 21:48:55 -08:00
Rafid Aslam
b4c02edc6b create_user: Remove Python 3 related hack about bot_owner.
This commit reverts commit "29673411df8dffd50198c0f01c5db8561a782adf"
due to the bug is not reproducible anymore (it seems likely this was a
bug in Django fixed between Django 1.8 and 1.10).

Fixes #1297.
2017-01-14 12:22:38 -08:00
JefftheBest1
a549ed6e65 Removed accommodate typos 2017-01-12 04:53:31 -08:00
JefftheBest1
f0afa3e8df Fixed typos with receive 2017-01-12 04:52:44 -08:00
Tim Abbott
3f8d4193da lint: Fix % comprehensions being used without a tuple. 2017-01-09 11:45:11 -08:00
Rishi Gupta
89af775e03 test_classes: Remove domain from ZulipTestCase.register. 2017-01-06 19:45:08 -08:00
Rishi Gupta
021c65a656 test_classes: Remove domain from ZulipTestCase.submit_reg_form_for_user. 2017-01-06 19:45:08 -08:00
Harshit Bansal
ceb636dbd9 Manage allowed domains from admin settings.
Fixes: #1867.
2017-01-06 12:03:31 -08:00
Rishi Gupta
f5d5b2525c notifications.py: Change email template file endings from .text to .txt.
We use .txt for all other emails (i.e. ones that don't go through
notifications.py) in the codebase.
2017-01-06 10:42:28 -08:00
Rishi Gupta
8a07545afb Rename digest_email_txt.html to digest_email.html.
The .html file ending is clearer and more in line with our other
email files.
2017-01-06 10:42:28 -08:00
Rishi Gupta
8d038eef2f digest emails: Move the subject line to a templates/ file.
To match how we do the subject line for the emails in followup/ and
invitation/.
2017-01-06 10:42:28 -08:00
Brock Whittaker
b976e179e6 css: Restyle Open-Graph Links.
This styles open-graph links to be cleaner and smaller.
2017-01-05 16:15:01 -08:00
Steve Howell
99b5c00ec1 Add stream id to message dictionary.
We now pass the stream id in the messages we send to
our clients.
2017-01-05 15:32:45 -08:00
Bojidar Marinov
5fc65efd69 messages: Allow rendering message content without having an actual message.
This is useful for doing rendering in the emoji search code path.
2017-01-05 15:16:43 -08:00
Jackson
032b5e9db9 integrations: Add webhook code, API endpoint, and tests for Delighted. 2017-01-05 10:47:30 -08:00
Rishi Gupta
2b0a7fd0ba Rename models.get_realm_by_string_id to get_realm.
Finishes the refactoring started in c1bbd8d. The goal of the refactoring is
to change the argument to get_realm from a Realm.domain to a
Realm.string_id. The steps were

* Add a new function, get_realm_by_string_id.

* Change all calls to get_realm to use get_realm_by_string_id instead.

* Remove get_realm.

* (This commit) Rename get_realm_by_string_id to get_realm.

Part of a larger migration to remove the Realm.domain field entirely.
2017-01-04 17:12:23 -08:00
Vamshi Balanaga
234310bfd1 integrations: Add webhook code, API endpoint, and tests for solano labs. 2017-01-03 20:18:34 -08:00
Rishi Gupta
cf762eaf84 Change X.realm.id to X.realm_id across codebase.
This makes it more clearly the pattern in the Zulip codebase, and thus
decreases the risk of accidentally doing database queries.
2017-01-03 16:46:26 -08:00
Rishi Gupta
caccf8ee17 Remove models.get_realm(domain). 2017-01-03 16:46:15 -08:00
Rishi Gupta
b206d6f251 message.py: Change domain to realm_id in render_markdown args. 2017-01-03 16:46:14 -08:00
Rishi Gupta
c6e12e74be Change domain to realm_id in bugdown and realm filter dicts and caches. 2017-01-03 16:25:20 -08:00
Rishi Gupta
be6f54d7bb messages.py: Add sender.realm.id to MessageDict. 2017-01-03 16:25:20 -08:00
Tim Abbott
3a9a6308fd Fix per-user database queries for emoji reactions.
This was a classic database-queries-in-loop bug.
2017-01-03 10:53:26 -08:00
Umair Khan
b6cb6a4f0c ldap: Inherit FakeLdap exceptions from ldap. 2016-12-30 16:55:06 -08:00
Jackson
aeac3848c8 integrations: Add webhook code, API endpoint, and tests for HelloSign. 2016-12-30 14:19:31 -08:00