Zev Benjamin
f817bf6144
Pass the session that updated the pointer from Django to Tornado
...
This allows us to check whether the session that updated the pointer
is the same as a session that is doing a long poll to avoid sending
new pointer information when that information is coming from the same
session.
We still return from the long poll early, though, which is sub-optimal.
(imported from commit 7d4be0956f112eacefb7d198ea929957cd2b05e3)
2012-10-22 17:16:47 -04:00
Tim Abbott
d17db6687c
Improve validation of zephyr mirror data.
...
(imported from commit 9ebc43d17d1f4040da2deff271ba7e158908a29b)
2012-10-22 17:08:09 -04:00
Zev Benjamin
732ca19729
Synchronize the pointer across sessions
...
The client may now optionally send its current pointer during
get_updates and the server will return the latest pointer if it
differs and was updated more recently by a different session.
(imported from commit e43b377d7dfb52f83cefb0b1003863d5407caf80)
2012-10-22 16:44:57 -04:00
Zev Benjamin
7e4b7fb881
Add message selection option to not update the server
...
(imported from commit a5ef9506be24fee7652cd5479cb74789aa365216)
2012-10-22 16:06:38 -04:00
Zev Benjamin
bb64eb717f
Make select_message and friends take an options argument
...
The select_and_show_by_id function is now subsumed by select_message_by_id.
(imported from commit 3dbe9cf9d253b64733f269b6dc78c144100927ca)
2012-10-22 16:06:38 -04:00
Zev Benjamin
35bb3613cd
Rate limit pointer updates to avoid hammering the server
...
(imported from commit e1add1b64779f3d0caf5426eb99233e78de278ae)
2012-10-22 16:06:38 -04:00
Zev Benjamin
66d7678423
Add UserProfile callback for pointer updates
...
(imported from commit bfa9c15d82f092a1810cfcee1a88e1e292bc4cb8)
2012-10-22 16:06:38 -04:00
Zev Benjamin
2a4c3b5bff
Abstract the callbacks table in preparation for more kinds of callbacks
...
(imported from commit 695d5bceb4657ef25ba5983212082ee0c76b9d33)
2012-10-22 16:06:38 -04:00
Zev Benjamin
7ac0625e39
Add model field indicating which session most recently modified the pointer
...
(imported from commit 819ab358d9fa6f22ad8ccee56fe723ea7711ebc5)
2012-10-22 16:06:38 -04:00
Keegan McAllister
fcc21bec21
5xx: Reformat text
...
(imported from commit eaafd17560714729b23df8947a94ebd1815cec23)
2012-10-22 15:22:49 -04:00
Keegan McAllister
ba85e3babf
Add a static 5xx error page, for nginx
...
(imported from commit e0ca9ba4e88f4825954c3b70c7b1acadb5b37779)
2012-10-22 15:16:04 -04:00
Tim Abbott
b353fd4abd
Use sending_client to check whether messages are mirrored.
...
(imported from commit 6202739e21dfb308ed551656a8a0cdf7311972f7)
2012-10-22 14:52:08 -04:00
Tim Abbott
a695732bda
Seed the populate_db random number generator.
...
This makes it not to produce 10 copies of each message.
(imported from commit 35ab5f14ec104b4ea52137dac4fa2840194f3777)
2012-10-22 13:59:46 -04:00
Tim Abbott
f26a614bb3
Fix Client handling in the test suite.
...
(imported from commit 56841a00052c3aa85f2eeb45133439a46f3caf82)
2012-10-22 13:23:16 -04:00
Keegan McAllister
7cf8f842f7
Allow in stream names any character classified by Unicode as alphanumeric
...
Also correct a comment.
(imported from commit 5c03032b90dbaf38d880651004733e4399b422ee)
2012-10-22 12:58:39 -04:00
Keegan McAllister
189d42428a
bugdown: Log Markdown parser failures
...
(imported from commit 9e225a32b71edbfd9007cc2fbae32be31896233d)
2012-10-21 23:07:03 -04:00
Keegan McAllister
4a0cf8e608
bugdown: Disable builtin 'autolink' feature
...
This only linkifies inside angle brackets, per
print md.inlinePatterns['autolink'].getCompiledRegExp().pattern
We have our own linkification extension.
(imported from commit 20cab11aaafee075e0caf933d8d197717976988c)
2012-10-21 21:03:18 -04:00
Keegan McAllister
00a4da5f9b
bugdown: Disable automatic mailto links for <foo@bar>
...
This feature was throwing exceptions on input like
<@`x`>
Reported upstream as https://github.com/waylan/Python-Markdown/issues/155
(imported from commit 6b14a65599def0346f76cf017be66dd80f42db49)
2012-10-21 21:03:18 -04:00
Keegan McAllister
4db8587805
bugdown: Decrease code duplication
...
(imported from commit 40158134b60e477d8a353d050fa62c9ded0e9e9f)
2012-10-21 21:03:18 -04:00
Keegan McAllister
649cd15415
bugdown: Linkify using a Markdown extension
...
This prevents trying to linkify inside code blocks.
(imported from commit 97dd20ecee19f41650aa98e68aa8e9908ece5b33)
2012-10-21 21:03:15 -04:00
Keegan McAllister
d72aea25f2
bugdown: Use named match for Gravatar email
...
(imported from commit 778c4b6d754f975c89a91336593d2f62e49249d5)
2012-10-21 20:16:07 -04:00
Jessica McKellar
f5f3ffc6a9
Expose an API method for updating the pointer.
...
(imported from commit 66d49c149e0bbc60e82a5967b77aff69629b09e7)
2012-10-21 13:33:14 -04:00
Jessica McKellar
0fb836538d
Add an API request for getting profile (specifically pointer) data.
...
Mobile clients need it.
We are going to need to sit down and think about how much power we
want to give our API users, though. For example, should they even get
to know about your absolute pointer value (maybe they should only be
able to make requests relative to your pointer), or be able to request
very old ranges of messages?
(imported from commit 1680655f0d9a670bc0da0ddb92fbbd5cf851d3dd)
2012-10-20 21:59:59 -04:00
Tim Abbott
7530163fb8
Fix stream Verona's Recipient being created twice.
...
(imported from commit 710572ff8681530c52f861d9e5607eaf8390c657)
2012-10-20 20:06:43 -04:00
Tim Abbott
d3a693080e
Fix receiving messages on the ShakeSpeare streams.
...
(imported from commit 4ce60d57e66363da1bd3c2b93fcf008eee795769)
2012-10-20 19:54:29 -04:00
Tim Abbott
6a7cbaf4b1
Add some more defensive lower-casing when creating streams.
...
(imported from commit 25a62b0105ce7b6b871b7570d087970fed7c6d9b)
2012-10-20 19:52:01 -04:00
Tim Abbott
dab25bdff7
populate_db: Be a little more defensive about message types.
...
(imported from commit fe23365180847065a9a3292f7873dcb36bb277db)
2012-10-20 19:48:05 -04:00
Tim Abbott
55d9c08c83
populate_db: Fix case bugs importing old messages.
...
(imported from commit dba8e3419f5827344a42f28c31798fdaff7cf002)
2012-10-20 19:43:06 -04:00
Keegan McAllister
03dcd8ab2e
Restore default formatting for <code> inside <pre>
...
(imported from commit c9c23b8b7709e9edc6cf1bf2f88811bdf511d2ac)
2012-10-20 19:26:53 -04:00
Tim Abbott
dcfef6b1a9
Fix restored personals going to the wrong user.
...
(imported from commit 362c9f3d833c96a5f3530138a0e9360bff183cbf)
2012-10-20 19:20:48 -04:00
Tim Abbott
edf9a8e7e5
Fix incorrect setting of initial API keys in bulk import.
...
(imported from commit ec492c787a5575f1f7b2fe68986999bbdd072a04)
2012-10-20 18:48:12 -04:00
Tim Abbott
7b3b4362dd
[schema] Add a Client model keeping track of the sending client.
...
(imported from commit 31a430b1de14ce973addafd5d13ace049a8f8091)
2012-10-20 18:41:54 -04:00
Tim Abbott
2c89103b23
Actually update current subscriptions based on changes in logs.
...
(imported from commit b36637562dd0e358f1718d38778c735bb75fd77a)
2012-10-20 18:41:51 -04:00
Tim Abbott
1fcb4c0576
Fix error handling for removing subscriptions.
...
(imported from commit b95a706ed9499e96c4ff27ca583ed10dab674736)
2012-10-20 18:26:21 -04:00
Tim Abbott
a8e4c818c6
Make logging of new subscriptions conditional on changes.
...
(imported from commit fff72906a52838bba144a960c0bc6a3487bef41b)
2012-10-20 18:26:21 -04:00
Tim Abbott
56dab6cb26
Log changes to subscriptions and replay them in populate_db.
...
(imported from commit d3055eb44326bdc59a6bc96d00b5b0bc6da86059)
2012-10-20 18:26:21 -04:00
Tim Abbott
d68cf3696b
populate_db replay: Use bulk_create to create objects.
...
This cuts the time required to import 38000 messages (with 140000
message receipts) from about 10 minutes to just under 40 seconds on my
laptop with sqlite.
(imported from commit d53b0d1360408c77f38353b58fbb25875262cb40)
2012-10-20 18:26:18 -04:00
Tim Abbott
b2ce9aaa18
populate_db replay: Parse the json from old messages first.
...
(imported from commit bdd900b7618ce85d27eebe4d2a745c4d2734cb85)
2012-10-20 10:44:50 -04:00
Tim Abbott
bf007776ce
Fix selecting huddles using the mouse type-tabs.
...
(imported from commit 6b9981cf6d5a5aaf9d644a18cc04397f3cf0dead)
2012-10-20 10:35:39 -04:00
Tim Abbott
a8ee0ecc69
Fix bug allowing subscribing to a stream twice.
...
(imported from commit c49b7c8ec49fd71bb1e1f1226d9e126d4d0987df)
2012-10-20 10:15:12 -04:00
Keegan McAllister
61a33f4c4d
bugdown: Disable line numbering of code blocks
...
Pygments renders these using tables, which breaks our client's assumptions
about what <tr>s mean.
(imported from commit 46d37395785e06fb183d17b08afed4c6f5957baa)
2012-10-19 23:54:10 -04:00
Keegan McAllister
dc8bc9e1af
codehilite: Allow the caller to disable line numbering
...
(imported from commit 4257cc1b8b1e2a78cb36d4fdf105a5864c1b20fa)
2012-10-19 23:54:10 -04:00
Keegan McAllister
0edbc80616
Use our local copy of codehilite
...
(imported from commit bc9704a19017061d55ff0e16589d57ee0c46caa5)
2012-10-19 23:50:32 -04:00
Keegan McAllister
5e1654b9b5
Import GitHub version of Markdown codehilite extension
...
(imported from commit 166f85fabf8a80858240c2610437002e49f98278)
2012-10-19 23:30:47 -04:00
Keegan McAllister
086e1b1c33
Make bugdown able to contain sub-modules
...
(imported from commit 6fa5a6cd8f972e3afb21b65bdfca927e824194aa)
2012-10-19 23:30:14 -04:00
Keegan McAllister
0d05557ffc
notify_new_message: Allow request to have come from IPv6 localhost
...
(imported from commit ef477ced6695f866f8d265d980f8401670b3c95c)
2012-10-19 22:34:46 -04:00
Keegan McAllister
86b4da9d83
Put a new user's pointer at the bottom
...
(imported from commit 65ae2483d6bcfb96cc97bdb689d8174737bde5b0)
2012-10-19 20:44:09 -04:00
Zev Benjamin
33c40bd9ba
Don't reload the app after sending messages
...
(imported from commit 0985a3e7d13b1be00ae0b190914aeb3647ba196a)
2012-10-19 18:25:57 -04:00
Tim Abbott
e434fa141e
Use .objects.create and .objects.get_or_create.
...
This eliminates a bunch of unnecessary code and also fixes a bunch of
places where we were improperly not using transactions.
(imported from commit f194ae9226f9229fc56a0b1b21615534f486ea0c)
2012-10-19 17:42:14 -04:00
Keegan McAllister
5b13f9192f
Load more messages when the user presses the "Load more messages" button
...
(imported from commit 060e6f67b13fd67b56f80f913eb6b835860a8115)
2012-10-19 17:13:14 -04:00
Keegan McAllister
7693695fc0
Tell the client why we are returning an empty list of messages
...
(imported from commit cc17ed2d8389f6be1170081e70c1d8a7f0556ac3)
2012-10-19 17:13:13 -04:00
Keegan McAllister
3dfed7b6a1
Add a "Load more messages" button
...
...which currently does nothing.
(imported from commit 185b35c2bf651779bfcdba44524d1bcb8af74f27)
2012-10-19 17:13:13 -04:00
Keegan McAllister
fa011c108c
Factor out restart_get_updates
...
(imported from commit 03755dccbbe296e8c5208c460d80645c0fa17e14)
2012-10-19 17:13:12 -04:00
Keegan McAllister
c67e7035aa
Limit the number of old messages the client requests
...
(imported from commit 6bff6aa0b48d46b98aa68c6e29eb569cf41f4989)
2012-10-19 17:13:08 -04:00
Zev Benjamin
a80e08fbf3
Fix typo
...
It was preventing the right text area being focused on huddles
(imported from commit 8ebe457b4e5bce723e3afd9f396f97eeb0e97c46)
2012-10-19 17:04:28 -04:00
Zev Benjamin
9c2da407e6
Update the current composition type on toggle
...
This was preventing huddles from sending because clients thought they
were still sending a stream message.
(imported from commit 694b06cbc43adc9563327ebffccb7fa37aa36bac)
2012-10-19 17:00:27 -04:00
Zev Benjamin
337836ef54
Fix initial focus on new messages
...
(imported from commit 4553f6209362f684110b34e92fdba2046cfbb08e)
2012-10-19 16:17:29 -04:00
Zev Benjamin
9de73b5a91
Be intelligent about which input box is highlighted in compose.start()
...
(imported from commit 37268601d569fdb510415ebfae594804817c0e3a)
2012-10-19 16:09:13 -04:00
Zev Benjamin
2a98045406
Fix responding to messages (broken by rebase error)
...
(imported from commit 1fac8d8757ee7f9b79c35e884edaa37e5cca0120)
2012-10-19 15:59:03 -04:00
Zev Benjamin
88e09c6166
Only reload the page when the user is idle
...
Also, clean up reload-related function names a bit
(imported from commit 4c2e17c06d7567e71b92f6e1b04a44aeff419bff)
2012-10-19 15:53:05 -04:00
Zev Benjamin
ae08f512dd
Enhance the jquery.idle plugin with functionality we need
...
The following things were changed
* The list of events it listens to by default was expanded
* It now supports canceling timers
* Calling .idle() on an element now returns a control object that can be used
to manipulate the timer
* Small tweaks to variable names, arguments, jQuery usage, etc.
The code probably still needs some cleanup, but I'm sick of looking at it
right now.
(imported from commit 6868cb6fd97ab994a871f5ed6951995b254e340e)
2012-10-19 15:53:05 -04:00
Zev Benjamin
9752ec8963
Add a jquery module for tracking idle time
...
(imported from commit 553a7600ab817330ea862dee9887ba08595e0c4d)
2012-10-19 15:53:05 -04:00
Zev Benjamin
1b47cd58f1
Rename compose.message -> compose.message_content to avoid confusion with new API
...
(imported from commit cce8baba49a4176bdb900a83006db3bf23bcd82b)
2012-10-19 15:53:05 -04:00
Zev Benjamin
08b4bd0d9c
Determine whether the user is composing based on a flag instead of element visibility
...
The flag is set to the kind of message being composed in
start_composing() and set to false in finish_composing().
This avoids the problem where composing_message() will return true
when the animation is still running.
(imported from commit 4c2e7e1fad2e6b2123825bd51d5b24ae41bccd45)
2012-10-19 15:53:05 -04:00
Zev Benjamin
621909df6b
Add custom jQuery events to the compose abstraction
...
(imported from commit 3ff10baafd0825ed8b7ed50a8b668080d1e9f303)
2012-10-19 15:53:05 -04:00
Zev Benjamin
7a44a3b05a
Use the new compose API
...
(imported from commit fb91febbd5c257aea15292d8071da69a3e6b9a99)
2012-10-19 15:53:05 -04:00
Zev Benjamin
746897b36a
Add a compose API for starting, canceling, and finishing messages
...
(imported from commit 372e1c2ae19a72bcbb989fa2be5c510a1278fc69)
2012-10-19 15:53:05 -04:00
Zev Benjamin
ab382040c1
Make get_updates reload_pending request parameter an integer
...
This fixes a bug where the server wasn't returning from get_updates
immediately when the client needed a reload.
(imported from commit 1d854eb1c7061f468d091e103f10074f4c7231d8)
2012-10-19 15:53:05 -04:00
Keegan McAllister
bbb67f61cc
populate_db: Indicate progress on --replay-old-messages
...
(imported from commit 1f1043bca0952650c744d6012b11d607f2eb3cde)
2012-10-19 15:17:34 -04:00
Keegan McAllister
ec0bbdc1df
Hide horizontal scrollbar on .message_list
...
(imported from commit 09600ce19074546285173f8ab8317322d4d0e417)
2012-10-19 15:17:33 -04:00
Waseem Daher
17d44be14a
Display huddles as 'You and...'.
...
(imported from commit 35fe0e56751b1a2993bd99181e8bbd57e8c3ce81)
2012-10-19 15:11:13 -04:00
Waseem Daher
647f3c1220
Hack to make narrowbar line up a liiiiitle bit with real bar.
...
(imported from commit 83f0066def43b2a35e2d8aa089f5962617cf5546)
2012-10-19 15:07:08 -04:00
Waseem Daher
7fdac68787
Tone down some of those icons.
...
(imported from commit efd22df34b87ccb0603b73fed85b10f08bbd47b0)
2012-10-19 14:53:31 -04:00
Waseem Daher
92045f2c9e
Experiment: Use icons in more places (instead of the word Huddle).
...
(imported from commit 6e27da4e54634c1f2fe05e2bffac24dc00576d2c)
2012-10-19 14:42:43 -04:00
Keegan McAllister
4c269c4f7f
Don't line-break <code> tags
...
(imported from commit 35be9fe8c70d3e233708bb7ffdb5ce91eca75c77)
2012-10-19 13:37:42 -04:00
Keegan McAllister
299a298bfb
Fix variable name typo in narrow.by_recipient
...
(imported from commit 87954f2d9007ebdd9d6da8a71584d2677c19ad4d)
2012-10-19 13:02:25 -04:00
Keegan McAllister
5d0fdd1958
Clean up narrow.by_recipient
...
(imported from commit ca6665f29847077d6038d3f48821c4be02e95ff1)
2012-10-19 13:02:25 -04:00
Keegan McAllister
390c9a26c1
Explain why target_id exists
...
(imported from commit af2235d80ada47e95806a8a2f807261da583e39e)
2012-10-19 12:57:34 -04:00
Keegan McAllister
e6d42f60f1
Use narrow.by_recipient in message template
...
(imported from commit 147eb8b652d7b4dee3ad6415b6c8e23e04067d15)
2012-10-19 12:57:34 -04:00
Keegan McAllister
3c00b828b0
Use target_id in narrow.by_recipient
...
Following 958ce29.
(imported from commit e52e9628f85d83ef02bef393f6b10697a7d4eec4)
2012-10-19 12:57:34 -04:00
Keegan McAllister
2439d69209
Get rid of helpers by_personal, by_huddle, by_stream
...
These make assumptions about the current message type. We should just use
by_recipient externally.
This reverts commit ad2123f99ce91361ab907c308bfecec4efd722a4.
(imported from commit b7945896568c4c5c31a9d5bddb0e9ade8eef859b)
2012-10-19 12:57:34 -04:00
Tim Abbott
79fbb23356
Return a max_message_id when returning no messages.
...
This is needed for an API client to setup a nonblocking subscription.
(imported from commit d978c28994c5e3af4312ffba32c4040e8314c247)
2012-10-19 11:37:20 -04:00
Waseem Daher
9dbcea2a16
Unbreak narrowing.
...
(imported from commit ad2123f99ce91361ab907c308bfecec4efd722a4)
2012-10-19 10:38:54 -04:00
Waseem Daher
ba1a2a2732
Restore 'narrow to stream' functionality when you click on the stream name.
...
(imported from commit efb82e44205e41979062ec6a1b1a989ea52d2c97)
2012-10-19 10:24:24 -04:00
Waseem Daher
34fc2266ce
Pop up a little box of info/actions when you click a name or gravatar.
...
Known issues:
* Not all of the options in the menu are functional yet
* The wording isn't totally perfect on some of these options;
I kind of want to use a 'first name' in some of them.
(imported from commit 5a333fb939fcca7e0d0ecb2c43e79501139ac0db)
2012-10-18 21:19:49 -04:00
Keegan McAllister
2fe034d161
Rename subs.add -> subs.add_for_send
...
This has some logic specific to the "Create and send" / "Subscribe and send"
buttons.
(imported from commit 5f9e314ebde31ec1e6a183513816d1ade361e4cc)
2012-10-18 16:25:58 -04:00
Keegan McAllister
95f8eea14b
Module pattern for subs.js
...
(imported from commit adfe466ea892fbfe5f13a5f346e4fd00f194c42a)
2012-10-18 15:46:58 -04:00
Keegan McAllister
2a2c0187c5
Rename subscribe.js -> subs.js
...
(imported from commit c3ce92e31916548206ad5752da8911f22d23f106)
2012-10-18 15:42:08 -04:00
Keegan McAllister
eb9140a0a2
Pseudo-module pattern for rows.js
...
It's actually simpler than a full module, due to lack of local state or functions.
(imported from commit b9180f1cdc26aed3f2e1f35dfae9ed4240b64446)
2012-10-18 15:11:25 -04:00
Keegan McAllister
01061e95e0
Rename dom_access -> rows
...
(imported from commit 66f6f88cf15f5be614440b826433d5c1cfd6803e)
2012-10-18 15:11:25 -04:00
Keegan McAllister
e7661f7b2f
Module pattern for compose.js
...
(imported from commit 8ea9d949b793285e8722bebcef30991d06e5673e)
2012-10-18 15:11:25 -04:00
Keegan McAllister
c4bf81a312
Module pattern for narrow.js
...
(imported from commit f1df2e884216560cfe80f29a7e3eda5cea17cefe)
2012-10-18 14:41:24 -04:00
Keegan McAllister
1398641aa3
Module pattern for hotkey.js
...
(imported from commit 56616bc8eeaa594ca70bb92bf17a88f97027fd35)
2012-10-18 14:35:42 -04:00
Tim Abbott
461da3f742
Only check if a stream exists if we're not subscribed to it.
...
This should make sending twice as fast.
(imported from commit a30c6fe7f20aae65d0bfe65e76774017b2627c04)
2012-10-18 13:43:54 -04:00
Tim Abbott
247cfc5344
Fix create-and-send functionality.
...
(imported from commit 24452eb90e9aaeb0ad406f6c56ce412e2f410865)
2012-10-18 13:43:50 -04:00
Tim Abbott
d49d675128
Fix mit_sync_bots for personals only.
...
(imported from commit 9fd7ac87d2cdc32413edefbde8870bbe59b67380)
2012-10-18 11:14:03 -04:00
Tim Abbott
e303b7dcbd
Fix syncing messages from Humbug back to MIT.
...
(imported from commit ff32c8c0824afda0805bd5ec9ec87b7ce999bcca)
2012-10-18 10:57:18 -04:00
Tim Abbott
1d55c06ede
Move mit_sync_table code into the correct process.
...
(imported from commit bc40f865f94d7b39db5e49eba09370c3fa53dc6f)
2012-10-17 22:35:02 -04:00
Keegan McAllister
b9e9938197
create_user_if_needed: Use proper initial passwords
...
(imported from commit 009208ac64548dd6f8773ccc7738ab0c391d816a)
2012-10-17 21:08:59 -04:00
Keegan McAllister
4f56362e0f
Change formatting of notify_new_message request
...
The requests library doesn't encode repeated key form data reliably.
(imported from commit 3cc9f5379c299a57f69bb5b7ff3b85f0c066269f)
2012-10-17 18:24:15 -04:00