Commit Graph

22038 Commits

Author SHA1 Message Date
rht c77c2f084c
upgrade-zulip-from-git: Fix rerun script and script description. 2017-10-18 04:41:22 +02:00
Steve Howell 5a77a4d122 Inline muting_ui.mute_topic and unmute_topic.
These methods were only called by similarly named methods, so
it was kind of a confusing API, and they didn't really
encapsulate anything useful.
2017-10-17 17:41:21 -07:00
Steve Howell dea1888022 Fix muting_ui.persist_and_rerender() bug.
We were calling muting_ui.persist_and_rerender(), but
that function no longer exists.  Now we use the simpler
API.
2017-10-17 17:41:21 -07:00
Brock Whittaker 7cb7158a42 /help/: Re-add perfectScrollbar for sidebar and markdown.
This adds back the perfectScrollbar for the sidebar and markdown
sections because we already lost CTRL-F functionality, so we may
as well bring back the pretty, non-obtrusive scrollbars.

This updates the scrollbar after a successful `slideToggle` of
one of the sidebar sections.

Fixes: #6999.
2017-10-17 17:14:36 -07:00
Tim Abbott 7d3e3ff78c apps: Link to Electron app version 1.5.0. 2017-10-17 16:44:20 -07:00
Eeshan Garg 46132dade2 integrations: Distinguish between static/ URLs and logo file paths.
Previously, to check whether a logo file existed, we simply took
the static/ URL for the logo and treated it as a file path. This
led to problems when static/* was not the correct parent directory
for our static files (for example, when settings.PRODUCTION = True).

Now, we treat URLs and file paths differently and the logo file
path is constructed by joining settings.STATIC_ROOT and the
relative path to the logo file.

Fixes #7018.
2017-10-17 16:26:19 -07:00
Shubham Dhama d6a34c7a0c composebox_typeahead: Start emoji typeahead with single letter.
This changes the behaviour of the typeahead in the compose box to
start appearing with single letter lying in the range of a-z or '+'.

This is a nice solution, because all emoji names start with lower-case
letters, while most emoticons like :P use a capital letter or similar.

Fixes: #6808.
2017-10-17 16:06:13 -07:00
rht 3e258d11e0 Travis: Use travis.yml built-in way to install moreutils. 2017-10-17 09:59:59 -07:00
Darshan Chaudhary 289387ff64 travis: Fix link to docs on our Travis CI setup. 2017-10-17 09:27:04 -07:00
Steve Howell 6fbaf7e80f Remove sender-related fields from message cache.
This change makes the cache entries smaller for message
dictionaries.  It also ensures we get valid data put into
message dictionaries if, for example, the sender's avatar
changes.

After this change, all of the attributes for a message
sender are only fetched during post-processing with two
exceptions:

    * We get sender_id for "free" from the message,
      and it's the primary key that we need to figure
      out which data to fetch in post-processing.

    * We need sender_realm_id to be able to cache topic
      links, and a sender's realm id will never change,
      so it's not a concern for invalidating cache rows.

All the other attributes are either likely to change (e.g.
sender avatar_version) and/or impact the size of cache
entries more severely than the two small id fields above.

This change should improve our overall system performance
by reducing the amount of memory used by every N message
rows we cache, and typically N will be in the thousands or
so on a large realm.

The other major implication of this change is that when
a user changes their avatar, and then later messages that
the user sent are fetched, all of the fields that go into
computing the avatar url will be pulled from the database,
not from cache.
2017-10-16 23:37:10 -07:00
Steve Howell 33338f78e9 tests: Make test_bulk_message_fetching() more thorough.
We include the post-processing step when counting queries now.
2017-10-16 23:37:10 -07:00
Steve Howell d909355dc2 refactor: Move methods from models.py -> lib/messages.py.
Message.get_raw_db_rows is moved to MessageDict, since its
implementation details are highly coupled to other methods
in MessageDict.

And then sew_messages_and_reactions comes along for the
ride.

We eventually want to move Reaction.get_raw_db_rows to there
as well.
2017-10-16 23:37:10 -07:00
Steve Howell 4919eb4abd Extract MessageDict.set_sender_avatar().
We now populate the avatar url as part of the post
processing step of building message dictionaries,
so that the avatar url is no longer in cache.

This change makes the cache slimmer, because instead
of caching the avatar url (which often includes a long
hash), we just cache the smaller fields that are used
to compute the url.

Note that this commit still has the problem that we're
essentially computing the avatar url from cached fields
that can be invalid.  We will address that a few commits
later.

An immediate benefit of this change is that how we compute
avatar urls (or whether we compute them all) is now decoupled
from caching concerns.  We will address this later as
well.  (Some clients will be capable of computing their
own gravatar urls, for example.)
2017-10-16 23:37:10 -07:00
Steve Howell 3c6cc3d454 Defer deleting intermediate values in message dictionaries.
We're about to have multiple post-processing stages for building
message dictionaries.  Rather than having individual "hydration"
methods remove intermediate values, we just wait until the end.

This decouples the hyrdration steps.  The potentional problem
here is that we may have a field like sender_is_mirror_dummy
that isn't part of the final payload, but we need it for
calculating display recipients and avatars.  We don't want to
delete it too early from the objects.
2017-10-16 23:37:10 -07:00
derAnfaenger 87468f46ae queue processors: Test flow through UserActivityIntervalWorker.consume(). 2017-10-16 23:20:13 -07:00
derAnfaenger ad0407578d queue processors: Test flow through UserPresenceWorker.consume(). 2017-10-16 23:20:13 -07:00
derAnfaenger af699500b7 tests: Add option to call queue processor consumer.
This makes tests of queue processors more realistic,
by adding a parameter to `queue_json_publish` that
calls a queue's consumer function if accessed in a test.

Fixes part of #6542.
2017-10-16 23:20:13 -07:00
Priscilla 22ade4f691 docs: Fix typo on "General user guide documentation".
"browsing" on line 11 was missing an "s".
2017-10-16 22:37:34 -07:00
Vishwesh Jainkuniya dab029b817 Update hotkeys in filter stream and search people option titles.
We swapped the function of these hotkeys, but forgot to update these:

* left_sidebar: Update hotkey to 'q' in filter stream option title.
* right_sidebar: Update hotkey to 'w' in search people option title.
2017-10-16 22:27:51 -07:00
Eeshan Garg fb17481a7f webhooks/gci: Support claim, comment, submit, approve event types. 2017-10-16 22:01:19 -07:00
Greg Price 37f01add7e errors: Point to upstream 400-handling bug in our workaround. 2017-10-16 11:17:10 -07:00
Brock Whittaker a768ed548c /for/*: Restyle /for/ and /why/ pages.
This restyles them to be more readable and more put together
than before by changing the line heights, text colors, and padding.
2017-10-16 09:58:13 -07:00
Tim Abbott b5c107ed27 push_notifications: Remove unnecessary check for no devices.
This should have been checked by the caller anyway.
2017-10-13 17:30:20 -07:00
Tim Abbott 27a450b58d push_notifications: Improve error message for GCM sending issues.
This addresses one of the sources of confusion in #6993.
2017-10-13 17:30:11 -07:00
Umair Khan a48a86237d ldap: Change logging level to warning.
Fixes #6960.
2017-10-13 17:13:18 -07:00
Umair Khan 490515aea6 cleanup: Fix comment in SocialAuthMixin.auth_complete. 2017-10-13 17:13:18 -07:00
Mohd Ali Rizwi 5cfc56e772 docs: Updated bite-size label name in README.
This label got renamed to "good first issue" thanks to GitHub, and we updated
the link, but not the text.
2017-10-13 15:06:36 -07:00
Rishi Gupta 70cf4991da docs: Add notes on audience to user-docs.md. 2017-10-13 11:59:20 -07:00
Harshit Bansal 7d5bcf5534 notifications: Use lxml instead of hacky regexes to scrub inline images. 2017-10-13 16:13:58 +00:00
Harshit Bansal 8d42f42ef2 notifications: Correctly convert relative narrow links to absolute URLs. 2017-10-13 15:44:47 +00:00
Garvit Dewan b0235bc458 dependencies.md: Fix a typo. 2017-10-13 07:11:29 -07:00
Tim Abbott daeb4e0ca3 docs: Fix link to bite-size issues to point to new name. 2017-10-12 23:09:02 -07:00
Greg Price b095463f9b logging: Clear out the Django default config on logger `django`.
By default, Django sets up two handlers on this logger, one of them
its AdminEmailHandler.  We have our own handler for sending email on
error, and we want to stick to that -- we like the format somewhat
better, and crucially we've given it some rate-limiting through
ZulipLimiter.

Since we cleaned out our logging config in e0a5e6fad, though, we've
been sending error emails through both paths.  The config we'd had
before that for `django` was redundant with the config on the root --
but having *a* config there was essential for causing
`logging.config.dictConfig`, when Django passes it our LOGGING dict,
to clear out that logger's previous config.  So, give it an empty
config.

Django by default configures two loggers: `django` and
`django.server`.  We have our own settings for `django.server`
anyway, so this is the only one we need to add.

The stdlib `logging` and `logging.config` docs aren't 100% clear, and
while the source of `logging` is admirably straightforward the source
of `logging.config` is a little twisty, so it's not easy to become
totally confident that this has the right effect just by reading.
Fortunately we can put some of that source-diving to work in writing
a test for it.
2017-10-12 22:45:14 -07:00
Tim Abbott 9ae506ac0e compose: Enable mention syntax when editing messages.
We had been waiting on doing this for a long time to make sure the
feature actually did what it was supposed to (completed last week);
this change adds the typeahead to ensure it actually works.

While we're fixing this, we remove the split between the edit and
compose code paths for typeahead, which is good, because we'd already
accidentally added the syntax-highlighting feature in only one place.

Fixes #195.
2017-10-12 18:08:32 -07:00
Tim Abbott 1d314c3bf4 bugdown: Remove ERROR_BOT markdown rendering notices.
Nobody has used this feature in years, and it causes certain types of
markdown issues in development to completely DoS the development
environment by making it possible for the "Bugdown timeout" exception
handler to timeout in bugdown.

Since we already send an email to the server administrators, there's
no need to replace this feature with anything.
2017-10-12 17:45:33 -07:00
Tim Abbott a466bf8a47 report: Fix handling of reports with no more_info. 2017-10-12 17:38:28 -07:00
Steve Howell e0bc1b114e Make sure mentions refer only to active users.
An active user can share the same full name as a deactivated
user.  We now only allow mention syntax to find users who are
activated.

Fixed #6978
2017-10-12 17:11:36 -07:00
Brock Whittaker 4ab8337b2b message-feed: Normalize padding for topic headers.
This normalizes the padding on the sides of the topic headers to
all be 6px on the left and right for both PMs and for streams.
2017-10-12 14:25:40 -07:00
Brock Whittaker 33c1755c69 message-feed: Remove visually unappealing top border.
This removes an unecessary and unappealing top border to the
message headers while keeping all else the same.
2017-10-12 14:25:40 -07:00
Steve Howell 52299ce987 Highlight alert words in mentions you send to yourself.
Fixes #6946.
2017-10-12 14:03:36 -07:00
Steve Howell a9d25f8719 refactor: Simplify avatar_url.
This function is now a thin wrapper around get_avatar_field.
2017-10-12 14:00:41 -07:00
Steve Howell b0e844c676 refactor: Use get_avatar_field in message.py.
This is part of deprecating avatar_url_from_dict and
eventually supporting the client_gravatar field in
message-related requests from clients.
2017-10-12 14:00:41 -07:00
Steve Howell a6c3621f55 Support client_gravatar in /json/users endpoint. 2017-10-12 14:00:41 -07:00
Steve Howell 1fc6a5febc Add get_avatar_field() function.
This function is designed to replace avatar_url() and
avatar_url_from_dict() over time.

There are a few things new about it:

    * We make the parameters more explicit, rather than
      passing in an opaque dictionary or requiring a
      UserProfile object.  (A lot of our callers want
      to use `values()` for efficiency sake, since we
      are often doing bulk user operations.)

    * We start to support the client_gravatar option.
2017-10-12 14:00:41 -07:00
Tim Abbott 498d061e5e docs/email: Document how to use a Gmail account with 2FA.
Fixes #6974.
2017-10-12 11:38:01 -07:00
Tim Abbott aaf1cf848a docs/email: Clarify discussion Django's EMAIL_HOST_PASSWORD.
This fixes the second part of #6974 about EMAIL_HOST_PASSWORD.
2017-10-12 11:31:06 -07:00
derAnfaenger e1660462e1 linter: Add custom shebang rules section.
Tweaked by tabbott for clarity and to use print_err.
2017-10-12 11:21:38 -07:00
derAnfaenger 7deb698e02 email_log.py: Remove redundant shebang. 2017-10-12 11:18:45 -07:00
Brock Whittaker 6d8a8f2b7c list_render: Return data if no arguments present.
This will return the active data set if no arguments are provided to
the `data` method.
2017-10-12 10:42:06 -07:00
Steve Howell ae139a78b8 presence: Change "unknown" to "offline".
We never make an actionable distinction between the "unknown"
presence status and the "offline" status, so we now
just use "offline" as the status for persons who don't
have recent presence records that the client knows about.

(Usually, users without presence rows have never been online,
or they have been deactivated, or they have been offline so long
that they don't show up in our date-limited queries.)
2017-10-12 10:42:06 -07:00