We had a duplicate and incorrect check on if a stream was in your home
view, which caused us to not display Home unread counts in the sidebar
/ notification bar / Dock on page load.
(imported from commit db27cf9091f8b47200b025f03a26c4fe82701882)
Users were getting confused about why the unread count in the sidebar
/ notification bar / Dock was different from what the bankruptcy modal
said, so only show them the true server count until they've made a
decision.
(imported from commit 71d376cd4a85749ccf49936b251e6b8ac21361b7)
This change would allow anyone in the realm to set a topic for a "no topic"
message. As soon as the message topic is set, only the sender can change it again.
(imported from commit 0a91a93b8fd14549965cedc79f45ffd869d82307)
The new implementation makes add_topic() be O(1). We incur
the cost of sort() in topics_seen_for(), but that's only called
in the typeahead widget, and I think the typical number of topics
should be manageable here.
(imported from commit 0e332301b2e44b4465bf7a1d93ae525a8d17a6b6)
This partially reverts d3c28b17859cacd49b7db9f8784d4b8b9069e1ff.
It is necessary to call update_floating_recipient_bar from _fade_messages and
_want_normal_display because they are called after opening/closing the compose
box. There is no scrolling there, so it is not otherwise updated. It is not
necessary to call from update_rendered_messages as it is not called on
changes of the fade state.
Related: Trac #1682
(imported from commit e2528f8c8827b7e2a135d7fc2b53e9e8162799b0)
I haven't filed an issue about this since I just quickly found and
tracked down the bug, but the STR were:
1. Subscribe to stream foo
2. Hide foo from your home view
3. Unsubscribe from stream foo
4. Unhide other subscribed streams you've hidden from home view, if any
The "All messages" link would stay, although it should go away in this
case. The apparent cause was an incorrect assumption (when implementing
this feature) that the stream_info dict only contains subscribed
streams; in fact, we also populate it with streams you used to subscribe
to.
(imported from commit 67f95c8c8a211a4943a2de394919d15a0d5435d0)
Specifically:
* Remove min width setting for the main div as it is no longer necessary.
* Change max width for the app to 1200 and adjust top margin on the message pane
(imported from commit 846dd3dcd7798efa615e15c61681b0ab7465f5e3)
Once you enter a view, the last n messages will be exempt from
summarization, to give the users a little more context. Any
subsequently arriving messages will also be exempt.
We will try n=5 at first.
(imported from commit 3e6fe58109e692389bf02dde2230d788b5818d52)
For web pages, the initial favicon is the same as the favicon we
set for no unread messages and the initial page title is the same
as the page title we set for no unread messages. However, for the
OS X app, the dock icon does not get its badge updated on initial
page load. If the badge icon was wrong right before a reload and
we actually have no unread messages then we will never execute
bridge.updateCount() until the unread count changes. Therefore,
we now ensure that bridge.updateCount is always run at least once
to synchronize it with the page title.
(imported from commit 5d1269c62c1c3190aea96ef6f96c46acdb9fdf9c)
Dict.each() allows to iterate through values and keys of a Dict.
The callback function is passed value as the first parameter to
be similar to _.each()'s calling sequence.
(imported from commit e745e8b5d2f167b8b8acf7542b767494e354b037)
This fixes#1682, a recent regression that came out of
a5a47e13fc9d, which introduced the update_rendered_messages()
function in compose_fade.js. The original implementation
was finding the table row for a message, but not the table
row for its recipient bar. Now we style both elements.
(imported from commit a9628df0b03f79a24dfa68f4f2061eda2ca8ecea)
The calls to ui.update_floating_recipient_bar() were brought over
from compose.js, and it turns out they just complicate scrolling,
since we already call the function in the scroll handler.
(imported from commit d3c28b17859cacd49b7db9f8784d4b8b9069e1ff)
See trac #1676. Topic autocompletes were case insensitive
w/r/t to topic itself, but if a stream was called "Denmark"
but the compose box's stream field had "denmark", then we
wouldn't suggest any topics.
(imported from commit c8296c166115bb96023026da212f73a243432305)
Move zulip.subject_dict into composebox_typeahead.seen_topics,
and encapsulate the use of seen_topics inside composebox_typeahead
with add_topic() and topics_seen_for().
(imported from commit 2bc2d1714fabdc07a661cbf815d14b36a08990e2)
This lets us avoid popping up a separate browser window (which would
not currently work in the desktop app).
This closes Trac #1673.
(imported from commit eb1990d8021600fc4d3870f6ec3a28f7111036c3)
This resolves trac #1675, without introducing the problem that
caused us to set the immediate flag in the first place. (Some
commits just prior to this eliminate some slowness with rendering
by taking the debounced function out of the code path.)
(imported from commit 8c72f25a9d5eb38376957f222b9413d3167fa386)
These calls were expensive and unnecessary. We already update
fade/unfade classes deeper in the call stack, when we render
the messages inside message_list.js.
(imported from commit 08fe028462b6d4569d9798a290dd7b26eb21fb01)
The call to compose_fade.update_faded_messages() in message_list
caused us to traverse every message in the current table, which
was extremely inefficient. Now we call the newly created
compose_fade.update_rendered_messages(), which only fades/unfades the
messages passed in as the first parameter.
(imported from commit a5a47e13fc9daeedd0899b2cfb02beb3f6b8cd0a)
e.g., from a comment in the commit:
// Execute the conditional code if all conditions are true.
// Example usage:
// {{#if_and cond1 cond2 cond3}}
// <p>All true</p>
// {{/if_and}}
We'll use this for the email forwarding UI, but it may also be
generally useful, and easy to generalize to OR.
(imported from commit da601f94d9da300213ff46be50255135c014eca0)
This has the amusing side effect of showing all the Zulip bots in the
administration view because none of them have the is_bot set.
(imported from commit cdec19d2109c092018c1f331aa32f345d1587683)
We now show a list of users and allow you to deactivate a user using the
same process as `python manage.py deactivate_user`.
We add a new menu item accessible from the gear icon which will eventually
have much more than just this, but we have a good start here.
Here we also add a property to UserProfile which determines whether you're
eligible to access the administration panel, and then have code which shows
the menu option if so.
This introduces a new JS file, admin.js.
(imported from commit 52296fdedb46b4f32d541df43022ffccfb277297)
We remove the calls to clear_box()/hide_box() and start(),
so that we don't mutate a bunch of UI elements needlessly.
Everything that start() does either never made sense in a
just-after-message-sent context, or it was necessary prior to
this fix only because of what happened in clear_box() or
hide_box().
This change closes out trac #1672, "Clean up always-open code."
(imported from commit bedaa719eb05e166a4bac562784da0cce8859700)
One of the calls was obviously a typo dup, and the other
call is already covered by clear_box().
(imported from commit 448dc4c0f265cc7260ea08f0468a7d1440903e3c)
Due to the code removed in this diff, we would put you
back to your original reply stream/topic/sendee
(imported from commit 6e1f4666e3b32b057e692e015782780f7c734445)
The flag has been set to true for a while, so we removed
the flag and a bit of dead code associated with it. This
change should not affect any functionality on any realm.
(imported from commit 8d457f52584173994d0e5e83ca326f892cd90057)
Use information from the server to figure out if we should prompt for
bankruptcy, rather than trying repeatedly inside load_more.
(imported from commit ccb8cb1ce482b8bf3d343e7324fef7981880282d)
We instead implemented the ~desired functionality here using the
API and a bot to make a totally read-only, static, slowly-updating
view into the Zuliverse.
This is the moral equivalent of reverting deb035b4c702fcdb0e660ed549fe74c682abb6d9
(imported from commit 9d743fe82f197b37f005e5a038f77cc4b8566024)
1) The class Filter now lives in its own module.
2) The function canonicalized_operators() is now a class method on Filter.
3) The function message_in_home moved to filter.js and became private.
4) Various calling code had to change, of course.
5) Splitting out Filter helped simplify a few tests.
(imported from commit e41d792b46d3d6a30d3bd03db0419f129d0a2a7b)
* We now clear the validation errors when the input box is de-focused
* We make the left sidebar height accommodate the validation error messages
(imported from commit 4b39bfd3e8e8dd707722492a3f98967ee4ccf0ab)
To get to the bottom of the too-much-fading regression,
it was necessary to clean up the code, which was overly
complicated by multi-purposed functions.
The API for compose_fade now has these functions:
set_focused_recipient
start_compose
clear_compose
update_message_list
update_faded_messages
Internally there is now a notion of "normal display",
so e.g. when you want a normal display, we call
_diplay_messages_normally() internally, which removes the
faded/unfaded classes from all messages.
(imported from commit 7eb2b0a163f29d9ebae26661f432fecc7c331e4c)
Previously we would just discard the results of get_old_messages,
which meant that any messages sent either while you were doing the
tutorial or that you started out with (as in the case of the CUSTOMER3
experiment) would be lost until you reloaded.
(imported from commit f5280c091ab6ed7c2af6eb8fe49c0fa6b997ac97)
This makes fade/unfade start sooner (good), but it might
re-introduce some typing sluggishness (bad).
(imported from commit 4e3112ed1ac931f2931182f91b60567ef2d72695)
When starting a compose, call compose_fade.set_faded_messages,
which will immediately do fade/unfade logic, whereas before
the code path went thru debouncing logic.
(imported from commit 7d0b30435be32a7132dbf05bf064b03b925a2d42)
Move code from compose.update_fade() into
compose_fade.set_focused_recipient(), which makes it
so that we only have to send the msg_type.
(imported from commit c17665d9f34f525bdedcd36d39d3a112fa36a914)
The code in unfade_messages() is O(N) over the number of
messages, but a simple flag allows us to track the fact that
all messages are unfaded, so we can short circuit the O(N)
logic in many cases.
A typical scenario now would be that you start typing a
stream while the topic is still empty. Modulo debouncing,
every keystroke now leads to a call to unfade_messages(),
but this change only does real work the first time.
(imported from commit da07cf408bbdbf5b381ff3ec33a5e05e34eef5b5)
The compose_fade has three public exports:
set_focused_recipient
unfade_messages
update_faded_messages
All code was pulled directly from compose.js, except for the
one-line setter of set_focused_recipient. The focused_recipients
variable that used to be in compose.js was moved to compose_fade.js,
hence the need for the setter.
(imported from commit 462ca5d0d0bd58612d0197f3734a8c78de8c6d30)
"Kiosk mode" is a "read-only" Zulip suitable for embedding into
an iframe on another site. I say "read-only" in quotation marks,
because the account is still a fully-fledged active account on
the server, and we just tear out a bunch of stuff in Javascript
(that a malicious user could easily re-enable).
So in that sense, it's not actually safe in security-sensitive
environments -- malicious users logged in via kiosk mode
can do anything the kiosk-mode user can do.
(We need this functionality for the customer3 realm specifically;
we'll possibly just tear this code back out once that experiment
has run its course.)
(imported from commit deb035b4c702fcdb0e660ed549fe74c682abb6d9)
This fixes Trac #1567.
This is kind of a big hammer approach, though. If we did support
spellcheck on other platforms (without doing more work), this might
actually potentially disable it.
But we don't, so this is mostly a non-issue for now.
(imported from commit 74dcb42b19c37e1e8d1e9a2b265e1e6ae0cc2c67)
There are also one or two places we don't need to use it for security
purposes, but we do so for consistencey.
(imported from commit aa111f5a22a0e8597ec3cf8504adae66d5fb6768)
util.enforce_arity takes a function and returns a new version which
throws an error if an incorrect number of arguments (as determined by
the function prototype) are passed.
(imported from commit 20e69a6dc7b6f8455726ab4fae8d5b7b04dc4103)
This fixes trac #1357, which says that some users get annoyed
when the system keeps generating the same color for them, which
would happen if they didn't like #76ce90 and kept picking a
new color for their streams.
(imported from commit 0fdb726aad4009332cc056a5e98bb39e01ef414c)
Instead of splicing up a cloned copy of stream_assignment_colors
every time somebody uses a color, we just rebuild a hash
of used_colors from our subscribed streams when we need to assign
a color, and we avoid calling into stream_color.pick_color() when
a stream already has a color.
This change has a slight functional impact in the situation where
a user unsubscribes some streams during their session, because
we weren't "reclaiming" colors before on unsubscription, but the
simple approach gets that for free.
(imported from commit adf360365bdf1ae9db99c533a0bde62d91f5dfe8)
This is a pure refactoring that mostly just moves code from
subs.js to the new stream_color.js and updates module references
accordingly. In order to prevent introducing some exports,
update_stream_color was given an additional "sub" parameter
and update_stream_sidebar_swatch_color was given an "id"
parameter.
Killed off unused initial_color_fetch var.
(imported from commit b7644ce67f50d31fb46f564d758d661eea776aa6)