Commit Graph

590 Commits

Author SHA1 Message Date
Steve Howell 6d511486cb Add activity.process_loaded_messages() and get_huddles().
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)
2013-11-05 15:34:28 -05:00
Steve Howell a4ff7320fb Remove unused presence_description "away" entry.
(imported from commit 46f377399335ca9757ee52ecd21d6679b52635ed)
2013-11-05 15:34:28 -05:00
Steve Howell 617b0a95d2 Short circuit MIT case earlier in update_users().
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)
2013-11-05 15:34:27 -05:00
Steve Howell 7f3115fa53 Move set_presence_list from ui.js to activity.js.
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)
2013-11-05 15:34:27 -05:00
Steve Howell 82fd0f2b52 Rename user_info -> presence_info inside activity.js.
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)
2013-11-05 15:34:26 -05:00
Kevin Mehall e82f11ed46 Fix a JS error introduced by the debug logging.
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)
2013-11-05 15:07:24 -05:00
acrefoot e9bd56b5a0 Make topic edits propagate by default from message header form
(imported from commit 6adcce6ebf90b35e84316e9f079de4010a635f8b)
2013-11-05 12:46:59 -05:00
Tim Abbott 8853d86b17 Disable notifying on sending outside view for now.
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)
2013-11-04 18:32:34 -05:00
Tim Abbott 792b283dcd Report end-to-end sending times as experienced by clients.
This should help with determining the prevalence of slow sends as
experienced by users.

(imported from commit f00797679315c928af3c87ad8fdf0112f1dfa900)
2013-11-04 18:32:34 -05:00
Jeff Arnold 6483314f74 Only fade visible messages before rendering compose box
Partially addresses #1963

(imported from commit 0c941085ab6894e8e43015a116c49a5bdc674b5f)
2013-11-04 16:27:39 -05:00
Jeff Arnold a1c0590043 Eliminate useless code. You can't click into the box when it's closed.
(imported from commit 67268d7d156ffede2c9ab6a3ec94ab04c3876118)
2013-11-04 16:25:06 -05:00
Jessica McKellar 7e3035b2d9 Fix historical messages not getting their color updated on a color change.
Perhaps we should be checking based on an ID rather than the actual
text, but this fixes the proximal issue.

(imported from commit b125415c3a8356255b64c8e22733532491ea0065)
2013-11-04 10:44:55 -05:00
Jessica McKellar d43c01c911 Complete rebranding of 'in home view' to 'muting' the stream on the Streams page.
(imported from commit a56ef49eefedbcc1ae14ec8486dd3ca73bed1f43)
2013-11-04 10:29:38 -05:00
acrefoot 9af244a6bc fix narrowing bug introduced by composebox notifications
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)
2013-11-01 18:33:10 -04:00
Waseem Daher 4a29f1002d Disable summarization via feature flags.
(imported from commit 8176b5364ee0b9f4be7cfe9ce65f502dec116d15)
2013-11-01 13:59:41 -04:00
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
Leo Franchi 4ea15758cd Enable compose-box typeaheads in the edit message box
(imported from commit 8cf1ec74854889061e822f091c16cb817f00c56b)
2013-09-27 13:32:02 -04:00
Leo Franchi f2ae7f55c5 Use focused element for typeahead rather than hardcoding composebox
(imported from commit 1e9fed51e350f5dadec73c25238c0f3657af7f1f)
2013-09-27 13:32:02 -04:00
Leo Franchi 4f0f469a8e Factor out compose typeahead into individual functions
(imported from commit 293c61d5793ced7792c57713210a34736d851ae8)
2013-09-27 13:29:22 -04:00
Steve Howell 9110ebd208 Improve the UI for /activity.
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)
2013-09-26 13:20:00 -04:00
Jessica McKellar 4d730c1691 Close the compose box on a stream sidbar narrow.
(imported from commit 6d7d80d29c4e7dc68807a7fcb9ce2d8573c1c3e0)
2013-09-26 11:49:54 -04:00
Steve Howell 3fc352788d Turn on 24-hour time for customer8.invalid (Iceland).
I added myself as well.

(imported from commit 44c631de4ef157f055258ffa609666bb58d163f9)
2013-09-25 22:10:44 -04:00
Steve Howell e2126b78ab Enable compose fading for CUSTOMER4.
(imported from commit 3be5b169b530c7bf6d5a9499710950fefa3cbde1)
2013-09-25 14:43:43 -04:00
Steve Howell be9eea6cd4 Disable compose fading for incomplete/wrong stream names
(imported from commit 2b6a0dbcd1464767e24704f270eeac2875be0d51)
2013-09-25 14:43:43 -04:00
Steve Howell 4d5842cdcd Add summary view to the /activity report.
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)
2013-09-25 11:33:11 -04:00
Kevin Mehall d9185cf455 Fix JS error when un-summarizing old messages.
`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)
2013-09-25 10:19:03 -04:00
Steve Howell 9df7ee454d Eliminate transitional email forwarding flags
(imported from commit cc9305e554a381de5a36b7c353bbf53b71b2d43c)
2013-09-24 16:19:54 -04:00
Steve Howell 49a55ca6fa Call blueslip.warn from stream_data.js functions.
It used to be calling blueslip.warning(), i.e. the wrong name,
and would crash.

(imported from commit ddc953488cdb22dd37ddf674dddf1e05f34eaec9)
2013-09-24 16:19:53 -04:00
Steve Howell a387535d2d Enable muting for internal MIT users.
(imported from commit 82dc8c620c5f9af5b7a366bd16aee9125b9ba634)
2013-09-24 16:19:53 -04:00
Jessica McKellar a0ff47a449 Add frontend support for newer realms receiving stream notifications by default.
(imported from commit 6b7f8d7bc85177d0d85384ac4bed508afdec7e83)
2013-09-24 16:19:53 -04:00
Steve Howell 660475bd0c Hide muted messages.
Instead of collapsing muted messages, just hide them altogether
in view where it makes sense to hide them.

(imported from commit 1c2c987ff302ceb135a025753cf421b4de1aea71)
2013-09-23 10:53:06 -04:00
Steve Howell 6c6816491d Add muting_enabled option to MessageList.
(imported from commit c86772b7dea864c49091c988772e17aae5efa5bc)
2013-09-23 10:53:06 -04:00
Steve Howell 022ef6e9b9 Add narrow.muting_enabled()
(imported from commit 8972d1e3ca347397664094a7f150ec86fd2f8f8e)
2013-09-23 10:53:06 -04:00
Steve Howell 21b30664b6 Create MessageList.add_messages() from zulip.js code.
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)
2013-09-22 14:35:53 -04:00
Allen Rabinovich 9ed05a1f85 Fix to list height computation
(imported from commit c43b07fa25f41146c8410bc41d90278c1a90a34b)
2013-09-20 12:11:31 -07:00
Waseem Daher aa6a3e1299 Enable alert_words for MIT.
(imported from commit 1765e9f6cd72fece834ef482f898096eb4a4f552)
2013-09-20 14:18:43 -04:00
Zev Benjamin 7c74983370 Ensure select_on_focus handlers are not called recursively
This fixes #1696.

(imported from commit 4d7ba3a1e34aa48d2675178913de30d081653762)
2013-09-19 19:10:45 -04:00
Steve Howell e79e74ade4 Add narrowed_to_topic() helper function.
(imported from commit 9190caa9b183893fb7ae883686b9bdbd661d5895)
2013-09-19 15:41:00 -04:00
Kevin Mehall 0da1d974bd Check the 'Get our apps' checkbox if you click any of the links to the apps page
(imported from commit 85795fae8a5ee78f0138aa08f09f645f75c5e9e7)
2013-09-19 13:23:35 -04:00
Kevin Mehall a77746e9fd Pull code that only has to run once out of the loop
(imported from commit 8c31c4bda6bf41e130fc4704d5520f500b9321f8)
2013-09-19 13:23:35 -04:00
Kevin Mehall bc36aad698 Show desktop apps alert when tutorial completes
(imported from commit 7719ec798dbcca519fd79ac8da9196e1a862764f)
2013-09-19 13:23:35 -04:00
Jeff Arnold f063921260 Enable summarizing for everyone
(imported from commit c03d48ad9c0fe6dfe86539fbff1f501b42b3b6d1)
2013-09-19 10:51:29 -04:00
Steve Howell c6a9297f1a Add blueslip warnings to stream_data functions.
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)
2013-09-19 08:52:54 -04:00
Jessica McKellar e73e3d1bac Don't error out on a name change for a stream you're not on.
(imported from commit 8438087b3b6c66f41b9d9152661a93f01a086b28)
2013-09-18 16:09:48 -04:00
Leo Franchi ce4a850bfc Remove all user we insert into autocomplete when alerting
(imported from commit 34521b5e9e312b5026f9dc015cc35de837d0e2a3)
2013-09-18 15:46:30 -04:00
Allen Rabinovich 5622e59b48 CUSTOMER7-specific left side user list at narrow widths.
(imported from commit 7504d86fe57e4e96f85dee18ede663c542d0144d)
2013-09-18 12:17:32 -07:00
Leo Franchi c588c7938c Allow message topic changing to propagate backwards
(imported from commit 470178ef5f7aaf09d4528c88ae6e33f17538fcaf)
2013-09-18 13:27:58 -04:00
Steve Howell fd81e04e16 Remove topic popovers when redrawing topics
(imported from commit 5350e5026dcfc9542c44b576ee967423adaf2c91)
2013-09-18 12:25:19 -04:00
Leo Franchi d3d4a41419 Block mit.edu from showing mention invitations
(imported from commit e8e85cad0198103a072cd452feb78a67b05b185c)
2013-09-18 11:50:58 -04:00
Steve Howell 80d634aced Add mute/unmute to topic sidebar menu
(imported from commit 96abc03e840ed6d720da8355f29242d9a070563e)
2013-09-17 18:53:28 -04:00
Steve Howell 8429105c24 Add chevron menu for topics in left sidebar.
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)
2013-09-17 18:53:27 -04:00