Commit Graph

6493 Commits

Author SHA1 Message Date
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
Tim Abbott 0e23b2240d queue: Log how long it takes to connect to rabbitmq.
(imported from commit be3cd9da5e7c213cfed62feda2e676038ade57a6)
2013-09-30 13:48:48 -04:00
Jessica McKellar 3d1fd4a1e9 Add Redmine integration documentation.
(imported from commit ef68b6e1e97b26b2ba47e6811403c338f93e41af)
2013-09-30 11:30:04 -04:00
Zev Benjamin a906890b4d install-server: Run resize2fs
This allows us to have larger root filesystems than the AMI image.

(imported from commit 4e9698432b0c154a0bc635df07abd278c08a4905)
2013-09-30 11:09:26 -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 bbfc8c886a Remove force_minify flag for min/activity.js.
This has been deployed, so the current code is now properly
minified, and we don't need the force_minify flag any more.

(The flag is needed when you remove a JS file from JS_SPECS.)

(imported from commit 8b3c7ffdbc875011d59c2560034750f0077db616)
2013-09-29 11:00:26 -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
Jessica McKellar bbdf18b106 Remove the redmine URL and webhook.
The plugin will use the standard send_message path.

(imported from commit 36aba7298c07d77785b3cc19499519c1423ca8f1)
2013-09-27 16:35:14 -04:00
Leo Franchi 31d8513657 Use a one-week bound instead of sender bound to optimize query
(imported from commit 5c13f3f3a5f2a54b6645cb7f2304a6b54b759cea)
2013-09-27 16:27:35 -04:00
Jessica McKellar ed0fd51160 [schema] Add a date_created field to zerver_stream.
(imported from commit 1360da91b81fad59d49068fdf05205eef982e64a)
2013-09-27 16:23:56 -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 d9dba41767 Add some tests for composebox_typeahead.compose_content_begins_typeahead
(imported from commit 01e71ebe87da6e866817dc56555a7e6ee61cb003)
2013-09-27 13:52:13 -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
Jessica McKellar 03fe84aa6a nagios: use last Received date to determine message age.
If there are delays while routing the email, we don't want to get a
spurious alert.

(imported from commit 3a9e3abf0a4db2b026f797c929f1b46978f1e5e4)
2013-09-27 11:39:42 -04:00
Jessica McKellar 4acddabe10 nagios: parse dates using timezone-aware functions in the email mirror check.
Why does email.utils.parsedate also exist? To put bugs in peoples' software.

(imported from commit a3dca741e5274027ef177388b49061b9b3c5d29e)
2013-09-27 11:39:42 -04:00
Jessica McKellar f0911f51a0 email mirror: ignore decoding errors.
Empirically, we only get these for malformed emails where the charset
specified in a message part header does not match the true encoding of
the part. I checked what the resulting Zulip looked like for the
original offender, and it looked find with ignoring errors.

(imported from commit ac6ba65b611cb22d4ec547b75a585abce6fc50b0)
2013-09-27 11:34:57 -04:00
Leo Franchi b2a352da00 Limit Messages to those sent in this realm when prepopulating
(imported from commit af6312705bb43159e4448c16a9e05c00ca696ed5)
2013-09-27 11:12:09 -04:00
Leo Franchi 4102b8e844 Add query count tests for bulk_add_subscriptions
(imported from commit 84a68e3e50178df383e66bb29008da6086709eda)
2013-09-27 10:26:11 -04:00
Leo Franchi 0fe3da55e3 Reduce number of queries done by bulk_add_subscriptions
We now bulk-fetch subscription information once from the database
and use it throughout bulk_add_subscriptions in order to avoid
hitting the db O(streams) times.

On my machine this shaved the accounts_register API call from making
66 queries to making 37 queries.

(imported from commit 5dd5ad3f50b2a6edf85b5f1d55ebd697a1c60647)
2013-09-27 10:26:11 -04:00
Leo Franchi 88242de052 Use bulk_add_subscriptions in account_register
We have a handy bulk_add_subscriptions function to make cases
like this fast, so lets use it.

On my machine this reduces the number of db queries during account_register
from 112 to 66.

(imported from commit 21a6b31d0f229998d095735b8c581a50ca6aab66)
2013-09-27 10:25:23 -04:00
Leo Franchi 1e6b83b6c8 Fetch stream.realm information when fetching default streams
(imported from commit 08eb32e6ecda75b17d6532b0421c371de2327027)
2013-09-27 10:25:23 -04:00
Zev Benjamin f6d8a01678 Move worker logging out of main server.log
(imported from commit 4590dd2a6adbf8e0e0a6bf08d90489246350cfb9)
2013-09-26 22:05:12 -04:00
Steve Howell a9b3b3ad23 Fix column names in General tab for /activity.
(imported from commit 6be24be9ad022f2b0aa6fddefffd772dfb2ebfd6)
2013-09-26 22:04:50 -04:00
Steve Howell 902185f8fb Add User Profile Count to General tab on /activity.
(imported from commit 231b3d6f2fe48f511d6387e25c2fea5e3accc186)
2013-09-26 22:04:36 -04:00
Steve Howell b84fb319ee Remove all-user counts in realm detail views in /activity.
(imported from commit 2231ef9a5f67e5b951c678d7f0d3f14dc252435d)
2013-09-26 15:41:20 -04:00
Steve Howell e0ceeb3340 Fix blank Desktop tab in /activity.
(imported from commit d1b7daa6db505feeb18baa6a546fd0e3fccf154b)
2013-09-26 15:41:20 -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 85b7c93bd2 Show count of active sites.
(imported from commit 023c7880cd7784bbbb49589acde9f59aed8f1765)
2013-09-26 14:46:35 -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 94cec018c0 Force-minify min/activity.js.
The minify logic doesn't have an easy way to detect that you
removed a file since the last deployment.

(imported from commit 50d05fcdad382a586073c06d29d279433d1bba81)
2013-09-26 13:55:45 -04:00
Steve Howell 430aee6f87 Add a "General" tab to the /activity summary report.
It shows domains and how many active users they have.  A
user is consider active if they have done something at least
as active as updating their pointer in the last day.  Domains
with no meaningful activity in the last two weeks are excluded
from the report.

(imported from commit 700cecfc7f1732e9ac3ea590177da18f75b01303)
2013-09-26 13:20:02 -04:00
Steve Howell 6b5d569888 Extract local var "data" in get_activity().
This is partly just cosmetic, but it also sets me up to
build "data" more dynamically.

(imported from commit d436f700b137c1db3e9f50d308944231ce89bb83)
2013-09-26 13:20:02 -04:00