Commit Graph

15142 Commits

Author SHA1 Message Date
Tim Abbott 56cecc4891 users: Verify full names explicitly in user creation.
This fixes an issue where users could be created with an invalid name
(introduced only a couple commits ago when we added character set
restrictions).
2017-02-07 19:54:30 -08:00
Tim Abbott 2283b5fc91 users: Consolidate name change enforcement logic.
This has the side effect of fixing an issue where one could edit a
bot to have an invalid name.
2017-02-07 19:45:21 -08:00
Ritwik Srinivas 74b68f6bbc Adds banned characters in name function
Disallows you from putting the characters @, *, `, and > and " in
your name. Added test cases similar to the MAX_NAME_LENGTH check

Copied initial code from:
https://github.com/zulip/zulip/pull/2473
2017-02-07 19:31:14 -08:00
Jackson dcca54e8a9 integrations: Add Greenhouse integration. 2017-02-07 19:08:35 -08:00
Rishi Gupta 18508ca02c stats.js: Clean up code for the number of users chart. 2017-02-07 18:55:35 -08:00
Rishi Gupta ac42ad0322 stats.js: Replace font and button colors with variables. 2017-02-07 18:55:35 -08:00
Rishi Gupta 5f2c70c61f stats.js: Refactor code for the two pie charts.
Also fixes a bug where we didn't probably update the labels when clicking on
the Me/Everyone/10/30/Cumulative buttons.
2017-02-07 18:55:35 -08:00
Rishi Gupta 9901128b33 stats.js: Change how we set the precision for percentages close to 100%. 2017-02-07 18:55:35 -08:00
Rishi Gupta 5f7cb9db16 stats.js: Reorder code to match the order of the charts on /stats. 2017-02-07 18:55:35 -08:00
Rishi Gupta 796ac7bfe6 stats.js: Remove the throw_error helper function. 2017-02-07 18:55:35 -08:00
Umair Khan 41aa07adb6 change-email: Delete email caches on email change. 2017-02-07 18:43:26 -08:00
Umair Khan f4b242e707 Add time validation for email confirmations.
Adds a function which returns the number of days for which
a confirmation link will remain valid. This function can be
overridden by derived classes to provide a different value.
2017-02-07 18:43:26 -08:00
hackerkid 8b2d4f150a Vagrantfile: Add support for a custom post-provision script.
Documentation tweaked by tabbott.

Fixes #3108.
2017-02-07 18:38:07 -08:00
Tim Abbott cf4faf6598 docs: Clarify that non-webhook integrations need documentation too. 2017-02-07 18:24:35 -08:00
Feorlen 78b9b83650 Create new webhook walkthrough page from the integration guide.
Breaks out the Hello World example to create a new
webhook-walkthrough.md. Includes minor edits so the two docs
read well. Adds the new page, "Webhook walkthrough", to the TOC.

Fixes #3498
2017-02-07 18:22:31 -08:00
Feorlen 676f0ad63f Add WordPress webhook.
Adds a new webhook integration for WordPress blogs. Both WordPress.com
and self-installed blogs are supported, with minor differences that
are described in the documentation. It creates a new message for each
action, the stream and topic may be specified or use default values.

WordPress actions supported:

publish_post:  a new blog post was published
publish_page:  a new page was published
user_register: a new user account was created
wp_login:      a user logged in

Notes: comment_post only provides the id of the parent post, not title
or link, so was not included. On further testing, I found edit_post is
not very practical, it also fires while a new post is being written, and
when posts are deleted. (I think it tracks drafts too.) I've removed it,
as it seems more confusing than useful.

Fixes #3245
2017-02-07 18:14:31 -08:00
Steve Howell e6bcc01c33 email -> id: Make browser's filter for "sender" more robust. 2017-02-07 17:37:05 -08:00
Steve Howell 64125a76e2 Use data-user-id for message popover menu. 2017-02-07 17:37:05 -08:00
Steve Howell ae850fdeb4 Use message.sender_id to create URLs in message popover. 2017-02-07 17:37:05 -08:00
Steve Howell 44f155e7b2 Generate message.pm_with_url more directly from ids.
We have added people.pm_with_url(message), which computes a
PM url from a private message using user ids rather than emails.

We call this in add_message_metadata(), since the slugs will
be valid even if emails change, so we don't need to compute
them on the fly during message rendering.
2017-02-07 17:37:05 -08:00
Harshit Bansal 8ed0e09c1f subs.js: Make `redraw_privacy_related_stuff()` a global function. 2017-02-07 17:02:16 -08:00
Rishi Gupta e0cb009f1b analytics: Refactor and clean up messages_sent_over_time. 2017-02-07 15:35:43 -08:00
Rishi Gupta 3c692684a0 analytics: Move stats.js out of portico/.
stats.js is a logged-in view.
2017-02-07 15:35:43 -08:00
Tim Abbott cf87f7cd38 find_team: Automatically focus the target input box. 2017-02-07 15:29:51 -08:00
Tim Abbott 92979e3aac find_team: Show development environment email reminder. 2017-02-07 15:29:38 -08:00
kpdp cda7faee83 compose: Fix the compose box not resizing when restoring drafts.
Fixes #3592.
2017-02-07 14:41:44 -08:00
Elliott Jin 9b854c62bc search_suggestion: Suggest multiple people in `pm-with` searches.
Currently, searching for group private messages requires typing each
person's email individually.  This change improves the typeahead
suggestions for group `pm-with` searches by suggesting additional people
whenever a comma is entered.

Fixes: #3575
2017-02-07 14:13:29 -08:00
Tim Abbott 7badc39b02 reactions: Fix exceptions reacting to locally echoed messages.
Previously, we were incorrectly not updating the data-message-id used
in the .message_reactions section to use the final ID when
echo.reify_id was called.

This meant in particular that if someone else reacted to a message you
sent, and you clicked it to share the reaction, you'd get an exception.
2017-02-07 14:13:29 -08:00
Tim Abbott d98c19ca98 lint: Include pep8 checks in pre-commit hook. 2017-02-07 13:22:01 -08:00
Tim Abbott 20096dfe0d lint: fix PEP8 issue with logging_handlers.py. 2017-02-07 13:22:01 -08:00
Eklavya Sharma de6884c406 Change True to 'True' in requests.get params.
According to stubs from mypy 0.4.7 onwards, `requests.get` takes
a parameter `params` of type `Dict[AnyStr, AnyStr]` where `AnyStr`
can be either bytes or text.  Actually, requests can accept values
of other types in dicts too but it casts them to a string type.

So to avoid type checking error messages, change `True` to `'True'`.
2017-02-07 12:55:25 -08:00
Tim Abbott ba5f454be5 puppet: Extract zulip::analytics.
I'm not altogether happy with this (a better solution would be
database-level locking), but I think it solves the immediate problem
of folks with 2 servers being very likely to run analytics on both of
them.
2017-02-07 12:29:15 -08:00
Tim Abbott f79bced276 logging: Fix recursive exceptions with too large files.
This resolves another new exception in Django 1.10 that now can happen
in our error reporting code path.
2017-02-07 12:28:54 -08:00
Tim Abbott 1005d70ff5 update-prod-static: Fix incorrect ordering of venv setup code.
We should check if we succeeded in using a venv only after we've
actually setup sys.path to use it.
2017-02-07 11:49:31 -08:00
Tim Abbott b809646854 Add release notes from Zulip Server 1.5.1.
Also update version.py to reflect that everything in 1.5.1 is in this
branch.
2017-02-07 11:40:49 -08:00
Tim Abbott ec52322ae1 stats: Include Zulip and realm name in heading. 2017-02-07 11:22:57 -08:00
Tim Abbott ac5c505d3c analytics: Make page-content full height. 2017-02-07 11:17:16 -08:00
Rishi Gupta a99f5ca066 analytics: Update bar colors on message_sent_over_time. 2017-02-07 11:07:51 -08:00
Rishi Gupta cd2205ac94 analytics: Remove portico header and footer from stats.html. 2017-02-07 10:49:57 -08:00
Tim Abbott 31d4f99573 upgrade: Stop trying to copy node_modules out of tarballs.
Now that we no longer use node_modules at all in production (it's only
used to generate static assets), we don't include `node_modules` in
the production tarballs, and thus we shouldn't attempt to copy
`node_modules` out of the production tarballs when installing.

Fixes a regression introduced in
d71f2e7b9b.
2017-02-07 10:39:31 -08:00
Tim Abbott fee394f7b6 roadmap: Mark a bunch of projects as completed. 2017-02-07 10:12:01 -08:00
Rohitt Vashishtha 7a174791f1 api: Add support for Environment Variables.
This adds support for controlling the basic configuration (user, API
key, etc.) of the Zulip API bindings via environment variables.

Fixes #3364.

Tweaked by tabbott to update variable names and document in README.md.
2017-02-06 22:56:59 -08:00
khantaalaman ee0b16b1ef Update Font Awesome to version 4.7.0.
Fixes #3329.
2017-02-06 22:45:02 -08:00
Steve Howell 5b8e217bf4 Add people.update_email().
The function people.update_email() is not yet connected
to anything, but it sets the stage for upcoming changes.

When emails get updated, fundamentally we just update
the appropriate person object and add a new key to
people_dict.  We sort of get a shim for free--old email
lookups will continue to work--but we add blueslip warnings
for stale lookups.
2017-02-06 22:38:22 -08:00
Steve Howell 0555970fae message_store: Populate sender_email based on people.js.
Messages that come to us from the server may have an out
of date sender email, so we use message.sender_id and
people.js to get the current email.
2017-02-06 22:38:22 -08:00
Steve Howell a8f706b1b5 refactor: Use user_id as key for people.realm_people_dict. 2017-02-06 22:38:22 -08:00
Steve Howell 2ed85263c8 refactor: Use user_id as key for people.cross_realm_dict. 2017-02-06 22:38:22 -08:00
Steve Howell 955b85f515 Use user_id to check if a message has a new person.
This prepares us for the upcoming ability to update
emails.
2017-02-06 22:38:22 -08:00
Steve Howell d01493bc42 refactor: Use user_id as key for pm_recipient_count.
We now key people.pm_recipient_count by user_id, which makes
one less dictionary that we'll need to update when we support
email updates.
2017-02-06 22:38:22 -08:00
Steve Howell 08bc69f8af huddles: Calculate huddle strings more robustly.
We now build huddle strings used in activity.js from
user ids in message.display_recipient.
2017-02-06 22:38:22 -08:00