Commit Graph

525 Commits

Author SHA1 Message Date
acrefoot 83d2fcaf58 above-composebox notifications only on zulip.com realm
(imported from commit edc86511adb168e648652ecea54f7ee4f16b47eb)
2013-11-01 12:34:39 -04:00
acrefoot 434b7ac120 Give Feedback in non-obvious cases for sent messages
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)
2013-11-01 12:34:39 -04:00
Tim Abbott c5b0076ecf Rename humbug => zulip in audio files.
(imported from commit f297f1f9c8683d4e02e7a0c4ecf2182fc79b89f9)
2013-10-31 15:29:48 -04:00
Kevin Mehall 58f7138e07 Collect additional debug information for JS errors
(imported from commit 7c94ad118c2cd33e5b6eec4e27fd22dfa2d56909)
2013-10-31 13:18:43 -04:00
Jessica McKellar f1e90086f5 Remove the onboarding checklist.
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)
2013-10-31 11:34:15 -04:00
Jessica McKellar 69481a0843 Remove 'All messages' sidebar link.
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)
2013-10-31 10:38:49 -04:00
Zev Benjamin d5b7cfd21a Fix whitespace
(imported from commit 095ea8640a18560aae7bd5e045c4f68c96f96f73)
2013-10-30 15:52:35 -04:00
Zev Benjamin eb7fd1ba51 Add some front-end debugging changes
(imported from commit 21684b09100bc0a24372948a9417c973709c1be2)
2013-10-30 15:52:35 -04:00
Zev Benjamin 2e6b3131b5 blueslip: Add `debug()` method that logs to the in-memory log but not the console
(imported from commit 7ca312d89ad3ec26c955b846e98c94b2b84a397e)
2013-10-30 15:52:35 -04:00
Steve Howell 8449a74fdf Remove obsolete comments.
(imported from commit d360efebd5201129becd22cb547c6c1fd24ed918)
2013-10-29 10:59:42 -04:00
Steve Howell 7cf66b5bb8 Allow users to upload avatars on the Settings page.
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)
2013-10-29 10:59:41 -04:00
Steve Howell af6de2053e Give Notifications settings its own alert area.
(imported from commit 1d17b85f383862d1f37b5750af40aa8d9a1d8bf2)
2013-10-29 10:59:41 -04:00
Steve Howell 68942a8f3a Properly split up "Your Account" and "Notifications".
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)
2013-10-29 10:59:41 -04:00
Zev Benjamin 90d92814ca socket: Throttle reconnection attempts
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)
2013-10-28 16:42:16 -04:00
Jeff Arnold 4b9981c333 Make clicking to the left or right of the compose box close it
Addresses #1819

(imported from commit 6d06283cb8a39107151ffc5ce5a85c1455e332f2)
2013-10-28 15:33:11 -04:00
Jeff Arnold 96b4103c80 On click, only focus the compose box if there's no selection
Addresses #4

(imported from commit 4a2400dd4ae95863f7408af1e3c0f058a516adb7)
2013-10-28 14:53:43 -04:00
Zev Benjamin 801305b8d1 Re-enable the use of sockjs in local dev instances
This reverts commit 0619867d7807f3bf48d317e7452026b1a497e0df.

(imported from commit fda4f9f21d146dd63312fb1cb374eccd36a1261b)
2013-10-28 14:30:53 -04:00
Zev Benjamin 32da8ecff4 socket: Immediately try to reconnect when the client attempts to send
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)
2013-10-28 14:25:36 -04:00
Zev Benjamin 01835dca0f socket: Remove old requests
(imported from commit 75bc776e539a2f036ed486e99a6635c38f56cdcb)
2013-10-28 14:25:36 -04:00
Zev Benjamin 7abbf096de socket: Add a little more logging for debugging
(imported from commit fa227971afc47f74b4784d1466cf58fff3b68113)
2013-10-28 14:25:36 -04:00
Waseem Daher 1e6f3bb4cd Move 'unshare the love' flag into feature_flags.
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)
2013-10-25 18:48:46 -04:00
Waseem Daher a56fe810b2 Hide "Share the love" for local server.
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)
2013-10-25 18:08:47 -04:00
Steve Howell 356b400500 Remove obsolete stream_data.all_subs().
(imported from commit 7542638ad5132ca382e5e461a76c58d141db532d)
2013-10-25 13:50:34 -04:00
Steve Howell 392197da28 Fix recent Streams page regression.
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)
2013-10-25 13:50:34 -04:00
Steve Howell 20c18d905d Rename internal subscribed_streams() to exports.subscribed_subs().
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)
2013-10-25 13:50:33 -04:00
Zev Benjamin 77a1ed967b Make the socket accessible externally for debuggging
(imported from commit 8f78d09edc05f8eed5f1a2d87643bdd7b7d9bec6)
2013-10-24 17:40:43 -04:00
Kevin Mehall 0a3a22cb3d Support authenticated upload URLs.
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)
2013-10-24 17:01:06 -04:00
Leo Franchi 05564ec0e2 [schema] Add a config option for enabling/disabling push notifications
(imported from commit 5649188cd5e0e4edb6e71559ec7d7fc5e92efaf8)
2013-10-24 14:54:30 -04:00
Leo Franchi 196706cc64 Use POST with method=PATCH when sending a bot edit
(imported from commit e6ee1631f0b37e66da5979a5fa6e6860d7f4d0b3)
2013-10-24 10:22:06 -04:00
Tim Abbott 934f8521e5 Don't display subscribe/unsubscribe notices in home view.
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)
2013-10-23 18:51:46 -04:00
Tim Abbott 52829efe52 Add tools for collecting data on message sending times.
Usage, on the javascript console:
> feature_flags.collect_send_times = true;
> compose.send_many_messages("test", "test", 3)
> compose.send_times_data
  [47, 99, 48]

(imported from commit a2a22eea9bb1bbe24a79ec0453c099dabfc61c19)
2013-10-23 14:05:01 -04:00
Zev Benjamin 724b8e6b8a Temporarily disable sockjs in local dev instances
This is just until we hack up run-dev.py to also start the message
sender worker.

(imported from commit 0619867d7807f3bf48d317e7452026b1a497e0df)
2013-10-23 11:31:35 -04:00
Allen Rabinovich 3a5276aa4e Settings page changes
Bug fixes

Small fix to integrations and api links

(imported from commit 5944b175fbe0fdc4fdb5ecb3cab4e333127ca353)
2013-10-22 23:28:46 -07:00
Zev Benjamin 286803660f Optionally log message send times on the client
(imported from commit 900a513496b7796173a7685a55b110b63024f574)
2013-10-22 18:45:11 -04:00
Zev Benjamin ac87d92138 Send messages using SockJS on staging
(imported from commit 812d20b1eab76eeb0d8fb92029fdb38d5faa9cce)
2013-10-22 18:45:11 -04:00
Zev Benjamin 89bcabbb65 Disallow XHR streaming when running the test suite
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)
2013-10-22 18:45:11 -04:00
Zev Benjamin 3c73468ba8 Disable unsupported SockJS transports
Because our authentication system reads cookies from the initial
connection attempt, several SockJS transports can't be used.

(imported from commit 34b9571225d39072985b8223fb12c43c7235841f)
2013-10-22 18:45:11 -04:00
Zev Benjamin ca16644152 Add client-side SockJS wrapper
The wrapper handles our RPC protocol, authentication scheme, and
reconnections.

(imported from commit 1fed2d160582c235a32de80a80b3e451c13a7b1c)
2013-10-22 18:45:11 -04:00
Steve Howell ac7eace8fb Remove subs.reload_subscriptions().
(imported from commit 72d831101033fb7db4b024781bf597f63345be79)
2013-10-22 15:51:19 -04:00
Steve Howell f34b2e4f75 Don't repopulate subscriptions on a stream rename.
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)
2013-10-22 15:51:19 -04:00
Steve Howell b55a2bfc58 Avoid reloading subscribers when opening Streams page.
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)
2013-10-22 15:51:18 -04:00
Steve Howell db398d5e41 Send ids, not emails, of subscribers when loading the page.
(imported from commit 26bbf38664d246476df7062432fa20add7d4cb11)
2013-10-22 15:51:18 -04:00
Zev Benjamin c665139012 blueslip: Send the log back to the server when reporting errors
(imported from commit 013057a8ddc2ddb73b03b0de5c139052b22f5319)
2013-10-22 15:39:17 -04:00
Zev Benjamin 3276f8a4d0 blueslip: Record calls to log, info, warn, and error methods in an in-memory log
(imported from commit 556a92725c492de558269c0760a96783e2a3fc18)
2013-10-22 15:39:17 -04:00
Zev Benjamin 1c841e4454 blueslip: Refactor log, info, warn, and error methods
(imported from commit 4b1eb94a7de0c2b25bde19c3c3a88a13ecb4d1c0)
2013-10-22 15:39:17 -04:00
Kevin Mehall d92939d53e [important] Fix regression in 9259a24
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)
2013-10-21 16:01:18 -04:00
Kevin Mehall bd58861b09 Ignore summarized messages when calculating rendering windows.
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)
2013-10-21 11:48:57 -04:00
Kevin Mehall ba87ebc246 Fix duplicated summary blocks when scrolling up.
Make prepend re-render the whole render window instead of just the added
messages.

(imported from commit 6270a33ff0fe98fc901b687ca533ef0ea127d052)
2013-10-21 11:48:56 -04:00
Kevin Mehall a528b7134c Move summary_adjective to its own method
(imported from commit d451ffcf3ff460ffe030e265ca83fec1094c6217)
2013-10-21 11:48:56 -04:00
Kevin Mehall 463b10cf0e Enable summarization only for the right narrows.
* 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)
2013-10-21 11:48:56 -04:00
Kevin Mehall 89d149c6f7 Fix @-mention "not subscribed" warning for all_public_streams bots.
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)
2013-10-18 14:55:32 -04:00
Jessica McKellar 06566b3776 Don't receive notifications for messages on muted topics.
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)
2013-10-18 14:38:31 -04:00
Jessica McKellar efda426b86 notifications: split message_is_notifiable into multiple ifs for clarity.
(imported from commit 33d1e2135a87192cc4d964db534b31ae9335595a)
2013-10-18 14:38:31 -04:00
Jessica McKellar a9c7f3a387 [manual] Use the name instead of the domain for the user-visible realm identifier.
Do not push this commit to prod until the historical realm names have
been populated.

(imported from commit a58191d181d2fb2b8b5e9793ea57707b36812cfc)
2013-10-17 13:47:51 -04:00
Steve Howell 4a0315fbfd Organize feature flags code a bit better.
(imported from commit a9b1405db99e54de8bed996b32215ca736f2dd56)
2013-10-15 09:57:20 -04:00
Steve Howell 36690ee6f6 Remove transitional feature_flags.muting flag.
(imported from commit 98a6cc4f340489b7817084e5ca5dcbcb75021813)
2013-10-15 09:57:19 -04:00
Steve Howell b98e7f8d90 Remove transitional feature_flags.alert_words flag.
(imported from commit f00eba8a12054e9771105e341e2652a53271e298)
2013-10-15 09:57:19 -04:00
Steve Howell d5f14e3bb7 Turn on propagate_topic_edits for everybody.
(imported from commit 936d2417120af5e9798638e0575724d45b9a207f)
2013-10-15 09:57:19 -04:00
Steve Howell 0ad4554723 Allow customer12.invalid users to narrow to a single message.
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)
2013-10-11 15:52:10 -04:00
Steve Howell 78e4fe6594 Support command-click for stream/topic links.
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)
2013-10-11 11:58:51 -04:00
Leo Franchi 1db703595e Enable topic propagation for CUSTOMER9
(imported from commit 646a765fad0c5b285b11daabb92a5c0f47c83fed)
2013-10-10 16:30:37 -04:00
Steve Howell 89cbda5001 Keep in-progress compose open on narrows.
If the user has text in the compose box, don't close or
change the compose box when they narrow.

(imported from commit f9b400f6bac37cb313f1fd87aadb3ba1d3a035ef)
2013-10-10 11:20:49 -04:00
Steve Howell 8017fc9a15 Move compose.start() calls out of click handlers.
For the two cases where narrowing should open the compose box,
we now put that logic inside of narrow.js.

(imported from commit 570e22e90c2f6d422ba71cce400c075f0b8adf51)
2013-10-10 11:20:49 -04:00
Steve Howell 7007cf203d Move compose.cancel() calls out of click handlers.
Handle closing the compose box inside of narrow.js, to
ensure consistent behavior for all the narrowing UI options.

(imported from commit f17a687491eb2361c73032cd974cedb2a0a2dd85)
2013-10-10 11:20:49 -04:00
Leo Franchi 6e188fb067 Tweak alert_word matches and add some more tests
(imported from commit 63dc4064c15d5d33a7ec0c992b183bf323dd4ee8)
2013-10-10 10:58:21 -04:00
Steve Howell a78a1ec36c Use <a> tags for links in the recipient/summary bars.
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)
2013-10-09 17:09:10 -04:00
Kevin Mehall e29855e106 Show floating recipient bar on faded messages.
Trac #1837

(imported from commit 1f90b02a5a07b5ce106ad935a4b1cf18e47a0909)
2013-10-09 16:33:24 -04:00
Luke Faraone 1975a6f693 Cancel a compose if you click on one of the global filters
See trac ticket #1840.

(imported from commit 3e0a781252db575e5c0abb70565919e4cdaa963f)
2013-10-09 15:37:00 -04:00
Allen Rabinovich fe9cc4597f Make settings menu more apparent
(imported from commit 15e5db5c4792d39b54fa5a354f1156cde355160b)
2013-10-09 08:42:54 -07:00
Leo Franchi 51e0bea608 Autocomplete emails in sender: completion
(imported from commit 44dc337842d46349b103cf9631faa7d439be682c)
2013-10-07 14:55:58 -04:00
Leo Franchi 33dacae82d Split calculating of prefix from narrow operators into function
(imported from commit 940d7d7290e0357aad300ea00b6fcc59cd56cae1)
2013-10-07 14:54:05 -04:00
Steve Howell 265a3e2339 Turn on alert words for everyone.
(imported from commit d4281a3a23e6df97e0c621fdc757ec0b75db1de2)
2013-10-05 15:50:05 -04:00
Kevin Mehall 40ad01371f Don't close the compose box on right click in Firefox.
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)
2013-10-04 14:38:05 -04:00
Leo Franchi 8c081bceb2 Enable alert words for pixleeteam.com
(imported from commit 622d9497f6c7e0434601291a7343c663e2567865)
2013-10-04 14:23:12 -04:00
Leo Franchi 101a70a7ce Fix selector for gravatar url polling
(imported from commit e0f915a9e5894e3749ca90bab674f36ee9c15347)
2013-10-04 12:10:22 -04:00
Waseem Daher a9a50ac470 Enable muting for everyone.
(imported from commit d107df94561c4ccb46a79ae09663239c4fb52061)
2013-10-04 01:37:47 -04:00
Steve Howell 5ae5f6578c Turn on muting for CUSTOMER4
(imported from commit 2f02edeacc2ae49a88dfc16f0f92fe6f5dfd9524)
2013-10-03 17:09:31 -04:00
Leo Franchi 0d6ad56c29 Decode operand in filter.js in operator-aware way
When decoding an operand, a + can be converted to a space
only if the operand is not an email address.

(imported from commit 08fc36a579bbe6409137c60c0fa9579fe3ab2c43)
2013-10-02 12:11:15 -04:00
Steve Howell d437f6602f Add muted_topic style to the topics stylebar.
If you mute a topic, it will show with opacity 0.25.

(imported from commit 72517550cc9f1daa779b3aac6cacd39831d5aa20)
2013-09-30 16:52:19 -04:00
Steve Howell 45434d3f89 Fix bug with muting topics that are all integers.
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)
2013-09-30 16:52:19 -04:00
Steve Howell d94d2d71c5 Always show narrowed topic in the topic sidebar.
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)
2013-09-30 16:52:19 -04:00
Steve Howell fcb6a9b572 Use "topic_name" var/field in rebuild_recent_subjects().
This is part of nibbling away at deprecating "subject."

(imported from commit fbd26b5f1386a174de76e04298a68b3a7b18606e)
2013-09-30 16:52:18 -04:00
Steve Howell 10145c0e83 Simplified setting active topic.
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)
2013-09-30 16:52:18 -04:00
Steve Howell 6b8013c631 Don't mutate global recent_subjects when creating subject sidebar.
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)
2013-09-30 16:52:18 -04:00
Steve Howell ec1c82d6d7 Select closest id in MessageList.rerender().
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)
2013-09-30 16:18:18 -04:00
Steve Howell 3ff0ee6b21 Turn off collapsing on staging.
For now, I am just turning off the feature.  I will remove
the code in a couple days.

(imported from commit e9988fb2ead6e711274b60d6402326ec4c344cce)
2013-09-30 10:42:58 -04:00
Steve Howell cdb7737a78 Turn on muting for Iceland (customer8.invalid)
(imported from commit ab587777cf20947160dd8fa900151ca2800ffd01)
2013-09-29 22:44:09 -04:00
Steve Howell 8f1498c766 [important] Fix stacktrace in unread.js.
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)
2013-09-29 22:42:33 -04:00
Steve Howell f67acb3157 Filter duplicate messages more aggresively.
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)
2013-09-28 15:48:38 -04:00
Steve Howell ea7fda59d3 Reset _all_items in MessageList.clear
(imported from commit 3e319578500480ebfe0da6c4541628a61f8b5ff9)
2013-09-28 15:48:37 -04:00
Steve Howell 49232d9173 Preserve muting preferences across reloads.
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)
2013-09-28 15:48:37 -04:00
Steve Howell c79e3a95b1 Avoid selecting hidden message ids.
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)
2013-09-28 15:48:36 -04:00
Steve Howell a48af3bd6c Make muting rerender properly when getting updates.
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)
2013-09-28 15:48:36 -04:00
Steve Howell 2a4cd3c69a Exclude muted topics from stream/home unread counts.
Update get_counts() so that it ignores counts for muted topics
when calculating stream/home unread counts.

(imported from commit 9b4e4da4346c225c535e97d709d3dee032603cc5)
2013-09-28 14:53:11 -04:00
Steve Howell c7b7f8d79a Inlined unread_hashkey() function.
The indirection was more confusing than helpful, especially
since the function had side effects, despite its getter-like
name.

(imported from commit 85d9cf642b4177f62488136f0e0f7f6c9304942e)
2013-09-28 14:53:11 -04:00
Steve Howell 8d3f4366f8 Collapse unread_counts.private to unread_privates.
After killing off unread_counts.stream, the only field of
unread_counts was "private", so I just made unread_privates.

(imported from commit 9678f5b03524afb883ec4fa638b059e698888e78)
2013-09-28 14:53:11 -04:00
Steve Howell 664cb2460d Clean up references to unread_counts.stream.
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)
2013-09-28 14:53:10 -04:00
Steve Howell 534edfaf33 Compute stream/home unread counts from unread.unread_subjects.
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)
2013-09-28 14:53:10 -04:00
Leo Franchi c5183427f3 Respect enter-to-send in edit box
(imported from commit 6e3fc6495b7012aa12728a78b8bdd95701bb21e1)
2013-09-27 13:52:14 -04:00
Leo Franchi 87858a6050 Don't autocomplete mentions while message editing
(imported from commit c4b402d5c0e50a7dd85f658f660633f3a3df5d54)
2013-09-27 13:32:02 -04:00