Commit Graph

2098 Commits

Author SHA1 Message Date
Tim Abbott 4198dc74f1 Fix banish_broken tool.
(imported from commit 505c4a86ab106abab4c36af7c5f67c955f143c1d)
2012-11-14 16:57:21 -05:00
Waseem Daher 834c812a14 Rename "send_message" to "send_message_form" for clarity.
(imported from commit 25d9bde3390e47390724a8d4b3fd1fe95b44bd71)
2012-11-14 16:19:56 -05:00
Waseem Daher 3cf29025ec Prevent composebox form-handling code from running on all forms.
(imported from commit aee10dac671b1da83295d9e197eec4d3a0a7ceeb)
2012-11-14 16:14:48 -05:00
Tim Abbott 7ae73fabd4 Log how long requests take to process.
(imported from commit 89915f859e4493ff04a34d198ac6df5541b743cc)
2012-11-14 15:52:57 -05:00
Waseem Daher b7a9e17b67 Rename 'search' input element to 'search_query'.
If we don't do this, we get all kinds of nasty shadowing where
references to 'search.whatever' seem to be references to the
HTML input element, rather than our search.js module.

(imported from commit 4e4b562ddf895baea9619316d9fab27ae5e9fc4e)
2012-11-14 15:29:18 -05:00
Waseem Daher a1c4aa6865 Modularize search.js.
(imported from commit 72f00f832846124d833071fdd46b026c99189512)
2012-11-14 15:29:18 -05:00
Tim Abbott 50b8195bf3 api: Fix type error updating the failures count.
(imported from commit 5733f252f676549ff817df3a7560274ecec0cd2a)
2012-11-14 15:03:49 -05:00
Tim Abbott b22249d861 Helper scripts to fix some buggy users.
We have a lot of forged users that have bad fullnames due to
historical versions of our fullname computations; this function will
clean those up.

Also, we have a bunch of users with emails like foo|mit.edu@mit.edu
that were the result of a mirroring bug that we want to get rid of
from autocomplete -- putting them in a useless realm name will do.

(imported from commit 6e305093653ca9d327e9e28491636e99d16cfe1d)
2012-11-14 15:03:49 -05:00
Tim Abbott aecb8bd849 zephyr_mirror: Don't use the /mit symlink for use on systems without automounters.
(imported from commit b376e6da6c971d887f2d75194a8ed0d3adaddfea)
2012-11-14 15:03:49 -05:00
Tim Abbott c00628d149 zephyr_mirror: Don't try subscribing to an empty stream list.
(imported from commit c8155459b768dd1fc192246c1f584abb30a7bc02)
2012-11-14 15:03:49 -05:00
Tim Abbott 2e11624b2f zephyr_mirror: Don't send fullname data to server.
(imported from commit 743d0109f422fea5c4642e83448cd179f4e60827)
2012-11-14 15:03:49 -05:00
Tim Abbott 2ab8af0b91 Clean up now-unnecessary extract_sender.
(imported from commit c504838bec7ec14be8fb660015445c9bc20a2a88)
2012-11-14 15:03:49 -05:00
Tim Abbott 7227cb32f8 zephyr_mirror: Compute zephyr mirror fullnames server-side.
(imported from commit 9e6f6f9fe49d60ed30753582480e592613feb3c8)
2012-11-14 15:03:46 -05:00
Tim Abbott 0971b3d8e6 Add proper transaction handling in create_user_if_needed.
(imported from commit cab9cb4886acf61f36a0b0bc80d87ed9037cc414)
2012-11-14 14:33:31 -05:00
Tim Abbott 979560d2fe mirror: Make check for duplicate messages more exact.
This should fix the problem where only one of pairs of identical
messages sent to two different zephyr classes by bots will make it
over.

(imported from commit 37005417e2e1f737501c9524b95b044eefbfe235)
2012-11-14 14:33:31 -05:00
Keegan McAllister ce49595a00 reload: Remove dead variable
(imported from commit d3ec0d7c422990606817efcc47e7eb18c221ca25)
2012-11-14 14:18:05 -05:00
Keegan McAllister 6f2bbe5917 Set and check csrf_token for #reload
Fixes a message forgery bug (#335).

This works because Django will not generate a new CSRF token if a valid token
cookie is already present (see django/middleware/csrf.py).

(imported from commit 23222cb0bb62ae8a2f8ac7fb3f24bbc866103454)
2012-11-14 13:35:24 -05:00
Keegan McAllister 122281553a Make csrf_token global
(imported from commit 734d9c886c3a77d2ba40bd449cb089a00807a656)
2012-11-14 13:35:24 -05:00
Zev Benjamin 585210feaa Fix the "load more" button disappearing after the first time it's clicked
I think this broke during a rebase.

(imported from commit 1b8d28b72127b47fbca7d4c44bab77bec1e3d053)
2012-11-14 13:01:28 -05:00
Keegan McAllister 268492c45d gcal-bot: Get API key from ~/.humbug-api-key
(imported from commit 63d63ad0d299c300d28de61069ada8ea2c8eb839)
2012-11-14 10:38:36 -05:00
Keegan McAllister 0d5c67c792 gcal-bot: Fix sys.path for new location under api/bots/
(imported from commit 9f5b90d5e0cd2134f2f0210980ad49fd8062a9c4)
2012-11-14 10:38:36 -05:00
Jeff Arnold d473292f5c Make enter not submit the form in private message compose box
Fixes regression introduced by 97a438

(imported from commit 2da31fb7a742a317c9d6839ef7a1a5f887746dd3)
2012-11-14 10:27:52 -05:00
Zev Benjamin 0a930cd87a zephyr_mirror: forward messages in test mode if the site is not the default one
(imported from commit 7d504a6d555866f12f1657b522b4e6eb380c64a3)
2012-11-13 20:22:37 -05:00
Zev Benjamin 150a800b95 Don't reject mirrored stream messages because they don't have a recipient field
(imported from commit 1677ad91dc2e470c02a01a553d9d07789199a8d9)
2012-11-13 20:22:37 -05:00
Keegan McAllister 42a5ea9d2e Specify requests.post data as a dict
These were lists of pairs because we were going to repeat keys, but that didn't
work anyway.

(imported from commit 687b3f7b8a2821d057719c725f1f39db3992ae5c)
2012-11-13 17:33:41 -05:00
Keegan McAllister f82e8fc4d1 Move Markdown rendering out of the Tornado server
(imported from commit fc726939aa1061c40b292899dbbc9ade3b29ea01)
2012-11-13 17:33:41 -05:00
Zev Benjamin 9c99e00228 Normalize the sender email while we're at it
(imported from commit 1c245156809da77b4bef7a4396e8c0bee5724490)
2012-11-13 17:25:13 -05:00
Zev Benjamin 57bc0e0b8d Normalize recipient list on the server-side send path
This was causing Zephyr mirroring to break because
create_mirrored_message_users was returning False due to the
same_realm_email check failing.

(imported from commit e6a63160f34ec056461038650b5f8027718e6c63)
2012-11-13 17:25:13 -05:00
Jeff Arnold d78d7619a8 [third] We no longer need the tabSkips option
(imported from commit 18a292f05a6a0d473b02b1817de116e1c3d66202)
2012-11-13 16:15:43 -05:00
Jeff Arnold db34090f1f Now that we have proper escape support, tab can autocomplete
(imported from commit 28faff5416301dbc168e6ffcd0045df582961c9d)
2012-11-13 16:15:43 -05:00
Jeff Arnold 1d818db995 Make escape close just the open typeahead on Firefox, not the compose
(imported from commit 59dc10dbf9deb1b42240ae534da4ccc1ec2ef7df)
2012-11-13 16:15:43 -05:00
Zev Benjamin 796869863c review: fix for send_message API change
(imported from commit 2a171dc298449e2dacc2f8250e81577741122464)
2012-11-13 16:09:43 -05:00
Zev Benjamin bb534f7a5f Missed a usage of the old get_old_messages API
(imported from commit 15d3e4bb40f9aa64e976de636a5bef6e694e00c9)
2012-11-13 16:06:46 -05:00
Zev Benjamin 534a1fd2ec frontend-tests: Click on the buttons the user would for sending
Previously we bypassed the big buttons on the left bar and clicked on
the anchor tag inside the compose box.  This bypassed the
compose.start() call.

(imported from commit 2b627825596c8d3c21441e58db895b8e488e624b)
2012-11-13 15:40:53 -05:00
Zev Benjamin f851d9437d Turn 2-person huddles between the sender and other user into a personal on the backend
(imported from commit 959e7ea8101dc1d469d62ea2c7c7a65854679833)
2012-11-13 15:40:53 -05:00
Zev Benjamin 195bdb07c9 Unify huddles and personals into private messages on the send path
Personals are now just private messages between two people (which
sometimes manifests as a private message with one recipient).  The
new message type on the send path is 'private'.  Note that the receive
path still has 'personal' and 'huddle' message types.

(imported from commit 97a438ef5c0b3db4eb3e6db674ea38a081265dd3)
2012-11-13 15:40:53 -05:00
Zev Benjamin 0c1cccc880 Use plain $.ajax instead of jquery.form for sending messages
(imported from commit 46651224dfb0b1b3b4903b30cba5385025da173c)
2012-11-13 15:40:53 -05:00
Zev Benjamin 33c23c0113 Use a JSON array for recipients in send_message
(imported from commit e2184f92b708cc2e8ef3e9ae79ee4241c0aa12a1)
2012-11-13 15:40:53 -05:00
Zev Benjamin b948473a45 Simplify get_old_messages API
It now takes an anchor message id, a number of messages before, and a
number of messages after.  The result always contains the anchor
message.

(imported from commit 84d070dc8091161c86d4bbeafbdc299493890a2a)
2012-11-13 15:40:53 -05:00
Zev Benjamin 69598e2b0b Don't return server_generation in get_old_messages
(imported from commit de2b22fa51c645b7f1b92229bc15b1d0c4b4a8e4)
2012-11-13 15:40:53 -05:00
Keegan McAllister c0204ea5b3 get_display_recipient: Sort huddle recipients by email address
We need a deterministic order for the client test suite, and it seems like a
good idea generally.

(imported from commit cc8fc555611f2d2f1b21e63ce6860d446baa3410)
2012-11-13 15:09:15 -05:00
Keegan McAllister a954277647 get_{display,log}_recipient: Use a join query
(imported from commit 1278f46655760842e21a62ca5add891515ee1945)
2012-11-13 15:09:15 -05:00
Waseem Daher c8e87e0e6a Unbreak ctrl-click and shift-click in Firefox.
We had this problem where clicking a hyperlink bubbles up and causes a
click on the message, which causes the composebox to open.

We "fixed" this by setting cancelBubble (or, even better, calling
stopPropagation()).

Unfortunately, on Firefox, this fix breaks Ctrl-click and Shift-click,
because those are (apparently) implemented by adding an event listener
on link clicks, and stopPropagation prevents them from being called.

We instead work around this by handling this case in the click handler
of the parent element. (This allows the normal URL click AND Firefox's
bound event handlers for Ctrl and Shift to run.)

This resolves Trac #374.

(imported from commit 16fb3aa6fc582f1fba5009812e0b1178ce7c5bb7)
2012-11-13 13:44:31 -05:00
Tim Abbott 375062d14c zephyr_mirror: Extend logging on subscribe failures.
(imported from commit ce54549a74935bb95cb68dd1e6db2a3eec6166c5)
2012-11-13 12:47:59 -05:00
Tim Abbott 04d18d2461 zephyr_mirror: Tweak linewrapping algorithm.
(imported from commit 1165a7680251f6bb365f44a60612fffe0fbbae42)
2012-11-13 12:43:37 -05:00
Tim Abbott 832688d521 zephyr_mirror: Use python logging module.
(imported from commit 3cd9506d46eb56fbd5a48c789160a45846332633)
2012-11-13 12:43:14 -05:00
Keegan McAllister 324ed3f8ee .gitignore: Update for new all_messages_log filenames
(imported from commit 544b1010f3af99f8ed023c21c858d450bfcff243)
2012-11-13 10:59:02 -05:00
Keegan McAllister a91947fdde Add a command to run the frontend test suite against a testing server
(imported from commit f72604e5be3e3342cf95bde8bedc4d1733e24d79)
2012-11-13 10:59:02 -05:00
Keegan McAllister eee951440d run-dev: Use a process group to kill all spawned processes
(imported from commit 9dfddd4d9cb45c70139a167b7949bd5c4fc2791a)
2012-11-13 10:59:02 -05:00
Keegan McAllister 23bdc74863 Add a client test script
(imported from commit c31ba54ed0e15b1eab5a731471f40cfa1c87152f)
2012-11-13 10:59:02 -05:00