Brion Vibber [Tue, 23 Mar 2010 18:25:36 +0000 (11:25 -0700)]
Ticket 2188: add a daily average post count to profile statistics sidebar.
When we have more detailed history stats, this'd be a good place to link to details/graphs.
Brion Vibber [Tue, 23 Mar 2010 16:50:01 +0000 (09:50 -0700)]
Don't add PHPSESSID parameter onto notice and conversation URIs if we save a notice during a session override.
This was being triggered by welcomebot messages created at account creation time, then propagated through replies.
Brion Vibber [Tue, 23 Mar 2010 16:50:01 +0000 (09:50 -0700)]
Don't add PHPSESSID parameter onto notice and conversation URIs if we save a notice during a session override.
This was being triggered by welcomebot messages created at account creation time, then propagated through replies.
Zach Copley [Tue, 23 Mar 2010 01:54:46 +0000 (18:54 -0700)]
Merge branch 'testing' of gitorious.org:statusnet/mainline into testing
* 'testing' of gitorious.org:statusnet/mainline:
OStatus remote sending test cases. Doesn't actually run within PHPUnit right now, must be run from command line -- specify base URLs to two StatusNet sites that will be able to communicate with each other.
Math_BigInteger doesn't correctly handle serialization/deserialization for a value of 0, which can end up spewing notices to output and otherwise intefering with Salmon signature setup and verification when using memcached.
Log backtraces for non-ClientException exceptions caught at the top-level handler.
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
Fixing HTTP Header LRDD parsing (sites in subdirectories need this)
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.
ignore unrecognized object types
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
Accept 'tag' and other non-http id URIs in Ostatus_profile::getActivityObjectProfileURI().
Brion Vibber [Mon, 22 Mar 2010 22:55:13 +0000 (15:55 -0700)]
OStatus remote sending test cases. Doesn't actually run within PHPUnit right now, must be run from command line -- specify base URLs to two StatusNet sites that will be able to communicate with each other.
Current test run includes:
* register accounts (via web form)
* local post
* @-mention using path (@domain/path/to/user)
Subscriptions, webfinger mentions, various paths to subscription and unsubscription, etc to come.
Brion Vibber [Mon, 22 Mar 2010 19:17:45 +0000 (12:17 -0700)]
Math_BigInteger doesn't correctly handle serialization/deserialization for a value of 0, which can end up spewing notices to output and otherwise intefering with Salmon signature setup and verification when using memcached.
Worked around this with a subclass that fixes the wakeup, used for the stored 0 value in the subclassed Crypt_RSA.
Brion Vibber [Mon, 22 Mar 2010 18:27:39 +0000 (11:27 -0700)]
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
Brion Vibber [Sun, 21 Mar 2010 23:25:12 +0000 (16:25 -0700)]
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
Brion Vibber [Sun, 21 Mar 2010 22:18:37 +0000 (15:18 -0700)]
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
Evan Prodromou [Sat, 20 Mar 2010 21:06:22 +0000 (16:06 -0500)]
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.
Evan Prodromou [Sat, 20 Mar 2010 13:25:56 +0000 (08:25 -0500)]
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.
Evan Prodromou [Sat, 20 Mar 2010 12:19:54 +0000 (07:19 -0500)]
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.
Brion Vibber [Fri, 19 Mar 2010 22:47:43 +0000 (15:47 -0700)]
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.
Brion Vibber [Fri, 19 Mar 2010 19:38:14 +0000 (12:38 -0700)]
Throw an exception when an undefined method is called on one of our DB_DataObjects, instead of failing silently.
The magic __call() method is used to implement a getter and setter interface, and simply didn't bother to throw an error for things it didn't recognize.
This may expose a number of existing errors where mistyped method names are called and we're not noticing that they're failing.
Brion Vibber [Mon, 15 Mar 2010 22:41:57 +0000 (15:41 -0700)]
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.
Zach Copley [Fri, 19 Mar 2010 17:08:47 +0000 (10:08 -0700)]
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.
Evan Prodromou [Fri, 19 Mar 2010 14:48:39 +0000 (09:48 -0500)]
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".
Evan Prodromou [Fri, 19 Mar 2010 01:52:00 +0000 (20:52 -0500)]
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.
Brion Vibber [Fri, 19 Mar 2010 00:55:21 +0000 (17:55 -0700)]
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.
Brion Vibber [Fri, 19 Mar 2010 00:55:21 +0000 (17:55 -0700)]
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.
Zach Copley [Fri, 19 Mar 2010 00:11:06 +0000 (17:11 -0700)]
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.
Brion Vibber [Fri, 19 Mar 2010 00:08:19 +0000 (17:08 -0700)]
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.