Commit Graph

1304 Commits

Author SHA1 Message Date
Evan Prodromou 8dea5144a9 Merge branch '0.9.x' into activityatompub 2010-12-11 11:03:02 -05:00
Evan Prodromou af4ee1d490 Merge branch '0.9.x' of gitorious.org:statusnet/mainline into 0.9.x 2010-12-11 11:01:05 -05:00
Evan Prodromou d0ea138888 cache stream of subscriptions 2010-12-11 11:00:04 -05:00
Evan Prodromou 7285bbc93b Subscription stream functions
Made two new functions, Subscription::bySubscriber() and
Subscription::bySubscribed(), to get streams of Subscription objects.

Converted Profile::getSubscribers() and Profile::getSubscriptions() to
use these functions.
2010-12-11 10:24:46 -05:00
Evan Prodromou 37c447be46 Show a single favorite for AtomPub 2010-12-10 18:50:50 -05:00
Brion Vibber ab7a06542c Workaround for locally-handled sessions breaking on PHP 5.3 with APC enabled.
Big thanks to the folks at http://pecl.php.net/bugs/bug.php?id=16745 for the secret juju!
Classes were being torn down before session save handlers got called at the end of the request, which exploded with complaints about being unable to find various classes.
Registering a shutdown function lets us explicitly close out the session before everything gets torn down.
2010-12-10 22:08:36 +00:00
Evan Prodromou 11a0bde459 AtomPub for single subscription 2010-12-09 13:11:02 -05:00
Evan Prodromou 94ff04e190 Don't cache user-specific information for Notice atom entries 2010-12-08 13:59:12 -05:00
Evan Prodromou b8b5b87c4c Don't cache user-specific information for Notice atom entries 2010-12-08 07:25:55 -05:00
Evan Prodromou 1fb506c27d use codeKey() in activity caching 2010-12-06 17:28:22 -05:00
Evan Prodromou 8564fc51c5 cache generated activity info 2010-12-06 16:38:02 -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 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
Brion Vibber 6e249b4ab5 doc comments on User::allowed_nickname 2010-11-29 11:57:27 -08:00
Brion Vibber 826a695077 Ticket #2797: replace addslashes() with explicit escape calls on the DB objects 2010-11-19 15:06:26 -08:00
Brion Vibber 407663fb40 Merge branch 'master' of gitorious.org:statusnet/mainline into 0.9.x 2010-11-19 12:44:43 -08:00
Brion Vibber 4b01dd8b2e Ticket #2441: fix deletion of avatars when a profile is deleted.
Code was doing a batch call to $avatar->delete() which fails to properly engage the file deletion code. Calling the existing profile->delete_avatars() function deletes them individually, which makes it all work nice again.
2010-11-19 12:40:18 -08:00
Brion Vibber 197b56778a Add $config['attachments']['process_links'] to allow disabling processing of mentioned URL links for attachment info (oEmbed lookups) and dereferencing of redirects that we didn't have shortened ourselves.
This option may be useful for intranet sites that don't have direct access to the internet, as they may be unable to successfully fetch those resources.
2010-11-17 13:03:59 -08:00
Brion Vibber e4eb3b3dfd Merge branch 'master' of gitorious.org:statusnet/mainline into 0.9.x 2010-11-15 17:36:48 -08:00
Brion Vibber 0d0e51292d some User -> Profile cleanup to help in adapting the profile page action to show stuff for remote users. Subscriptions, groups, roles, etc are all on profiles now so go ahead and use em. 2010-11-15 15:32:57 -08:00
Brion Vibber 5c00848b74 Merge branch '0.9.x' of gitorious.org:statusnet/mainline into 0.9.x 2010-11-15 12:38:53 -08:00
Brion Vibber 1c90d09ec8 Workaround for yfrog.com photo attachments: fudge File_redirection::lookupWhere()'s HTTP handling -- when we get a 204 on a HEAD, double-check it by re-running as a GET. yfrog.com returns a 204 incorrectly for this case. 2010-11-15 11:01:00 -08:00
Brion Vibber e1ffbfed04 doc comments on File::processNew 2010-11-15 11:00:42 -08:00
Evan Prodromou 8a21b13ee9 Merge remote branch 'gitorious/0.9.x' into 0.9.x 2010-11-15 11:57:31 -05:00
Evan Prodromou c1cee3b27f Merge branch 'atompub' into 0.9.x
Conflicts:
	actions/apistatusesshow.php
	actions/apitimelineuser.php
2010-11-15 11:57:19 -05:00
Brion Vibber 4f323efdf7 Encapsulate the oEmbed -> oohembed fallback into oEmbedHelper class. Also added a chance to whitelist sites that don't show discovery info but do have oEmbed API endpoints, and to provide alternate APIs for some common services.
Newly supported:
- TwitPic: added a local function using TwitPic's API, since the oohembed implementation for TwitPic produced invalid output which Services_oEmbed rejects. (bug filed upstream)

Tweaked...
- Flickr: works, now using whitelist to use their endpoint directly instead of going through oohembed
- Youtube: worked around a bug in Services_oEmbed which broke the direct use of API discovery info, so we don't have to use oohembed.

Not currently working...
- YFrog: whitelisting their endpoint directly as the oohembed output is broken, but this doesn't appear to work currently as I think things are confused by YFrog's servers giving a '204 No Content' response on our HEAD checks on the original link.
2010-11-12 17:41:35 -08:00
Brion Vibber 2c4313467f Save oEmbed photo references as thumbnails if there's not a separate thumbnail_url entry in the return data. This fixes thumb saving for Flickr photo references. 2010-11-12 14:03:08 -08:00
Brion Vibber dbb95b76a4 Allow YouTube-style media links to be counted as enclosures for purposes of listing attachments/thumbs 2010-11-09 12:04:07 -08:00
Brion Vibber 694448e0aa Add attachments 'thumb_width' and 'thumb_height' settings for inline thumbs, defaulting to 100x75.
This is used as the max thumb width/height for oEmbed requests (replacing the old default of 500x400 which was more suitable for the lightbox).
2010-11-08 17:36:02 -08:00
Brion Vibber 6d7f02ff31 Pass file attachment thumbnails along with oEmbed data. 2010-11-08 17:22:01 -08:00
Brion Vibber c36fecb794 Save a thumbnail image when uploading an image file into the file attachments system. Currently hardcoded to 100x75, needs aspect-sensitivity etc. 2010-11-08 17:20:04 -08:00
Brion Vibber a2994e3aa2 Testing... using photo info for temp thumbnails 2010-11-08 15:50:06 -08:00
Brion Vibber 883f7a6c0b Avoid marking files as attachments that are not locally uploaded, unless they're really oembedable. HTML-y things now excluded properly. 2010-11-08 13:27:54 -08:00
Siebrand Mazeland 6aeba0cb7c i18n/L10n updates. 2010-11-04 18:33:39 +01:00
Brion Vibber 4f63e3be7d Fix for ticket #2804: bad non-cache fallback code for dupe checks of prolific posters
The old code attempted to compare the value of the notice.created field against now() directly, which tends to explode in our current systems. now() comes up as the server/connection local timezone generally, while the created field is currently set as hardcoded UTC from the web servers. This would lead to breakage when we got a difference in seconds that's several hours off in either direction (depending on the local timezone). New code calculates a threshold by subtracting the number of seconds from the current UNIX timestamp and passing that in in correct format for a simple comparison. As a bonus, this should also be more efficient, as it should be able to follow the index on profile_id and created.
2010-11-03 17:25:29 -07:00
Brion Vibber 2692b5fc84 Fix for ticket #2853: fix for some unknown MIME type error cases by adjusting the PEAR error handling temporarily around MIME_Type_Extension usage. 2010-11-03 17:05:26 -07:00
Brion Vibber b0d7900530 Add getFancyName() to User_group to match the one on Profile: encapsulates the "fullname (nickname)" vs "nickname" logic and allows for localization of the parentheses in a common place. 2010-11-03 12:53:51 -07:00
Siebrand Mazeland a65362f7fa Add context for different uses of "%1$s (%2$s)" 2010-11-02 23:08:59 +01:00
Brion Vibber 426cda5e1f Alternate pretty-title tweaks for #2668 2010-11-02 13:42:44 -07:00
Evan Prodromou b5206fe6ca fall back to siteowner on bad nickname (Bug#2861) 2010-10-28 10:46:57 -04:00
Evan Prodromou b60b9b4fa2 Merge branch '0.9.x' into atompub 2010-10-25 11:18:56 -04:00
Evan Prodromou aef88c7cee max_id is inclusive 2010-10-25 11:18:49 -04:00
Evan Prodromou 75fcf1e081 Merge branch '0.9.x' into atompub 2010-10-25 11:09:11 -04:00
Evan Prodromou 968f9b0513 change max_id from < to <= 2010-10-25 11:08:53 -04:00
Evan Prodromou e51ed96b89 add rel=self links to atom entries 2010-10-25 09:48:01 -04:00
Evan Prodromou 698818bd7e show rel=edit links in notices for authenticated users 2010-10-24 23:05:33 -04:00
Siebrand Mazeland 0b6cc7c33d * translator documentation added.
* superfluous whitespace removed.
2010-10-23 19:20:51 +02:00