Commit Graph

478 Commits

Author SHA1 Message Date
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
Jessica McKellar 3d1fd4a1e9 Add Redmine integration documentation.
(imported from commit ef68b6e1e97b26b2ba47e6811403c338f93e41af)
2013-09-30 11:30:04 -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
Waseem Daher 219bbe255b activity: Only make the summary table not-full-width.
For whatever reason, it makes it easier to compare the detail pages
when they are full width, since each column is in a more or less
consistent place every time.

(imported from commit cba47ac1a370884c0397d26d6028248f0b9cc9d7)
2013-09-26 15:29:29 -04:00
Steve Howell 2944f12ba7 Make tables in /activity auto width.
(imported from commit 527c49f1cca050f8574eec811c7762654535c88e)
2013-09-26 14:36:28 -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
Waseem Daher e0f9f68219 Tweak UI for 'Rename stream'.
(imported from commit 7be2b92b796b6e0925ea604251442b3606e54da7)
2013-09-24 16:19:54 -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
Allen Rabinovich d9ecf6499c Show topic chevrons only on hover and with proper offset
(imported from commit f19770bac4ec99eac83cf8211fc4d97e34c5aaa1)
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
Kevin Mehall e31fb25d64 Correct cursor on the desktop apps alert close button.
Trac #1818.

(imported from commit 507b19c8f333de9446a663b9a2ec05e1ba74e6ce)
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
Zev Benjamin f5761401b7 Make LazyLoad copyright notice conform to our third-party JS standards
(imported from commit a7eba8569bf52e82f150f9fb3b2f3abfb0eb0c2b)
2013-09-23 11:25:58 -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
Allen Rabinovich 0b9b01e96a Revert to old logo
(imported from commit 0e4ccff295797d36ee89ffb078bef06b5a5edca0)
2013-09-19 13:20:27 -07:00