Our overall guideline is the type names for events are singular, and the list of
events of that type are plural. 'subscriptions' was not following this guideline
and (potentially as a result) had a bug where it was impossible for clients to explicitly
subscribe to subscription change events properly.
(imported from commit 7b3162141fd673746e0489199966c29ea32ee876)
Chrome was showing a memory leak after many auto-reloads. Emptying the
the collections and removing the event listeners reduces the severity.
Before this change 40 reloads would would grow to about 140MB, now it
stays around 50MB.
(imported from commit 55fbeff9bdd0363bb95929f2981a2de238ff35d8)
This is yet another change related to phasing out the
[operator, operand] tuple data structure for representing
terms in a narrow.
(imported from commit 508e58fc4eebae8a24a8ae59919ba5d94fc66850)
The JS code can now call stream_data.get_sub_by_id() to get
a sub from a stream_id. Subs have stream_id due to a prior commit,
and we keep track of the mapping in stream_data's subs_by_stream_id
variable.
(imported from commit 409e13d6d2e79d909441a66c85ee651529d15cd2)
The tutorial introduces "engineering" messages that might not
be in the user's normal subscription, and they would get a gray
border if we did not override the stream color. Before this change,
we accomplished this by overriding the core data structure in
stream_data.js. Now we are a bit more future-proof; we only
override stream_color.default_color.
(imported from commit 0d0845b72f766912679f5aa7641ae9a60fdbb4ce)
This does have a small functional change of using use_closest even for
the current_msg_list.last().id case, but that's harmless; and it does
reduce a lot of code duplication and confusing logic here.
(imported from commit 7c4ecaa197120cc6d5c05ce4887f33c7d94a9c59)
The leading theories this will test are:
1) MessageList._items becomes unsorted and the binary search starts
returning the wrong index from selected_idx.
2) MessageListView.render is not rendering the message or it is not
being inserted into the cache.
(imported from commit 926b7d7bf9df338320a8cba6241038176ce4b47d)
This sets us up to redraw the window title without having to
pass in the unread count, which will be useful for realm name
changes. The redraw_title() function is only responsible for
rendering stuff, whereas update_title_count() handles
the details of caching the count.
(imported from commit 67cfb7a273e2a61720ce2bd8d91d73fe1089c813)
Add try/catch blocks to get_updates_success and send a blueslip error on
errors we catch. This will let get_updates_success return successfully
so that the next call to get_updates will start immediately.
(imported from commit 44d8b85d9d8e930a5552a5fbf4af1d0e5e8c07e8)
There are 2 uses of all_msg_list previous to this commit:
(1) The contiguous block of messages to be used for constructing the
initial state of narrows.
(2) A way to look up an arbitrary message by ID that may or may not be
in the home view to check if we have it locally.
We eliminate all applications of use case (2), replacing them with
queries on message_store, since they are in fact wrong -- any messages
that are outside the contiguous time period of all_msg_list would not
appear in all_msg_list and thus would incorrectly not be returned.
(imported from commit e2e2efe919242331bbc44abc6c50b16e3ab1336e)
This implementation is somewhat hackish in large part because I think
we're going to be wanting to redo the get_old_messages API somewhat
soon, and this may naturally become a lot cleaner as a result, but
this isn't a lot of code and fixes#2235 part (A) and substantially
mitigates #1510.
(imported from commit 47a2160a44befa9d83190c5cc95b90e92cc5b4cc)
The old layout was misleading, because users would make the perfectly
reasonable assumption that their avatar change wouldn't be made until
they hit the Save button. Moving the avatar stuff below the Save button
makes the UI clear and also unclutters the form for updating name and
password.
(imported from commit 9154ba69a2d61844701c88c2afdf399532ccddd9)
When users select messages starting with stream header we should format
the text as using the custom copy handler.
(imported from commit 4f9851939484d046619c3e53c71c47ad64797670)
I apparently screwed up when backing up the process_loaded_for_unread
move in a way that just lost the function.
(imported from commit 91dfcf1abc85d439274cb8b0be380e9230942ebb)
The message to use /register if your group is already signed up is
below the fold on my laptop -- this probably contributes to people
trying to sign up their group when they are just trying to register.
(imported from commit 517df29d10182c05780017c15225c9f95b844225)
This is no longer required, now that we're no longer scrolling the
main body of the page.
(imported from commit c2aa0d403c8fd0679b3110fe8e7684d46a7557fa)
Both pointer and last are fields that were removed when we changed the
protocol to use events like a year ago.
This conveniently allows us to stop exporting get_updates_params to
other modules.
(imported from commit 13651ee240ce6e1bafb241b185e5ef653c348cdf)
Previously, we waited until we'd fully loaded the home view to start
calling get_events, which:
(A) didn't make sense non-message related events
(B) resulted in our throwing "get_updates not started" errors when
users sent a message before the home view was fully loaded.
This commit only fixes problem (B); to fix problem (A) we will need to
change the event capture code to only capture some events.
(imported from commit 2aacd6bdfd1e7d7707e3a724f1fde7da4a556538)
Note that this makes the event fire after the home view has messages
loaded all the way to current; previously it only waited for the first
batch of messages to load.
(imported from commit a5c408ea0136c761f4cc77e8be4977b13acc6d77)
By using _.all() instead of a for loop, we avoid a tiny bit of
confusing between "break" being for a switch statement and being for
the loop.
(imported from commit cd6e7ff788b50f4dadce93e7f0efcb381bc59270)
Even in the case where we are running embedded narrows,
we want narrow.operators() to return new-style operators
that you get with Filter objects, so that callees do
not need to support the legacy tuple format.
(imported from commit a6649881a926a2304e9f7cc8ca53b406e2c8828e)
If you do a search like id:5 topic:foo and message #5
does not have the topic "foo", we now return zero results.
(imported from commit 8121fac1dbd79024c51af1f310d831dab9242e36)
Have narrow.activate() user filter.operators() to produce
operators that have operand/operator fields, so that its callees
don't need to be backward compatible with the tuple format.
(imported from commit e408e33074d1be2d112bb3cdc081ec3616c908ee)
Now that we are not scrolling the document we can remove the workaround
to prevent browsers from scrolling on hash changes.
(imported from commit 67fdaa4980d4d54d80ca9c259bbee567b8eeb917)
Change the offset to hold of the selected message as an offset from the
top of the screen. Then use the current offset and scrollTop to compute
the new scrollTop.
(imported from commit 718e95d3435c0f84cbb7663a9bb2bc2789314203)
By having Filter.canonicalize_tuple() call filter_term(),
we make it so that Filter objects get operator/operand
fields in their terms when we initialize this.
This mostly caused test breakage for tests that were doing
assert.deepEqual; now we just check to make sure that the
field we need are there.
(imported from commit 63b2516dc72edeb11e76a1fa4442570b9c605baa)
Consumers of Filter.parse() can now reference
search term parts like so: term.operand, term.operator
(Legacy code can still use term[0] and term[1].)
(imported from commit 06d0da65f13f1eb7e3ba8eac0e69448aab2735ab)
This got broken in the local echo refactoring -- we accidentally
switched the update_starred function to be a toggle, which meant that
the message would be marked as starred and then unmarked as starred
moments later, due to the two update_starred calls for the initiating
browser (one from when the click happens, the second from when the
event returns from the server).
(imported from commit 8f83729fe5477cf052124c1c56ed9189b85b885c)
Previously, while you'd get the event saying you'd been knighted,
which would make the Administration tab visible, clicking on the tab
would error out because the admin page HTML was never sent over on
page load (since you weren't an admin at that point).
(imported from commit 90ad351533515bebece630d67baf4b142d320754)
Clients can receive description updates for streams which are not in
stream_data. We should ignore the updates and warn that this has
occurred.
(imported from commit 3cd5a98a133012ae27ea0f43b03cc9d8e459e49c)
A description was added to the streams and it is now displayed on the
subscriptions page. It can not be set in the UI yet.
(imported from commit 81d08b65eee42dba87cd99dd5bd30106c4eb6c6a)
We were calling build_stream_list() twice in succession for
no good reason. The call to build_stream_list() inside
populate_subscriptions was pulled out to happen right after
its two callers.
(imported from commit 816ae2fd34224d8baf4e4bcccdb670143795bb42)
This matches page_params.unsubbed_info, plus it sets up to
add something like page_params.stream_dict without being confusing.
(imported from commit 2d40deb779e5c7a488d6952560b4119094bbc0d8)
* Escape " as "
* Enable GFM newlines
* Output a linebreak after <br> in the generated markup
(imported from commit c007ec422054f9fc66a810b66aac70f70a2a1952)
We've only gotten one error report for this error, and it didn't have a stack
trace, so it's hard to know whether this will actually fix the issue or not.
(imported from commit 7bff052347a33f67d8479b1cb23f6e5e24defc75)
The client's update_person() method will look for an is_admin
change and update the gear menu as needed, as well as the underlying
data structures that help draw the admin page user list.
(imported from commit af8c173886d63dd102c63336bbca176f49e1036d)
Always render the Administration menu item from the back end, but
make it be hidden by default until the page is loaded. Then, the
client can un-hide it as needed.
(imported from commit 66e607eec430d7179b4d5ac3f5416f5be8ac26c9)
Going forward, the back end may supply fields other than
full_name, like is_admin, so we should make sure the field
is in the hash first.
(imported from commit be94b9698bae0866444739e2846ff65a3ab27eb6)
The code to keep page_params.people_list and realm_people_dict
values in sync with people_dict was unnecessary, as they are
the same underlying object.
(imported from commit 0a901213977ed21a0587ed1590ab5434be756f51)
Add javascript to handle the button clicks and update the status based
on the subscribe and unsubscribe events from the server.
(imported from commit 6b9c0b40d9084e3d8b64bed701ebc786bef6d432)
The message_rendered.zulip event fires after a new messages was rendered
but before it is added to the DOM. This allows javascript components to
change the display of a message before it is added to the DOM.
(imported from commit 69448a250863853a6d0a6e428dcfa12db50f2f71)
There was a bug where you would type "is:private je" into the search
suggestion and see undefined:jesstess@zulip.com. Now we use
the "pm-with" operator. The search suggestions for people are kind
of complicated now, because there is some overlap between
get_private_suggestions and get_person_suggestions.
(imported from commit 7d330f34f4a433995420de6eb90cb41229b70272)
There was a bug where you could not reactivate a user after
doing another user-based action on the page, because we weren't
clearing the active_user_row class on the previous row, and
then $(".active_user_row").find('.email').text() would be a
concatenation of two user emails and cause a "No such user!"
error.
(imported from commit c867d3bc0855e02b17b9553e1924926c2dd50e56)
It was confusing, because it has different meaning that being
the opposite of active_user_row.
(imported from commit df190afb2d9bccf9790c7373802b16ff6da2f2cb)
If you make a stream private/public from the Streams page
(which admins can do now), then we now correctly redraw
the swatch to have/not have the lock icon.
(imported from commit 35eb4ba12ad152e43b40f1bcf2c5db784a965dee)
This function can redraws the lock icon (or lack of lock icon)
for a stream in the stream sidebar. It can be called when
admins change the stream privacy.
(imported from commit 880133d02525137094c48ecad8cf2dfff59f3307)
The new name is more descriptive of what the function does, and it
also has the side benefit of cleaning up greps for the backend
function called build_narrow_filter().
(imported from commit 4b88fa863d7c1751946c78977f2ffaf19dd3ae5e)
The type parameter was always passed in as "stream", and we
only render the stream_sidebar_row template, so let's not
pretend like we support arbitrary message types here.
(imported from commit 8a852a68ddda336024793f6fdafa648883bb815e)
We now call add_stream_to_sidebar() instead. The old function was
only ever called for streams, so the newly named function is more
descriptive of what it does.
(imported from commit 7ae373279ea9987d3637cdbdc427680ac989fe86)
This is a node test that verifies that
stream_list.add_stream_to_sidebar() creates the right
DOM when it renders the stream_sidebar_row template.
The test also makes sure that the DOM gets put in the
correct place to be retrieved by stream_list.get_stream_li()
calls.
(imported from commit ed4c0148da2261870e3db5a9b553913788b4eccd)
Added a default_desktop_notifications boolean to userprofile with a UI
in Zulip Labs. This flag is used to default the notification flag on new
subscriptions.
(imported from commit a25223cc5ecf09980cf877991e25034bb3fd4046)
If a user is not allowed to create new streams, then do not
show the "Create new stream" UI at the top of the settings page.
(imported from commit b97626938d8b612317c2189f7eca0d4bd27fc274)
Our logic for unnarrowing when messages were read during the narrow
did not properly use the then_scroll option and thus actually set the
scroll position when they selected a new message. This was
accidentally prevented from being a big problem by the incorrect
scrolling logic that was fixed by:
Only preserve_pre_narrowing_screen_position when preserving pointer.
which caused the browser to scroll _back_ to close to the correct
scroll position (but not the intended scroll position -- it would
usually be a little bit off).
(imported from commit d779de8f89590d242f62d32b22a297bdc096c594)
The one call we were making to it was actually unnecessary since highlighting is
no longer done client-side.
(imported from commit 7644a5961ca48cd57f4b65c6f698083677e0a130)