Brion Vibber [Mon, 6 Dec 2010 22:49:24 +0000 (14:49 -0800)]
Ticket #2921: cleanup on LinkPreview to make fewer requests while typing. Will now wait for each link's preview request to complete (successfully or unsuccessfully) before re-running it)
Evan Prodromou [Mon, 6 Dec 2010 22:05:32 +0000 (17:05 -0500)]
Make code-dependent cache entries more volatile
If a cache entry is dependent on the code that's running, upgrading
(or enabling/disabling plugins) can generate hard-to-track
inconsistencies.
This change adds a close-to-unique fingerprint of the running code to
some cache keys, so that if the fingerprint changes, the old values
are ignored and new values are used.
If the automated uniqueness fails, an administrator can add an extra
config value, $config['site']['build'], that's thrown into the key also.
Evan Prodromou [Mon, 6 Dec 2010 22:05:32 +0000 (17:05 -0500)]
Make code-dependent cache entries more volatile
If a cache entry is dependent on the code that's running, upgrading
(or enabling/disabling plugins) can generate hard-to-track
inconsistencies.
This change adds a close-to-unique fingerprint of the running code to
some cache keys, so that if the fingerprint changes, the old values
are ignored and new values are used.
If the automated uniqueness fails, an administrator can add an extra
config value, $config['site']['build'], that's thrown into the key also.
Brion Vibber [Mon, 6 Dec 2010 20:39:09 +0000 (12:39 -0800)]
Added User::singleUserNickname() as (temporary?) fallback for single-user lookup as a workaround for site setup of 1user sites. We found that an external tool attempting to spin up StatusNet and then register the user would fail because StatusNet's router setup dies on being unable to find its single-user account, since the nickname is needed in setting up routing entries. This tweak will let it survive, using the configured setting as a fallback if it can't actually find the user account.
Evan Prodromou [Sun, 5 Dec 2010 21:20:00 +0000 (16:20 -0500)]
Change documentation for notice-to-activity events
Because I changed Notice::asAtomEntry() to use Notice::asActivity(),
all the events that happened in that function have been removed. I
removed the documentation for those events, and added documentation
for the new events.
Evan Prodromou [Sun, 5 Dec 2010 21:15:05 +0000 (16:15 -0500)]
Convert Notice::asAtomEntry() to use Notice::asActivity() and Activity::asString()
We had two ways to generate an activity entry from a notice; one through
Notice::asAtomEntry() and one through Notice::asActivity() and
Activity::asString(). The code paths had already diverged somewhat. I
took the conditions that were in Notice::asAtomEntry() and made sure
they were replicated in the other two functions. Then, I rewrote
Notice::asAtomEntry() to use the other two functions instead.
This change passes the ActivityGenerationTests unit tests, but there
may be some other stuff that's not getting covered.
Brion Vibber [Thu, 2 Dec 2010 18:56:44 +0000 (10:56 -0800)]
Fix for tickets #2917, #2262: user URL shortening options not being applied in non-web channels
common_shorten_links() can only access the web session's logged-in user, so never properly took user options into effect for posting via XMPP, API, mail, etc.
Adds an optional $user parameter on common_shorten_links(), and a $user->shortenLinks() as a clearer interface for that.
Tweaked some lower-level functions so $user gets passed down -- making the $notice_id param previously there for saving URLs at notice save time generalized a little.
Note also ticket #2919: there's a lot of duplicate code calling the shortening, checking the length, and reporting near-identical error messages. These should be consolidated to aid in code and translation maintenance.
Brion Vibber [Wed, 1 Dec 2010 22:23:56 +0000 (14:23 -0800)]
Ticket #2912 further cleanup: use JS on emailsettings form to help connect the 'I want to post by email' checkbox with the controls for adding or removing a post-by-email alias.
Now, when you first come up the checkbox will most likely be off and the button to create an address is grayed out.
Checking the box enables use of the 'new' button to generate an email address -- it's left disabled until you check the box, so you can't accidentally trip it.
Actually adding the address now enables the post-by-mail option, as well, thus ensuring that it's saved. WARNING: OTHER CHANGES ON THE FORM WILL STILL BE LOST.
Removing the address now disables the post-by-mail option, so it's not sitting around confusingly enabled but useless.
You can still disable the checkbox manually without removing the address, in case you want to keep it for later.
It's also still possible to actually save it in the state where the option is enabled, but there's no configured address, but that shouldn't happen too often. Possibly that should be prevented outright though.
Brion Vibber [Wed, 1 Dec 2010 21:04:18 +0000 (13:04 -0800)]
Ticket #2912: move 'I want to post notices by email" checkbox up from the email *output* prefs up into the box for the address to post to, so they're next to each other.
Brion Vibber [Wed, 1 Dec 2010 20:21:00 +0000 (12:21 -0800)]
Fix for ticket #2911: Hitting enter on the "associate with current account" in OpenID flow failed due to forms being mixed together
Separating the two forms (one to create a local account, the other to attach the OpenID to an existing account) gets them working -- enter activates the appropriate default button.
Brion Vibber [Wed, 1 Dec 2010 01:09:14 +0000 (01:09 +0000)]
Ticket #2913: Realtime background update marker no longer triggers false positives when clearing the marker on switching away from the tab in Firefox 4
We were clearing the counter on the window title in the blur event, which gets fired *after* we switch away, thus triggering Firefox to mark the tab as updated again.
Clearing the counter on *focus* instead avoids this, and keeps the counter out of the way as well.
Brion Vibber [Wed, 1 Dec 2010 00:35:47 +0000 (16:35 -0800)]
Went through realtimeupdate.js and added documentation comments -- does not alter the minified version. :)
Identified several bugs and fixmes, and added more thorough labeling of the issues with replicating the entire HTML structure of notices (no i18n, missing new features, maintenance problems, possible other issues)
Brion Vibber [Tue, 30 Nov 2010 20:46:33 +0000 (12:46 -0800)]
Flush router cache when saving Twitter admin settings: adding/removing keys can enable/disable some actions. This avoids having users' Twitter settings unreachable after adding your keys to an installation with TwitterBridge on but not pre-configured.
Brion Vibber [Mon, 29 Nov 2010 22:46:10 +0000 (14:46 -0800)]
Nickname class to encapsulate validation & common regexes for nickname formats.
This provides initial infrastructure for decoupling display names from internal canonical names, but continues to have us storing and using the canonical forms.
It should be/become possible to provide mixed-case and underscore-containing names in links, @-mention, !-group, etc, but we don't store those alternate forms generally.
Brion Vibber [Mon, 29 Nov 2010 19:31:33 +0000 (11:31 -0800)]
Start on some nickname-validation test cases: several of these fail right now because we had regressions in 0.8 or 0.9 where we lost normalization of uppercase and some other chars.
Brion Vibber [Wed, 24 Nov 2010 18:13:03 +0000 (10:13 -0800)]
Add LogFilter plugin: quickie way to filter out/in log output based on priority or keyword matches. Should be helpful for folks who can't easily adjust their syslog filtering.
Brion Vibber [Tue, 23 Nov 2010 17:28:47 +0000 (09:28 -0800)]
Fixes for Twitter bridge breakage on 32-bit servers. New "Snowflake" 64-bit IDs have become too big to fit in the integer portion of double-precision floats, so to reliably use these IDs we need to pull the new string form now.
Machines with 64-bit PHP installation should have had no problems (except on Windows, where integers are still 32 bits)
Brion Vibber [Mon, 22 Nov 2010 19:10:10 +0000 (11:10 -0800)]
Fixes for delete_status_network.sh:
* add some sanity checking: abort on failures instead of plodding through
* add some progress / error output
* fetch the target database server name from the status_network entry and use that to target the DROP DATABASE
Note that database names and other overrides in status_network entry may still not be seen.