Commit Graph

11186 Commits

Author SHA1 Message Date
Brion Vibber
d55f606cf8 Tweaking nickname format regexes: added one that explicitly allows numbers, to be used in router setup. 2010-12-09 16:43:35 -08:00
Brion Vibber
f947fe5d0c Disable InProcessCache plugin for CLI scripts, which are more likely to be long-running, greatly increasing the chance of data corruption. 2010-12-09 10:24:06 -08:00
Evan Prodromou
99f3964394 Merge remote branch 'gitorious/0.9.x' into 0.9.x 2010-12-09 10:48:12 -05:00
Evan Prodromou
f5f6a742cb Additional in-process cache plugin InProcessCache
Some of our caching systems, like the disk cache or memcached, have
significant overhead (network connections or disk I/O).

This plugin adds an additional layer of in-process cache, so we don't
need to reconnect to external cache systems when we've already
received a data item from the cache. There are some concurrency issues
here, but typically they won't be important at the level of a single
web hit.
2010-12-09 10:45:36 -05:00
Brion Vibber
e25d4683c8 Merge branch 'master' into 0.9.x 2010-12-08 18:13:20 -08:00
Brion Vibber
516161213f Tweak to PiwikAnalytics plugin to help browsers to pre-load piwik.js, may shave a little off load time.
Piwik's current default recommended JS for loading creates a <script> tag via document.write(). In addition to being generally evil, this means the browser doesn't know it's going to need piwik.js until that chunk of script gets executed... which can't happen until all scripts referenced *before* it have been loaded and executed.

The only reason for that bit of script though seems to be to pick 'http' or 'https' depending on the current page's scheme. This can be done more simply by using a protocol-relative link (eg "//piwik.status.net/piwik.js"), which the browser will resolve as appropriate. Since it's now sitting in the <script> tag, the browser's lookahead code will now see it and be able to start loading it while earlier things are parsing/executing.
May be better still to move to an asynchronous load after DOM-ready, but I'm not sure if that'll screw with the analytics code (eg, not being able to start things on the DOM-ready events since they're past).
2010-12-08 17:39:04 -08:00
Brion Vibber
d8d9edfc99 Merge branch 'master' into 0.9.x 2010-12-08 15:01:25 -08:00
Brion Vibber
26bd15ec0a Mapstraction plugin: use minified sources for OpenLayers
The default full build of OpenLayers.js is 943kb as of 2.10; this gzips down to a couple hundred kb
but is still rather nasty, plus loading it off a remote host could slow things down.

Using a local copy let us cut down the size significantly by discarding unused features, and further
minification with yui-compressor shaves a bit more off. Cuts down to about 1/5 the size of the
original.

Also threw in a bundled & minified copy of the Mapstraction classes plus our usermap.js,
which covers the common case of using the default OpenLayers provider. This cuts out three
additional script loads, two of which weren't getting launched until after the mxn.js main
file got loaded.
2010-12-08 14:54:02 -08:00
Brion Vibber
fb315c6f61 Create a bundled & minified JS file for Mapstraction's common case (using OpenLayers); this'll avoid waiting on additional script loads for mxn.core.js and mxn.openlayers.core.js, and removes the need to load usermap.js separately as well. 2010-12-08 14:52:26 -08:00
Brion Vibber
34569017ce Add stripped and minified local copy of OpenLayers 2.10, about 1/5 the size of the full version.
Included Makefile will recreate the OpenLayers.js using the statusnet.cfg strip configuration file
and yui-compressor to do some extra minification at the end. Requires fetching the OpenLayers
source download and dropping it in:

http://openlayers.org/download/OpenLayers-2.10.tar.gz
2010-12-08 14:28:55 -08:00
Evan Prodromou
94ff04e190 Don't cache user-specific information for Notice atom entries 2010-12-08 13:59:12 -05:00
Evan Prodromou
db519d3ffb whitespace problems in lib/router 2010-12-07 16:23:12 -05:00
Evan Prodromou
57859a4bc8 generate links for apinamespace.org/atom and /twitter in userxrd 2010-12-07 15:53:34 -05:00
Evan Prodromou
eab8d752e8 allow <Property> elements in <Link> in XRD 2010-12-07 15:53:08 -05:00
Evan Prodromou
d5466ac87e fix whitespace in lib/xrdaction.php 2010-12-07 15:26:43 -05:00
Brion Vibber
001512df96 Merge branch 'master' of gitorious.org:statusnet/mainline 2010-12-07 12:13:50 -08:00
Brion Vibber
db4d69f099 Quick hack to discard twitter broadcast queue items on failure *IF* config option 'twitter' 'ignore_errors' is on:
$config['twitter']['ignore_errors'] = true;

A longer-term solution is to patch up the indirect retry handling to count retries better, or delay for later retry sensibly.
2010-12-07 12:11:37 -08:00
Brion Vibber
4b4b763255 For good measure, don't return autocomplete results when not logged in. 2010-12-06 17:20:14 -08:00
Brion Vibber
6662141328 reindent 2010-12-06 17:16:47 -08:00
Brion Vibber
febcf7258c Tweak router target URL for Autocomplete suggestions 2010-12-06 17:15:56 -08:00
Brion Vibber
ee9e95877c Update Autocomplete readme: current state seems to work fine on private sites, so removing that note. 2010-12-06 17:13:02 -08:00
Brion Vibber
4868aaf9ea Ticket #2924: include mini avatars in Autocomplete plugin drop-down list
Ticket #2923: don't show "(null)" for some profiles with no full name set
2010-12-06 16:55:16 -08:00
Brion Vibber
daae13df1c Start tweaking Autocomplete js 2010-12-06 16:20:54 -08:00
Brion Vibber
851dbf1361 fix breakage in AutocompletePlugin 2010-12-06 15:23:12 -08:00
Brion Vibber
2e27cbcadd Merge branch 'linkpreview-fix' into 0.9.x 2010-12-06 15:14:47 -08:00
Brion Vibber
c40fde900a minify LinkPreview JS code 2010-12-06 15:11:42 -08:00
Brion Vibber
bb50e773e6 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) 2010-12-06 14:49:24 -08:00
Evan Prodromou
1fb506c27d use codeKey() in activity caching 2010-12-06 17:28:22 -05:00
Evan Prodromou
25f644f4b9 Merge branch '0.9.x' into cacheactivity 2010-12-06 17:22:34 -05:00
Evan Prodromou
76946ea5a3 Merge branch 'master' into 0.9.x 2010-12-06 17:22:03 -05:00
Evan Prodromou
b35352790f Merge branch 'master' of gitorious.org:statusnet/mainline 2010-12-06 17:21:38 -05:00
Evan Prodromou
49757c79ee Config flag to disable router caching if needed 2010-12-06 17:21:01 -05:00
Evan Prodromou
a33d1d6090 use Cache::codeKey() in Router class 2010-12-06 17:20:44 -05:00
Evan Prodromou
004d58fdb8 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.
2010-12-06 17:20:26 -05:00
Evan Prodromou
bb63fd4b75 Config flag to disable router caching if needed 2010-12-06 17:19:41 -05:00
Evan Prodromou
8c4e14b59c use Cache::codeKey() in Router class 2010-12-06 17:08:52 -05:00
Evan Prodromou
b3d47ed6cc 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.
2010-12-06 17:05:32 -05:00
Evan Prodromou
8564fc51c5 cache generated activity info 2010-12-06 16:38:02 -05:00
Brion Vibber
fb1fc8a046 Use short API-style error responses for LinkPreview's oembed proxy 2010-12-06 13:37:57 -08:00
Evan Prodromou
da8b268e06 Merge branch '0.9.x' of gitorious.org:statusnet/mainline into 0.9.x 2010-12-06 15:52:03 -05:00
Evan Prodromou
0c0418bdfb correctly generate enclosure in Activity::asString() 2010-12-06 15:51:42 -05:00
Brion Vibber
2617c40e04 Merge branch 'master' of gitorious.org:statusnet/mainline into 0.9.x
Conflicts:
	classes/User.php
2010-12-06 12:44:19 -08:00
Brion Vibber
76f3dc32e0 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. 2010-12-06 12:39:09 -08:00
Evan Prodromou
1f0949f9ac remove common_debug() from Activity::asString() 2010-12-06 15:22:52 -05:00
Evan Prodromou
89f5dd4c18 updated NoticeTitle plugin to use new activity events 2010-12-05 16:31:43 -05:00
Evan Prodromou
f7cb854fcd 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.
2010-12-05 16:20:00 -05:00
Evan Prodromou
b28266b3d6 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.
2010-12-05 16:15:05 -05:00
Brion Vibber
043f0ad152 URL shortening fix for direct messages: if we're going to shorten the text, shorten the rendered text too. 2010-12-02 13:59:51 -08:00
Brion Vibber
aa96c3c1d9 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.
2010-12-02 13:41:56 -08:00
Siebrand Mazeland
c4f67f7647 * fix typo in parameter notation
* add FIXME for unused message
* remove superfluous whitespace
2010-12-02 12:42:58 +01:00