Activity.js now has the capability to track huddles that
come through in loaded messages and return them in reverse
chronological order by their most recent message. Right
now this only connected to a unit test, not any production
code.
(imported from commit 59957086fa2e454e5711472df091f178217aed2b)
This can be squashed with the prior commit, which inlined this
MIT check into update_users() while trying to avoid other
complications. After inlining the code, it's clear that we
don't need to call the sort_users() line of code for MIT users,
so I moved the MIT guard condition up.
(imported from commit fa5b52e14964ad595b34d40ce6c8450ea93726c5)
Since ui.set_presence_list is only called from activity.js, I am
inlining the code into activity.update_users(). This also allows
us to move ui.presence_descriptions into activity.js, which
is the right home for presence-related things.
(imported from commit 0ff239275c544a86c14d517bc386d06726b81cd9)
The user_info var was mapping users to presence information, and
presence_info is a better name for it. This change is partly tactical,
as it sets us up to inline ui.set_presence_list, which receives
user_list as presence_list and then has a completely different
variable called user_info.
By doing this pre-factoring, the next commit becomes just a pure
code move without more moving parts of renaming variables.
(imported from commit 4b015d19886b43d24905124eb37cd9dd317aa87b)
Narrow.activate was called without an options object in one
obscure location. I'm not sure how it's actually triggered,
since all searches seem to go through the typeahead path with
the "Search for x" option, but someone managed to do it.
(imported from commit 5e0e1bbe7570e5f6a654949547dc164e01125efa)
It's somewhat buggy, and has thus been annoying our internal users, so
better to disable it until we can fix the bugs.
(imported from commit f981791d32d321b0cfe06b4a337e26ab48832bb3)
This should help with determining the prevalence of slow sends as
experienced by users.
(imported from commit f00797679315c928af3c87ad8fdf0112f1dfa900)
Perhaps we should be checking based on an ID rather than the actual
text, but this fixes the proximal issue.
(imported from commit b125415c3a8356255b64c8e22733532491ea0065)
I switched narrow.by_subject and narrow.by_recipient to use the all_msg_list
instead of current_msg_list, since we wanted to be able to narrow to messages
specifically not in the current_msg_list. However, in searches which revealed
old messages outside the range of all_msg_list (which only has a single contiguous range),
this broke narrowing.
Let's use msg_metadata_cache instead.
(imported from commit 427f717484b4ae83d9bb4cc6e51ce17177d037fe)
Displays a notification above the composebox in cases where the message
is not visible (further down), or where it's outside the current narrow or search.
It also offers a link to the appropriate narrow when it makes sense, and offers
timetravel when appropriate. There is currently a bug with timetravel (and you can
see this when using the popover menu) that makes "narrow to messages around this time"
not work for muted messages.
This resolves Trac #1518.
(imported from commit 391ca0b9c07d91496f6585a4fd8e15723d1170e2)
Looking at the historical data, fewer than 50% of active users have
completed the checklist, which means that it is just persistent
clutter. We also have other better ways of encouraging people to send
traffic and get the apps now.
This commit removes both the frontend UI and backend work but leaves
the db row for now for the historical data.
(imported from commit e8f5780be37bbc75f794fb118e4dd41d8811f2bf)
Nobody uses it, and it causes confusion. (How is it different from 'Home'?)
For now, leave in the ability to get to the narrow, although we may
ultimately want to do away with it as well.
(imported from commit 35b3f27e39c4de3391bc5571b32f7242a29f4cfa)
We were using Gravatar for user avatars, but now users can
upload their avatars directly to Zulip, and we will store
their avatar for them. This removes the old Gravatar-related
interface and polling code.
This commit does not attempt to update the avatars in
messages that have already been loaded, either for the user
making the change or other users.
(imported from commit 301dc48f96f83de0136c93de57055638c79e0961)
The "Your Account" and "Notifications" boxes on the Settings
page each had their own border and their own "Save changes"
button, but they were within the same form and sending to the
same back end point.
This commit creates a separate form and endpoint for each
of the two boxes.
(imported from commit 04d4d16938f20749a18d2c6887da3ed3cf21ef74)
Previously, if the user held down the enter button while the socket
was disconnected, the client would try to connect in a very tight
loop. Now we throttle reconnection attempts to 1 per second.
(imported from commit 7b18260b992d5a34f3ea7925cf72b383f84bbabd)
If the user has a flaky connection, we might be in the backoff state
of attempting a reconnect. But when the user regains connectivity
and tries to send, we want to send the message as soon as possible.
(imported from commit 3c5c8e9c3104ff7923258f73c9ab700548518d16)
All local_server JS stuff should ideally be controlled from
feature-flags so it's easy to see at a glance what's been done.
(imported from commit 45b1cdae382679d3fa3b5f02f67e8ab749a89a51)
We leave the HTML in because it's harmless. (We could do a more
thorough expunge, but I don't see the point).
(imported from commit d3d68b0b2df96a9f3de73903b043c18bc6f77563)
The Streams page should only show active public realms, even though
a user might have info about a "retired" stream in their browser.
I regressed this in 69b83d769 for "retired" streams. A retired
stream is a stream that no longer has subscribers. The bug
scenario here was that you could create a stream, regret it,
unsubscribe yourself, and then the stream never went away from
the Streams page.
This diff tries to be a little more explicit about building the
list of streams for the Streams page. Basically you have two
sources:
* Get only the subscribed streams from the internal
data structures.
* Get the unsubscribed streams by calling the back end
for all public streams, and subtract out the subscribed
streams.
I tested the following scenarios:
normal stream with me: in Streams
normal stream without me: in Streams
my invite-only: in Streams
their invite-only with me: in Streams
their invite-only without me: not in Streams
retired stream: not in Streams (but message colors are good)
See the email "custom query to get public stream names" for some
related discussion.
(imported from commit bc9224e68797b26b795399941117faa9d6858b39)
I want to make subscribed_streams() external, but it conflicts with
a legacy name in the same module (stream_data.js), so I have to rename
it in the same commit. The new name conforms better to the current
naming convention, which generally has functions returning objects
use "sub" in the name.
(imported from commit 9f1ed60772c649359a413257e0998857eab3603f)
Trac #1734
This is implemented by bouncing uploaded file links through a view
that checks authentication and redirects to an expiring S3 URL.
This makes file uploads return a domain-relative URI. The client converts
this to an absolute URI when it's in the composebox, then back to relative
when it's submitted to the server.
We need the relative URI because the same message may be viewed across
{staging,www,zephyr}.zulip.com, which have different cookies.
(imported from commit 33acb2abaa3002325f389d5198fb20ee1b30f5fa)
When we add starring of historical messages, they'll get added to the
home view (since we don't filter them out), which isn't a big deal --
but we don't want to make an inaccurate claim that the user subscribed
to this stream and then unsubscribed.
This should most properly be handled by filtering server-side, but at
the moment our lack of an index on UserMessage.flags makes that
impractical from a performance perspective.
(imported from commit 00751a5f9fc20e9da5c09914c11d1579f9e7398e)
There seems to be some sort of bug involving PhantomJS and XHR
streaming messages. When successive pages are loaded that use XHR
streaming, PhantomJS seems to think the second one never finishes
loading and therefore hangs.
(imported from commit db93b4cab816f1fdc3f3f543c9394b1cba8abedb)
Because our authentication system reads cookies from the initial
connection attempt, several SockJS transports can't be used.
(imported from commit 34b9571225d39072985b8223fb12c43c7235841f)
We want to deprecate reload_subscriptions(), which was kind
of a big hammer to use when only a single stream is being
renamed. Now we call stream_list.rename_stream() to update
the sidebar.
(imported from commit a77d09c0433d9b605b7baa7d7c61183bc8c37ba9)
For a large domain like HS, we were pulling back about 100k of
text with subscriber emails when we opened the Streams page.
This was unnecessary, as the subscribers aren't shown until
you expand the stream, and there's already an AJAX call.
(imported from commit 69b83d769030d87318acefc364ac6ff3a2ec3605)
Use the new count_full_messages_between instead of subtraction in
message_list_view.append. By finding a count higher than it should be
when summarized messages are present, it didn't add new messages until
the pointer moved under certain conditions.
(imported from commit c10d9c1a0d23891acce88bf8d79866c08cb75681)
Summary blocks can contain hundreds of messages. When the rendering window
code didn't take this into account, it would lead to all kinds of
unpleasant behavior when you scroll.
Trac #1888
Unfortunately, this replaces a subtraction with a function that iterates
through all the messages.
(imported from commit 9259a246946cd968a8725c38ff5ef2d4b4793717)
* Disable for search-like narrows (whitelist stream and home instead of
blacklisting topics and PMs)
* Use home view summarization flag for All Messages
(imported from commit 48bd10ae5da7c7564c2efe86a40078f1a7e96e20)
Don't warn when @-mentioning a bot on a public stream that it does
not appear to be subscribed to. It may be receiving those messages
anyway.
(imported from commit 4a00694942a721897a01736f48033c71048e0b16)
This doesn't address the more complicated case of someone @-mentioning
you on a muted topic, which consensus is you do want to get
information for, but we need to develop some infrastructure to present
that case to users clearly.
(imported from commit a4bc1e89c108fa8ba6eccc0a198eabf2231326ab)
Add the option "Narrow to just this message" to the chevron
menu. This has two use cases:
* It's an easy way to get a sharable URL for the message.
* It reduces distractions.
For now it is feature flagged to just customer12.invalid and staging.
See #1880.
(imported from commit 897d247176f9024ff825ccd3b338236569eed5ab)
Allow users to open Zulip windows in new tabs with command-click
from the left sidebar narrowing links and recipient bar
narrowing links.
(imported from commit d60c038c7bf1efccd461f5284d513b9cbfbdaebf)
If the user has text in the compose box, don't close or
change the compose box when they narrow.
(imported from commit f9b400f6bac37cb313f1fd87aadb3ba1d3a035ef)
For the two cases where narrowing should open the compose box,
we now put that logic inside of narrow.js.
(imported from commit 570e22e90c2f6d422ba71cce400c075f0b8adf51)
Handle closing the compose box inside of narrow.js, to
ensure consistent behavior for all the narrowing UI options.
(imported from commit f17a687491eb2361c73032cd974cedb2a0a2dd85)
The main user-facing feature here is that users can open narrows
in new tabs or windows. Internally, it makes the HTML more semantic.
One consequence of making these elements into actual anchor tags
is that clicking on them no longer triggers this logic to
close the compose box when you click outside of it:
// Unfocus our compose area if we click out of it. Don't let exits out
// of modals or selecting text (for copy+paste) trigger cancelling.
if (compose.composing() && !$(e.target).is("a") &&
($(e.target).closest(".modal").length === 0) &&
window.getSelection().toString() === "") {
compose.cancel();
}
Instead of patching the above code, I elected to just call
compose.cancel() explicitly in the click handlers for the links
themselves.
We are gonna try to clean up the compose-box behavior globally soon.
(imported from commit c9a01916f1714fe3dd495d25c78cd5e5532105ef)
Trac #1737
Firefox has the slightly broken behavior that it emits a click event on
the document when you right click, but not on any of the child nodes, so
our #compose stopPropagation doesn't stop right-click events from closing
compose. Chrome never emits click events on right click.
(imported from commit 2519c542715c93877b6d38e5dcff1f3e011688e4)
When decoding an operand, a + can be converted to a space
only if the operand is not an email address.
(imported from commit 08fc36a579bbe6409137c60c0fa9579fe3ab2c43)
It's a bit of a contrived use case, but you could make a topic
called "12345" and then mute it from the sidebar, and it would
crash inside Dict. We now call attr(), not data(), to avoid
string-to-integer conversions.
(imported from commit 89666f40d624df154d41077546e1c13a23ee7e67)
Before this change, you could narrow to an old topic, and it would
not show up in the sidebar unless it had unread messages.
(imported from commit f177a7378dac064e46a6417357cc86ada4475936)
The old code was looping through recent_subjects to find the
original subject name, but we already have logic in get_subject_filter_li()
to be case-insensitive. I tried this with various casings of topics,
narrowing to topics, as well as narrowing to a stream (so no active topic)
and narrowing to an old topic.
(imported from commit 1decde13477cb742fd4bc82798f1afb282182bdf)
Create our own objects for handlebars, so that we can add transient
flags like is_zero without worrying about side effects to other
code.
(imported from commit b351a369cb3f36233e108e270c7abdd4ab8c5860)
When we call rerender() on MessageList, it is usually because
something big has happened, so it's reasonable that the pointer
may now be invalid. As an example, the old pointed-to message
may been removed from the home view. We have always just
moved the pointer under the hood, but now we do it in a way
that doesn't generate spurious blueslip errors.
(imported from commit d399a101f36b744a423ea7da80dda8352440c6c9)
There is a scenario where we call process_read_message()
for a message that we haven't recorded as unread before.
I'm not sure how it happens, but I put back code to
guard against crashing. The regression happened in
5752458c821.
(imported from commit 5ce15d2e236b738b445ed88f1733aa0612be0ff3)
This fixes a blueslip error where we were trying to add the same
message into a MessageList twice. Muting complicates our duplicate
detection, because empty() can return true even when we already
are storing messages that just aren't shown (because of muting).
The name empty() should probably be fixed in light of muting,
but filtering with self.get() is not really a problem here.
(imported from commit 83b0890471c9a0aa21996f3d0d3be4a238f23e65)
We have been persisting muting preferences on the back end for
a while, but we haven't been adding them to page_params for the
client to have at reload/startup time.
(imported from commit d9ca68aa0e4d22bfb0e6ce67fc0bc63981175c8b)
With the muting/hiding features, it has become the case that
this._hash can have entries that don't map to actually visible
rows, so this.get() can return true on an id that shouldn't
actually be selected, causing downstream code to explode. Now
we call this.closest_id() regardless of whether the hash is
populated, to be safe, but then we still call blueslip.error
if the pointer moved.
(imported from commit 348e8ff67ce3a6d61aaeb31f80549386518af2d0)
If you have two browsers open for the same account, muting in one
browser will now be reflected in the other browser. This got
regressed when changing the approach from collapsing to hiding.
The new code should be less brittle, as we encapsulate re-rendering
in muting.rerender().
(imported from commit 4e65e265b64513d38f518770453b7436cb92b4ca)
Update get_counts() so that it ignores counts for muted topics
when calculating stream/home unread counts.
(imported from commit 9b4e4da4346c225c535e97d709d3dee032603cc5)
The indirection was more confusing than helpful, especially
since the function had side effects, despite its getter-like
name.
(imported from commit 85d9cf642b4177f62488136f0e0f7f6c9304942e)
After killing off unread_counts.stream, the only field of
unread_counts was "private", so I just made unread_privates.
(imported from commit 9678f5b03524afb883ec4fa638b059e698888e78)
The prior commit makes it so that we no longer use unread_counts.stream
in get_counts(). This commit removes the code that updates the
data structure.
(imported from commit 5752458c8212bf02cf9c8733ce349fc35b204a9b)
These two data structures are kind of redundant:
unread_counts['stream']
unread_subjects
We are deprecating the former. The latter is more flexible for
features like muting.
Now, in get_counts(), we compute home counts and stream counts
in the same loop that computes subject counts.
(imported from commit c8d0ea12a56d0128811e0aa165de9882546906a5)
We are still showing the same data points, but the logic to drill
down on details for a particular realm is now all server side,
not client side, and we are smarter about omitting fields. In
summary mode, we don't show empty Name or Email columns. In
detailed mode, we show the realm as a headline instead of a column.
In this version you do lose the ability to see all system users in
the same view, but Waseem is ok with this.
(imported from commit edd2e646ab4cf5783ea64232d0cd621debece8d4)
When you load the activity report, it will just show summary
counts for realms, but if you click on a realm, you will see
details about users in the realms. You can also click "Show all"
to see an interleaved view of realms and users.
(imported from commit b106557b1fae64d525071afc124b5a8aed319086)
`Cannot read property 'flags' of undefined` in the
_.each callback in expand_summary_row.
Messages loaded when you scroll up in a narrow are not added to
all_msg_list. Because the user just clicked the message, we know
the message is in current_msg_list, so use that instead.
(imported from commit e76449a2a2748b96f69a2ab05d288b708d9e3ac0)
Instead of collapsing muted messages, just hide them altogether
in view where it makes sense to hide them.
(imported from commit 1c2c987ff302ceb135a025753cf421b4de1aea71)
I moved code into MessageList to further encapsulate details
of filtering. The MessageList instances should be their own
gatekeepers for what messages they care about.
(imported from commit ee6cd7f6eabf97962d724a05d7d0b0a3e6ab19e5)
Warn inside these functions when you get data on streams that you
are not subscribed to:
add_subscriber
remove_subscriber
user_is_subscribed
The back end should be smart enough not to spam us with subscriber
info that we don't care about.
(imported from commit b27644be2abc37c11ddff884ef392ea208bd1bd3)
The first menu option supported is to narrow to the topic.
The chevron only shows up if you turn on feature_flags.muting.
(imported from commit 17482f538a6d3e4ff96a36c042bad972d34f4b11)