Commit Graph

9111 Commits

Author SHA1 Message Date
Steve Howell d2f773a99d Handle empty Message table in act_on_message_ranges.
(imported from commit 609b0f531c4af23ddb6f3e5760dc9d251f1a4d3d)
2014-03-14 20:48:44 -04:00
Zev Benjamin d445386adc nagios: Add Postgres check for disabled triggers
(imported from commit 08ff85aecfc44c9226e637383464fae4d2b8997a)
2014-03-14 20:48:44 -04:00
Zev Benjamin 1653541e83 nagios: Re-enable Postgres transaction time checks
We believe these will generally no longer be disruptive now that we have
autocommit enabled.

(imported from commit c8c1301e0d4b188d6708173cd8c8b16279e3d910)
2014-03-14 20:48:44 -04:00
Steve Howell fa37ac1d73 Add act_on_message_ranges() migration helper.
(imported from commit 9e6567c1a12a7d8e447ed80ee08723376eaee6fe)
2014-03-12 21:15:23 -04:00
Steve Howell 9a5289b96c Change compose box only for going-forward topic changes.
(imported from commit 69de10fd9866acab2d12f15489c67eb9daab8d3d)
2014-03-12 21:15:22 -04:00
Steve Howell b8de1dd13f Change narrows automatically on topic changes.
(imported from commit 7a8e606cc6fe0f2e4b5a164e1396e302ad969102)
2014-03-12 21:15:22 -04:00
Steve Howell 45002aa03f Close message edit before doing topic-related changes.
Closing the edit box earlier will make future changes less brittle,
when we, for example, re-narrow based on topic edits.

(imported from commit 36219c5129153beebfefe443932825fdf74abc43)
2014-03-12 21:15:22 -04:00
Steve Howell d4fa917c49 Add has_topic() helper to filter.js
(imported from commit 8d8d9c2b6638968b18c7603e070c001d6b16cf21)
2014-03-12 21:15:22 -04:00
Steve Howell 0376d26c79 Add filter_with_new_topic() method.
(imported from commit 2ed9261ec70edf0a4ee1a25989cabfa9ab7907fd)
2014-03-12 21:15:22 -04:00
Steve Howell 65e9d0bead Change compose box for topic changes only if streams match.
(imported from commit 0bd6cd53ea4a8db5a457bb7dd5917f25c7c9434a)
2014-03-12 21:15:21 -04:00
Steve Howell 63097f32e5 Let arrow keys do the right thing for select widgets.
This helps the edit form in particular, when you change a
topic and need to select the propagation option.

(imported from commit c9dd1e62cd9e0b2142855685f04baa06eecf7226)
2014-03-12 21:15:21 -04:00
Steve Howell da66220524 Add propagate_mode to event for topic updates.
(imported from commit c5bd140a46db5b6bc4164c21bcb698776fb0d786)
2014-03-12 21:15:21 -04:00
Steve Howell 9648fd1f9a Add stream_id to event for topic updates.
(imported from commit 2c0ff291672a2576e5812d8c3abdb71256ada61f)
2014-03-12 21:15:21 -04:00
Steve Howell 7a509af38b Add testing for update_message events.
(imported from commit 014cc8f3ed4c56108105e69f17d4894a0bf56c37)
2014-03-12 21:15:20 -04:00
Steve Howell ff44fb6fcf For topic changes, set the compose subject outside the loop.
If we get a topic change, we can change the subject outside the
loop, since we are passed in event.orig_subject.  Doing it inside
the loop was mostly harmless, since after you encountered the first
message with the old topic, the condition to change the subject
evaluated to false, but it was still technically O(N), and it was
kind of confusing.

This commit changes behavior in the edge case that you have the
compose box open for a changing subject, but you are in a narrow
that does not have any of the affected messages.  After this commit,
the topic in the compose box will still change, which I believe
is the correct behavior.

(imported from commit 2363e432ebe7ae8e07379324ee0bfb52051428e6)
2014-03-12 21:15:20 -04:00
Steve Howell dfc34eb074 Allow negated has:* searches.
Before this change, we were incorrectly trying to do local
filtering on negated has searches.

(imported from commit d1a6f1feef6b3cc1c984eb91a73cd16c4e66874e)
2014-03-12 21:15:20 -04:00
Allen Rabinovich d6617a991c Remove mobile device indicator from template
(imported from commit 48a10a75b30c3f51a6dfa5af43ca138e391289d4)
2014-03-12 21:15:19 -04:00
Tim Abbott 12309c61b6 Remove Nagios monitoring for the old email mirror.
(imported from commit fc4d95b12d5ee29438a2d3e7d8d694e8aa21f202)
2014-03-12 21:15:19 -04:00
Steve Howell 24c23c2290 Remove unused json_to_bool().
(imported from commit 72f0db5f623ae9a06ffad2882bcad0e74ceaf884)
2014-03-12 21:15:17 -04:00
Allen Rabinovich fcca1549b0 Darken the timestamps
(imported from commit c8934a422d8d770634015210fde80eced34aba64)
2014-03-11 13:26:32 -06:00
Luke Faraone 8b3b33c182 Reword error page; link to Twitter.
We use this error page for all 5xx errors, so I'm removing the error
number from the text.

(imported from commit c0c4c8829d466dd20c76dbbc920fc57cafbd6e6c)
2014-03-11 15:16:19 -04:00
Luke Faraone f4196ed6ef Don't allow sending messages to deactivated users or realms
We still don't show this in the frontend, aside from our usual "Not
delivered" message that we also show when you send to a non-existent
user.

Addresses #2349

(imported from commit 2f348b15a4d539987ddbcccbbf40e2be87c1f92d)
2014-03-11 15:11:53 -04:00
Luke Faraone 9ea3198ddf Reject API key usage by users from deactivated realms
(imported from commit f1c791943f62bdde841ebb6975daef60e5a19174)
2014-03-11 15:11:52 -04:00
Allen Rabinovich 40164f4398 Move mobile indicator to the right and style it properly
(imported from commit 19f6bd27b30c355c1720d43580f5b6ff6c1c0b4a)
2014-03-11 13:06:23 -04:00
Luke Faraone fd7dd0bc2c Use correct presence names for iOS mobile devices
(imported from commit d75f56c26d272342e2b4d074ea90a6d7fb9cff4e)
2014-03-11 13:06:23 -04:00
Luke Faraone bd20a756f9 Show a mobile icon in the presence list when relevant
We show a user as "on mobile" if:
 * They are only active on mobile
 * They are inactive on all devices and can receive push notifications

(imported from commit 0510b9371727cd19c72f6990df7112921c36ad48)
2014-03-11 13:06:23 -04:00
Waseem Daher 4397c25976 Wrap 'Receive audible notifications'.
This resolves Trac #2366.

(imported from commit 0de4b20e0310980181716f7a29a82a4228a16b1b)
2014-03-11 13:06:23 -04:00
Zev Benjamin bdee9721ec tests: Delay loading old messages and starting get_updates until phantomjs thinks the page has loaded
This doesn't affect code when not in testing.  It shaves 7 seconds off of casper
test time on my machine.

(imported from commit 7e27fa781bcf16f36d9c8f058427ba57c41068bd)
2014-03-11 13:06:22 -04:00
Zev Benjamin f45f0b1df6 Get message row safely in the presence of local ids
(imported from commit 4f8c4742206a9fcba4eb19653152aeb4919159bd)
2014-03-11 13:06:22 -04:00
Zev Benjamin dfa45a3689 tests: Wait until we've actually logged in to try to log out
(imported from commit f1a29520fdb868a91cf5145be49542c8db9b4316)
2014-03-11 13:06:22 -04:00
Zev Benjamin d6f01ed7b9 tests: Clear phantomjs local storage before starting tests
(imported from commit 83ee6f1c95a6f1e4005b36af6be2d60f70c81a1d)
2014-03-11 13:06:22 -04:00
Zev Benjamin 917a4363e7 tests: Only initialize casper once
(imported from commit 849b8cfc0545fb0ff51dbfc32d2bc6081c0a5215)
2014-03-11 13:06:22 -04:00
Zev Benjamin 0fbfbf488b tests: Remove dead test
(imported from commit a85a0877c21b0eba5cdf708fc8d264b11f7a3fd9)
2014-03-11 13:06:22 -04:00
Zev Benjamin e9acdd147f tests: Don't try to edit locally echoed messages
(imported from commit 04760e67b1c18766dc23072b4a735d8cb28a658b)
2014-03-11 13:06:21 -04:00
Zev Benjamin 2f01e9c51d tests: Use then_send_many
(imported from commit 228ee697a54643912eb3846d48c78e4464193632)
2014-03-11 13:06:21 -04:00
Zev Benjamin 719d551de6 tests: Always wait before sending messages
(imported from commit 1860f994b5698ba39ec9b45564c283f932d7502e)
2014-03-11 13:06:21 -04:00
Zev Benjamin d3f14ae860 message_flags.js: Add comment
(imported from commit 6660076a04f765f67ade35664bd09678691d37c3)
2014-03-11 13:06:21 -04:00
Zev Benjamin 9d04b3d643 Don't tightly recurse when updating flags for local messages
(imported from commit a4a9f5278c9445fae753311ea16f165be15ff8eb)
2014-03-11 13:06:21 -04:00
Zev Benjamin 5fd58cf249 casperjs: Immediately check the condition in waitFor and don't wait after the condition is true
Normally, casper delays checking the waitFor condition for 100 milliseconds and
further does not act on that check for another 100 milliseconds.  This is just
silly.

(imported from commit ad046ceda81abda5c609ce25ef0d4fb27d3da716)
2014-03-11 13:06:21 -04:00
Zev Benjamin 39f632134d tests: Rename casper helpers for clarity
send_message -> then_send_message
send_many -> then_send_many
wait_and_send -> then_wait_and_send

Hopefully this makes it clearer that they should not be called inside of steps.

(imported from commit 4fcc971817b25056100311ba55303da2c5527f0f)
2014-03-11 13:06:21 -04:00
Zev Benjamin 0ccb794007 tests: Don't add new steps during execution
Casper can technically handle it, but it's cleaner to create all steps ahead of
time.

(imported from commit 37cda128818d663f57b6e2282a781e8d099fa77d)
2014-03-11 13:06:20 -04:00
Zev Benjamin 80ca037747 tests: Correctly wait for a message to be visible
I'm not sure how it worked at all before.

(imported from commit 608b0574d1a80cd631d9ea8198990d97d72ba64d)
2014-03-11 13:06:20 -04:00
Zev Benjamin c7586a7135 casperjs: Correctly call the `then` callback in Casper.waitFor
Casper was calling casper.then(then) instead of calling the callback directly.
This meant that the callback was being added as a step, which worked, but was
not consistent with the rest of the casper model.

(imported from commit b3bf916f7c56dd3d4e7be3569ebdf9d3045cd085)
2014-03-11 13:06:20 -04:00
Zev Benjamin 6071a11419 tests: Defer sockjs object creation when in testing
This speeds up CasperJS tests by 25 seconds per main app page load.

When we switched the SockJS, the casper tests got inexplicably slower.  I
finially figured out what's going on.  The first SockJS XHR request (remember
that we don't get websockets in the test suite) gets considered part of the page
load and therefore the PhantomJS onLoadFinished handler doesn't get called until
the SockJS XHR finishes, which happens at the heartbeat, 25 seconds later.  To
fix this, we simply don't create the SockJS object on page load since it will be
created on demand, anyway.

(imported from commit 845a97526c5102df426cd6fc26182a734e7fcab6)
2014-03-11 13:06:20 -04:00
Zev Benjamin 1c7918495c socket: Factor out SockJS object creation
(imported from commit cedb2b3e6ade0b045e8d4982437f6499ae904222)
2014-03-11 13:06:20 -04:00
Steve Howell 72c9deb59e Handle errors better when rendering messages.
Catch any exceptions that happen in the process of triggering
the message_rendered.zulip event.  This addresses #2356.

(imported from commit ce771483cd2533d312fbd68e9c2753c80b3c8d49)
2014-03-11 13:06:19 -04:00
acrefoot 43d866dd71 fixup copy and paste logic
Our restructuring of the messages (especially grouping) seems to be the culprit for message copy and paste

(imported from commit 14632a67f55efea4f1b53cc718a4f655ac83b387)
2014-03-11 13:06:19 -04:00
Allen Rabinovich c23028ec7a Move timestamps to the right
(imported from commit 1fb3e726b32065755cf1ff28e1371bc75609450e)
2014-03-11 13:06:19 -04:00
Waseem Daher ef23a4efe4 Disable authed uploads for zulip.com.
(imported from commit 3c432e730005e4c8404245c974b53c5a49fd4c9d)
2014-03-11 13:06:19 -04:00
Luke Faraone 2d3a7e5418 Use a different status code and include seconds remaining header in ratelimits
This will make it slightly easier to consume the data from our clients.

Ref:
    RFC 6585 §4

(imported from commit 6d323dc25db78a6d84a163add950f039e03e73d3)
2014-03-11 13:06:19 -04:00