Commit Graph

2372 Commits

Author SHA1 Message Date
Steve Howell
cf6545a71f reactions: Only warn for unknown user ids.
If we get reactions for deactivated users, or otherwise missing
users, we only issue a blueslip warning now.  The function
get_message_reactions() was indirectly causing blueslip errors
before this fix, but we can downgrade to warnings now that this
function has better unit tests around it.

We eventually want to track deactivated users on the client.

Fixes #4289
2017-03-26 11:51:36 -07:00
Steve Howell
3da047e10e Add people.is_known_user_id(). 2017-03-26 11:39:06 -07:00
Steve Howell
80addd902c Extract local vars in get_message_reactions(). 2017-03-26 11:39:05 -07:00
Cynthia Lin
f41883ce8d subs.js: Refactor row data functions to return objects. 2017-03-25 18:35:21 -07:00
Cynthia Lin
6e2d180a34 hotkeys: Add hotkey n for opening New streams modal in Streams menu. 2017-03-25 18:35:21 -07:00
Cynthia Lin
ca460fad1f hotkeys: Add hotkey V for viewing selected stream in Streams menu. 2017-03-25 18:35:21 -07:00
Cynthia Lin
a027e9318d hotkeys: Move cursor to Filter streams input if at top of Streams menu.
Fixes #4227
2017-03-25 18:35:21 -07:00
Cynthia Lin
b800cb05c0 hotkeys: Add left/right arrow keys to toggle views in Streams menu.
Fixes #4228
2017-03-25 18:35:21 -07:00
Cynthia Lin
fb89d8a2bf subs.js: Refactor modal row functions. 2017-03-25 18:35:21 -07:00
Cynthia Lin
69c32daffa hotkeys: Add U hotkey for unsubscribing/subscribing in Streams menu.
Fixes #4229
2017-03-25 18:35:21 -07:00
Cynthia Lin
d17131dcb4 hotkeys: Rename subs.arrow_keys() to subs.switch_rows(). 2017-03-25 18:35:21 -07:00
K.Kanakhin
234a1f8e61 retention-period: Add retention period to front-end admin organization settings.
- Add message retention period field to organization settings form.
- Add css for retention period field.
- Add convertor to not negative int or to None.
- Add retention period setting processing to back-end.
- Fix tests.

Modified by tabbott to hide the setting, since it doesn't work yet.
The goal of merging this setting code now is to avoid unnecessary
merge conflicts in the future.

Part of #106.
2017-03-25 17:57:18 -07:00
Joshua Pan
16b2313165 muting_ui.js: Remove any popups when unmuting. 2017-03-25 12:49:14 -07:00
Joshua Pan
76e84288d9 Add M hotkey to toggle mute/unmute topics.
Get rid of current_msg_list.selected_message() redundancy.
2017-03-25 09:42:49 -07:00
Joshua Pan
dc9f83005f Add toggle_mute to muting_ui.js. 2017-03-25 09:42:49 -07:00
Joshua Pan
32837804d8 Extract stream_popover.topic_ops to muting_ui.js. 2017-03-25 09:42:49 -07:00
Brock Whittaker
efd72d3338 Modify lightbox to only display valid images and YT Videos.
This modifies the lightbox to only display images inside the
".message_inline_image" class, rather than all images inside the
message body, which currently includes things like the bot icon.
2017-03-25 09:19:26 -07:00
Steve Howell
b3e4aa4c44 reactions: Downgrade blueslip error to a warning.
When we get a server error for adding/removing a reaction, we
no longer make a blueslip error, since it is somewhat common for
users to retry actions before the server sends an event.  The
code comment that is part of this commit explains this further.

Fixes #4290.
2017-03-24 18:24:15 -07:00
Moritz Neeb
9866805937 docs: fix a typo in hashchange.js 2017-03-23 15:16:02 -07:00
Joshua Pan
f40b43a491 hotkeys: Add hotkey G an alias for End.
Fixes #4195.
2017-03-23 11:38:36 -07:00
Tim Abbott
5d030e9173 casper: Add test for the reload hashchange logic. 2017-03-22 23:06:08 -07:00
Tim Abbott
04db0b5df0 reload: Fix passing data to next browser session.
Apparently, Django's CSRF protection mechanism changed at some point,
and now we get a different CSRF token every time the webapp is loaded.
This, in turn, caused our reload logic to avoid losing state to be
completely ineffective, since the CSRF check in reload.initialize
always failed.

We fix this in a secure fashion by passing the reload instructions
from the browser to its reloaded self via localstorage, keyed by a
randomly generated token.  The token randomization is primarily
relevant for handling several Zulip tabs in the same browser, but also
servers to make it very difficult for an attacker to ever trigger this
code path by redirecting a browser to `/#reload` URLs.

Fixes #3411.
Fixes #3687.
2017-03-22 22:46:54 -07:00
Tim Abbott
64acf84ab1 reload: Save narrow when event queues expire.
Along with the issues with our reload data passing system that are
fixed in the next commit, this is responsible for #3411.
2017-03-22 22:28:35 -07:00
Tim Abbott
ee4b948873 bankruptcy: Fix narrow being lost on declaring bankruptcy.
This was actually being done in 2 ways: via not saving the narrow in
the reload and second through calling `change_tab_to('#home')`.  The
code is so ancient that it seems unlikely that this behavior was still
intentional.

Fixes part of #3687 (the remainder is fixed in a few commits).
2017-03-22 22:28:18 -07:00
Tim Abbott
37ac0e6e6d server_events: Remove obsolete 'tool old' handler.
This error predates the transition to an event queue system and hasn't
been possible for years.
2017-03-22 21:16:39 -07:00
Tim Abbott
61e6ed8c31 bankruptcy: Fix clicking outside bankruptcy modal.
Previously, this would leave the unread UI disabled forever, showing 0
unread counts for anything, which was a super confusing failure mode.
2017-03-22 20:50:44 -07:00
Tim Abbott
977e7b0fdc unread: Move bankruptcy code out of click_handlers.js. 2017-03-22 20:49:05 -07:00
Tim Abbott
ccb38a1e9c compose: Fix missing opts argument to show_box.
This fixes a regression in the recent compose.get_focus_area
refactoring that I did.
2017-03-22 16:32:53 -07:00
hackerkid
97bd9d5186 Fix positioning of message-info-popover. 2017-03-22 16:04:38 -07:00
hackerkid
ed72ee476f Make user_popover use user_info_popover template. 2017-03-22 16:04:38 -07:00
hackerkid
b2fc8d6fa2 Rename message_info_popover* templates to user_info_popover*. 2017-03-22 16:04:38 -07:00
hackerkid
23a5f56023 Add sender avatar in message popover. 2017-03-22 16:04:38 -07:00
hackerkid
32bc5893d0 Remove arrow from message info popover by providing template.
Provide custom template (user_info_popover.handlebars) to message info popover.
2017-03-22 16:04:38 -07:00
Tim Abbott
2a5269baa9 docs: Document the frontend hashchange system. 2017-03-22 15:21:36 -07:00
hollywoodno
d6716838ad bugdown: Remove trailing whitespace on fence code blocks.
This fixes fenced code blocks that are copy-pasted from certain
clients having trailing whitespace anoyingly often.

Fixes #3998.
2017-03-22 14:17:34 -07:00
Brock Whittaker
dbcd19bcfa streams: Add hotkey for content-editable enter.
When you enter, it should click the checkmark, which would save the
current input of the input section.
2017-03-22 12:21:21 -07:00
Brock Whittaker
d21fe68e9e streams: Fix content-editable cursor shifting to beginning. 2017-03-22 12:21:08 -07:00
Raghav Jajodia
956106ae92 streams: Fix closing of content-editable area on escape key press.
Pressing Escape key while editing stream description now closes
the editing.
Fixes #4202.
2017-03-22 12:19:59 -07:00
Raghav Jajodia
9a339a7053 streams: Prevent cursor jump to the end of editing stream-descr.
This prevents the cursor to jump at the end of the content-editable
area when the user types in the middle.

Fixes #4202.
2017-03-22 12:19:59 -07:00
Raghav Jajodia
9707c74f33 message_edit: Added copy to clipboard button.
A copy-to-clipboard button is added over message-edit textarea.
Closes #3239.
2017-03-22 11:00:18 -07:00
Steve Howell
2991c19fea Extract typing indicator inbound timing logic.
We now track our inbound timing events using code in
typing_data.js.

This code may be a little more robust with variations on how
recipients are represented in events, although there are no known
bugs here.
2017-03-22 08:20:21 -07:00
Steve Howell
4fb8339954 Extract typing_events.js. 2017-03-22 07:29:42 -07:00
Steve Howell
cde1861655 typing indicators: Validate PM emails. 2017-03-22 07:01:20 -07:00
Steve Howell
1ec392a18e Extract compose.get_invalid_recipient_emails(). 2017-03-22 07:01:20 -07:00
Steve Howell
84b31a5532 typing indicators: Limit to PM conversations.
We now only send outbound typing indicators if we are
composing a private message.
2017-03-22 07:01:20 -07:00
Steve Howell
642be6ad18 Revamp state tracking for outbound typing indicators.
This change moves most of the logic related to starting and
stopping outbound typing indicators to a new module called
typing_status.js that is heavily unit tested.

While this was in some sense a rewrite, the logic was mostly
inspired by the existing code.

This change does fix one known bug, which is that when we
were changing recipients before (while typing was active), we
were not stopping and starting typing indicators.  This was
a fairly minor bug, since usually users leave the compose
box to change recipients, and we would do stop/start under
that scenario.  Now we also handle the case where the user
does not leave the compose box to change recipients.
2017-03-22 07:01:20 -07:00
Steve Howell
f89c9d6629 Avoid deprecated report_success() call.
We are moving to ui_report to break dependencies.
2017-03-22 06:53:21 -07:00
Tim Abbott
2076338eaa mark_subscribed: Add a blueslip check for color code path.
This code path might be unused, and it seems worth verifying, since if
it is, we can delete some extra complexity.
2017-03-21 23:36:47 -07:00
Tim Abbott
01904385a4 Fix thrashing color when resubscribing to a stream.
Previously, we would let the backend pick a color and send it to the
frontend; then the frontend would ignore that color and pick a
different color and send it to the backend, which would in turn resync
to us.

Fixes #3572.
Fixes #3858.
2017-03-21 23:35:50 -07:00
Tim Abbott
1ad0d35966 subs: Clean up ancient collapsing logic. 2017-03-21 23:09:32 -07:00