Commit Graph

9350 Commits

Author SHA1 Message Date
Brion Vibber 4168b9cec1 Log backtraces for non-ClientException exceptions caught at the top-level handler. 2010-03-22 11:33:56 -07:00
Brion Vibber 3bb639699c Confirm there's actually user and domain portions of acct string before assigning things from output of explode(); avoids notice message when invalid input passed to main/xrd 2010-03-22 11:27:39 -07:00
Brion Vibber 5697e4edb0 Replace the "give up and dump object" attachment view fallback with a client-side redirect to the target URL, which will at least be useful. 2010-03-22 10:51:01 -07:00
James Walker a20880ee1e Fixing HTTP Header LRDD parsing (sites in subdirectories need this) 2010-03-22 13:45:13 -04:00
Brion Vibber 7aee7670c7 Replace the "give up and dump object" attachment view fallback with a client-side redirect to the target URL, which will at least be useful. 2010-03-22 10:35:54 -07:00
Evan Prodromou edee1fc09e ignore unrecognized object types 2010-03-22 08:17:14 -04:00
Zach Copley a0a9acb9a2 Fix broken assertion 2010-03-21 18:47:43 -07:00
Brion Vibber fcb614d0eb Pull <atom:author> info as well as <activity:actor> when we have an old-style ActivityStreams feed. This fixes subscription setup for Cliqset feeds, which currently have a bogus activity:actor/atom:id but a good atom:author/atom:uri 2010-03-21 16:25:12 -07:00
Brion Vibber b228da628d Accept 'tag' and other non-http id URIs in Ostatus_profile::getActivityObjectProfileURI().
(If there's not a valid ID we fall back to the link, which we do still validate as http/s.)
2010-03-21 15:46:28 -07:00
Brion Vibber 5d3bce49b8 OStatus profile setup cleanup
* drop OStatusPlugin::localProfileFromUrl(), we can just look up on user.uri
* clean up a few edge cases that returned null through Ostatus_profile::ensure* code paths, now throws clear exception when we can't find a feed from the given profile url
* add some doc comments on the ensure* methods
2010-03-21 15:18:37 -07:00
Evan Prodromou 0f1f7ab79b only use Posterous author data if it matches the profile URL 2010-03-21 07:37:58 -05:00
Evan Prodromou c2afdfbbf5 use Posterous element if available for RssChannel discovery 2010-03-20 17:18:55 -05:00
Evan Prodromou 97bd7e22da correct creation of avatar links for RSS and Posterous elements 2010-03-20 17:18:24 -05:00
Evan Prodromou 11a86d046e move atom category to its own file, too 2010-03-20 16:55:36 -05:00
Evan Prodromou e497ddc81f test posterous author use 2010-03-20 16:53:47 -05:00
Evan Prodromou 323ff31fbd special-case Posterous author element for activity actor 2010-03-20 16:53:30 -05:00
Evan Prodromou 99454be38c Move activity classes to their own files
Moved the various classes used by the Activity class to their own
files. There were >10 classes in the same file, with around 1500 lines
in the file. Just too big.

This change makes autoloading work for these classes, so also removed
the hard require in lib/common.php.
2010-03-20 16:06:22 -05:00
Evan Prodromou fb2b45c68a use feedEl for discovery 2010-03-20 09:46:22 -05:00
Evan Prodromou 515acb8513 fall back to summary or title if content not available 2010-03-20 09:30:57 -05:00
Evan Prodromou 2fc0f0433e allow html content in summary and clean it out of title 2010-03-20 09:30:28 -05:00
Evan Prodromou 25cb917523 Allow PuSH posts without author information
Superfeedr (sp.?) posts entries without author information. We can
assume that this is intended to be by the original author.
Re-structured the checks for entries that come in by PuSH so they can
either have no author or an empty author, but not a different author.
2010-03-20 08:25:56 -05:00
Evan Prodromou f558508784 handle RSS as well as Atom in Ostatus push hits 2010-03-20 07:23:13 -05:00
Evan Prodromou 65c8dc313c rename $rss to $channel to prevent misunderstanding
RSS feeds have the format
<rss><channel><item/><item/><item/></channel></rss>. The element named
$rss was actually the <channel> element, so I renamed the variable so
I wouldn't hurt my head.
2010-03-20 07:19:54 -05:00
Evan Prodromou c0f6572001 Merge branch 'testing' of git@gitorious.org:statusnet/mainline into testing 2010-03-20 06:44:55 -05:00
Evan Prodromou 51283a1b34 try to make a nickname from the user profile url before using the URI 2010-03-20 06:44:38 -05:00
Brion Vibber db0cf50f65 Avoid notices for accessing undefined array indices in hcard processing 2010-03-19 15:54:54 -07:00
Brion Vibber c84c4c6839 OStatus: be a little laxer about attempts to start/stop PuSH subscriptions that were left in an inconsistent state.
Instead of aborting, we'll try to reconfirm the sub/unsub, which once confirmed will replace whatever the previous state was on the server side.
2010-03-19 15:47:43 -07:00
Brion Vibber 79ec565104 Merge branch 'master' of git@gitorious.org:statusnet/mainline into testing 2010-03-19 15:29:00 -07:00
Evan Prodromou db9e57f761 ensure from an RSS channel 2010-03-19 15:50:06 -05:00
Evan Prodromou 022c13418d make deriving a subject from an RSS channel work 2010-03-19 15:49:38 -05:00
Evan Prodromou 1292230e38 move ActivityObject constructors from Activity to ActivityObject 2010-03-19 15:41:48 -05:00
Evan Prodromou 13b1acdd08 only search elements for links 2010-03-19 15:28:25 -05:00
Evan Prodromou 5092f98c0d return empty hints if no hcard in the html 2010-03-19 15:28:06 -05:00
Evan Prodromou 1e03968d91 define a 'root' attribute for the channel or feed 2010-03-19 15:23:30 -05:00
Brion Vibber 8a221228eb Fix typo in public tag cloud query setup which caused the cutoff to get skipped. 2010-03-19 12:51:27 -07:00
Brion Vibber 5c314c2288 Drop result ID from data objects on clone(). This keeps the original object working if it was in the middle of a query loop, even if the cloned object falls out of scope and triggers its destructor.
This bug was hitting a number of places where we had the pattern:

$db->find();
while($dbo->fetch()) {
  $x = clone($dbo);
  // do anything with $x other than storing it in an array
}

The cloned object's destructor would trigger on the second run through the loop, freeing the database result set -- not really what we wanted.
(Loops that stored the clones into an array were fine, since the clones stay in scope in the array longer than the original does.)

Detaching the database result from the clone lets us work with its data without interfering with the rest of the query.
In the unlikely even that somebody is making clones in the middle of a query, then trying to continue the query with the clone instead of the original object, well they're gonna be broken now.
2010-03-19 11:18:27 -07:00
Brion Vibber b97400bd6f clarify output on fixup-shadow.php 2010-03-19 11:17:56 -07:00
Zach Copley f0c54243ba Merge branch 'testing' of gitorious.org:statusnet/mainline into testing
* 'testing' of gitorious.org:statusnet/mainline:
  Validate OStatus avatar URL before fetching.
2010-03-19 10:38:54 -07:00
Zach Copley 348412f9c9 Allow admins to set a min site textlimit of 0 (unlimited) 2010-03-19 10:30:04 -07:00
Brion Vibber d2e6664132 Validate OStatus avatar URL before fetching. 2010-03-19 10:16:12 -07:00
Brion Vibber 9e3e1d3d56 Validate OStatus avatar URL before fetching. 2010-03-19 10:15:00 -07:00
Zach Copley fb50a2d83c Merge branch 'testing' of gitorious.org:statusnet/mainline into testing
* 'testing' of gitorious.org:statusnet/mainline:
  Parse RSS items as activities
  Remove hkit and do our own hcard parsing
  Work around weird bug with HTML normalization via PHP DOM module; if source had xmlns and xml:lang I ended up with double output, breaking the subsequent parsing. Will have to track this down later and report upstream if not already resolved.
2010-03-19 10:08:47 -07:00
Evan Prodromou 05e3768e6a Parse RSS items as activities
First steps to parsing RSS items as activities. RSS feeds don't seem
to have enough data to make good remote profiles, but this may work
with some "hints".
2010-03-19 09:48:39 -05:00
Evan Prodromou ac609e8040 Merge branch 'testing' of git@gitorious.org:statusnet/mainline into testing
Conflicts:
	plugins/OStatus/extlib/hkit/hkit.class.php
	plugins/OStatus/lib/discoveryhints.php
2010-03-18 20:57:38 -05:00
Evan Prodromou 17c50f338c Remove hkit and do our own hcard parsing
Parsing hcards for the data we need wasn't hard enough to justify using
hkit. It was dependent on a number of external systems (something to
run tidy), and only could handle XHTML.

We now parse HTML with the PHP dom libraries used elsewhere, and
scrape out our own hcards. Seems to work nicer and faster and most of
all works with Google Buzz profile URLs.
2010-03-18 20:52:00 -05:00
Brion Vibber 4a6c9e4451 Work around weird bug with HTML normalization via PHP DOM module; if source had xmlns and xml:lang I ended up with double output, breaking the subsequent parsing. Will have to track this down later and report upstream if not already resolved. 2010-03-18 17:57:58 -07:00
Zach Copley 1f160bb7bc Merge branch 'testing' of gitorious.org:statusnet/mainline into testing
* 'testing' of gitorious.org:statusnet/mainline:
  Handle "forgot to upload an avatar on avatarsettings" a little more gracefully.
2010-03-18 17:20:09 -07:00
Brion Vibber 01a1e882af Handle "forgot to upload an avatar on avatarsettings" a little more gracefully. 2010-03-18 17:18:01 -07:00
Zach Copley a6c9445f0d Merge branch 'testing' of gitorious.org:statusnet/mainline into testing
* 'testing' of gitorious.org:statusnet/mainline:
  OStatus discover fixes:
  Remove xpm support (no one really uses it, and IMAGETYPE_XPM is undefined, causing warnings)
  Fix notice warning about unused var -- was renamed during refactoring.
2010-03-18 17:11:06 -07:00
Brion Vibber 1301877dfe OStatus discover fixes:
* Subscription::start was sometimes passing users instead of profiles to hooks, which broke OStatus subscription notifications; now normalizing to profiles for processing.
* H-card parsing would trigger a lot of PHP warnings and notices in hKit. Now suppressing warnings and notices for the duration of the call to keep them out of output when display_errors is on.
* H-card parsing would trigger a PHP fatal error if the source page was not well-formed XML and Tidy was not present on the system. Switched normalization to use the PHP DOM module which is always present, as we have no need for Tidy's extra features here.
* Trying to fetch avatars from Google profiles failed and triggered a PHP warning due to the relative URL not being resolved during h-card parsing. Now passing profile page URL into hKit by sneaking a <base> tag in while we normalize the HTML source.
* Profile pages without a "Link" header could trigger PHP notices due to a bad NULL -> array(NULL) conversion in LinkHeader::getLink(). Now checking that there was a return value before converting single return value into array.
2010-03-18 17:08:19 -07:00