Commit Graph

6575 Commits

Author SHA1 Message Date
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
Steve Howell e93dce9ce6 Extract activity_table.html template for /activity.
A small functional change here was to eliminate an enormous "Usage"
headline that was already implicit from the tabs.  It would have
complicated the refactoring to try to preserve it, and I don't think
anyone will miss it.

Extracting this template will give us a little more flexibility
to customize future tabs in the /activity page.

(imported from commit bdb0b7030c8ec1e20d4451dc059830c3f5ea7632)
2013-09-26 13:20:02 -04:00
Steve Howell 0950aa45c4 Eliminate the default_tab attribute in ActivityTable.
(Just have the template automatically select the first tab.)

(imported from commit 4a1877c8d3d6215f8e8ad6a184c79bf4eb001001)
2013-09-26 13:20:01 -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
Steve Howell fd4601c44d Add a Desktop tab to /activity.
(imported from commit 7a907e0b904be57613d5ec34c335a962ea41db48)
2013-09-26 13:19:59 -04:00
Steve Howell b8f3b38524 Make /activity client tab order be deterministic.
Use an array of tuples, not a dictionary, for the client tabs.

(imported from commit d0ef09bd7885fbb261227786b90ea2949cea7ab4)
2013-09-26 13:19:59 -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 a99d2bebab Assert that registration involves <= 53 queries.
This isn't a very strong test, to be sure, but it's something.

(imported from commit 578dbc6601f38186fec9bfb061a8bbc322201ae7)
2013-09-26 09:55:43 -04:00
Steve Howell 6890c89936 Harden the queries_captured() test decorator.
Before, it was trying to use connection.queries, but Django
could pull the rug out from under us.  Now we monkeypatch
the CursorDebugWrapper methods instead.

(imported from commit 25d5bab47673f2b66a6325f48d33e66c31055ab3)
2013-09-26 09:55:42 -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
Tim Abbott 2fab8ab8f5 Write zephyr mirroring logs to /var/log/zulip rather than ~/.
(imported from commit 7b76fa7834fb82fe3967f9e5ef963f26b7ff7184)
2013-09-25 16:52:41 -04:00
Tim Abbott 4be5d81af1 [manual] Write logs to /var/log/zulip rather than /var/log/humbug.
This requires a puppet apply to update the supervisor configuration.

(imported from commit f2836b6d9c53791af6f6ceb1650d0e0740df70ab)
2013-09-25 16:52:41 -04:00
Tim Abbott 939c5c0e00 Remove unused ERROR_LOG_DIR variable.
(imported from commit 03d054af4e74297c82e947e315f2dee954d03151)
2013-09-25 16:52:41 -04:00
Tim Abbott d7a3570c7e Move server logs to /var/log/zulip.
(imported from commit a65c4908c4a52c4abb57f299ad949c2a23dab715)
2013-09-25 16:52:41 -04:00
Tim Abbott e4496521e9 Update logging path for email-mirror.
(imported from commit 75f36dbb963b2b77ecda7ba138023f0f774047e0)
2013-09-25 16:52:41 -04:00
Tim Abbott 0a4a53211c [manual] Rename /var/log/humbug to /var/log/zulip.
This requires a "puppet apply" to be done to create /var/log/zulip
before we deploy anything using the new directory.

(imported from commit 2d7baedbf923df9f01b152cf0bda6494f0eac936)
2013-09-25 16:52:39 -04:00
Tim Abbott 0b9e54416d [manual] puppet: Rename humbug=>zulip in nginx configuration filenames.
We need to manually remove the old humbug and humbug-staging sites-*
files when we deploy this via puppet.

(imported from commit d25e0172a14032c5acf1501668602d34b1b13b85)
2013-09-25 15:40:21 -04:00
Tim Abbott 32a333be42 puppet: Rename humbug=>zulip in nginx configuration.
(imported from commit c5880c7fe9f7d709d39e788cc2b6be940c279972)
2013-09-25 15:40:21 -04:00
Tim Abbott 4505df407b puppet: Access apt repositories via apt.zulip.com hostname.
(imported from commit 2d4ecd7479ac9565d52bd85c324003e03495ebef)
2013-09-25 15:40:21 -04:00