Commit Graph

203 Commits

Author SHA1 Message Date
Mikael Nordfeldth
2a4dc77a63 The overloaded DB_DataObject function staticGet is now called getKV
I used this hacky sed-command (run it from your GNU Social root, or change the first grep's path to where it actually lies) to do a rough fix on all ::staticGet calls and rename them to ::getKV

   sed -i -s -e '/DataObject::staticGet/I!s/::staticGet/::getKV/Ig' $(grep -R ::staticGet `pwd`/* | grep -v -e '^extlib' | grep -v DataObject:: |grep -v "function staticGet"|cut -d: -f1 |sort |uniq)

If you're applying this, remember to change the Managed_DataObject and Memcached_DataObject function definitions of staticGet to getKV!

This might of course take some getting used to, or modification fo StatusNet plugins, but the result is that all the static calls (to staticGet) are now properly made without breaking PHP Strict Standards. Standards are there to be followed (and they caused some very bad confusion when used with get_called_class)

Reasonably any plugin or code that tests for the definition of 'GNUSOCIAL' or similar will take this change into consideration.
2013-08-18 13:13:56 +02:00
Evan Prodromou
961607bc5d Ignore non-atom updates links in Webfinger 2012-05-04 12:01:13 -04:00
Evan Prodromou
9f954eddc5 remove unsupported hcard action 2011-09-27 11:43:41 -04:00
Evan Prodromou
dbb7324b25 test for missing profile in ostatus queue handler 2011-09-18 14:36:49 -04:00
Siebrand Mazeland
1fa689e913 tag -> list 2011-08-20 20:30:37 +02:00
Evan Prodromou
da4ba6a5a9 reinstate lost replies code in OStatusQueueHandler 2011-06-29 13:51:19 -04:00
Siebrand Mazeland
4651c9d94a Fix L10n/i18n.
Some remaining people tag -> list.
Favor -> like
Update translator documentation.
Whitespace updates.
2011-04-29 18:59:47 +02:00
Siebrand Mazeland
b83e0fd0e8 Update translator documentation.
i18n fixes (gettext domain).
L10n updates.
Whitespace updates.
Some tabs to spaces.
2011-04-11 00:39:51 +02:00
Shashi Gowda
c335db4bbc OStatus support for people tags 2011-03-07 00:45:34 +05:30
Evan Prodromou
2a59453d4c Merge branch 'testing' into moveaccount 2011-01-17 17:34:03 -05:00
Evan Prodromou
0fa57948f2 move linkheader.php to core 2011-01-16 17:15:26 -05:00
Evan Prodromou
7d1f609bf0 Move discovery library from OStatus plugin to core 2011-01-16 17:15:26 -05:00
Brion Vibber
1d15145993 Salmon signature checks on incoming slaps now check both old and new signature formats. 2011-01-06 00:01:42 +00:00
Brion Vibber
437ac120b0 Outgoing Salmon slaps now use the corrected signature format; if the first hit is rejected with an HTTP error, we try again with the old format.
(This is not 100% ideal; possibly should try to distinguish between server errors and rejections, etc.)
2011-01-05 23:54:16 +00:00
Brion Vibber
946a4ac17b Add test cases for internal change in Salmon signing; fix for the new code.
Updated sig passes Tuomas's verifier, which is a good sign
2011-01-05 23:26:39 +00:00
Brion Vibber
51d1535f15 Added doc comments on Salmon magicsig-related stuff to help in figuring out what's going on 2011-01-05 14:05:59 -08:00
Evan Prodromou
b54ea6767a New event for Salmon including target 2010-12-27 10:51:59 -08:00
Evan Prodromou
0a4911552e Move user xrd action to core and use hooks to extend
Moved the Webfinger user XRD action from the OStatus plugin to core.
Added hooks to add OStatus-specific stuff, but kept general stuff in
the core.
2010-11-26 21:38:38 -05:00
Craig Andrews
3f3b38766f move xrd and hostmeta out of the OStatus plugin and into core
add event for setting up hostmeta, and use them in the OStatus plugin
2010-11-26 21:12:14 -05:00
Evan Prodromou
23ac961624 Show Webfinger, URI and profile page as subject and aliases 2010-10-14 11:06:57 -04:00
Brion Vibber
69b13cb279 Normalize execution guards on OStatus php files; mostly helps cut down on annoying 'class not found' errors when something spiders the dirs. :P 2010-10-08 10:42:59 -07:00
Siebrand Mazeland
5a6f616206 * i18n/L10n update
* translator comments added
* remove superfluous whitespace
2010-09-19 15:17:36 +02:00
Siebrand Mazeland
a9fad9a7ac Add translator hint. 2010-09-12 17:08:49 +02:00
Evan Prodromou
4aac47de03 syntax error in exception string in discovery.php 2010-09-03 01:41:01 -04:00
Siebrand Mazeland
1bfbe9badf * i18n/L10n updates and FIXMEs added
* whitespace fixes
2010-09-03 01:35:04 +02:00
Evan Prodromou
c82b1cda82 send a salmon slap to mentioned person when we reply to a notice 2010-09-01 14:35:43 -04:00
Evan Prodromou
54b93aede6 typo mixing up and in salmonaction 2010-08-16 10:03:38 -07:00
Brion Vibber
f7b2bb09e6 Suppress whinging during HTML parsing in profile page discovery for things that turn out to be XML feeds with funny namespaces. 2010-08-13 12:23:28 -07:00
Brion Vibber
9a53be4669 Initial support for third-party fallback hub such as Superfeedr for feed subscriptions.
If set up, this hub will be used to subscribe to feeds that don't specify a hub of their own.
Assumes that the fallback hub will, in fact, handle polling and updates for any feed we throw at it!
Authentication may be specified for the fallback hub.

Example:

  $config['feedsub']['fallback_hub'] = 'https://superfeedr.com/hubbub';
  $config['feedsub']['hub_user'] = 'abcd';
  $config['feedsub']['hub_pass'] = 'ckcmdkmckdmkcdk';

Also:
* Fix for WordPress-RSS-via-Superfeedr-Atom; if we have <author> info but no ID from a native ActivityStreams actor, don't freak out in the low-level processing code that checks for identity matches.
* enhanced messages for low-level FeedSub exceptions if they make it to outside display
2010-08-10 12:57:40 -07:00
James Walker
c8a706081e strip whitespace from me:data and me:sig (per spec) 2010-08-07 09:48:21 -04:00
James Walker
8120842780 Fix for #2429 - move OStatus XML writing to XMLStringer 2010-08-02 16:42:28 -04:00
James Walker
56294016a7 fix #2478 - ensure all XRD documents get proper content-type headers 2010-08-02 14:47:13 -04:00
James Walker
517c7483d1 move to rel="salmon" (per latest spec) 2010-08-02 13:24:38 -04:00
Brion Vibber
d645b342ac Commit hubprepqueuehandler.php -- fix for OStatus bulk output. 2010-07-12 14:22:36 -07:00
Brion Vibber
41e9dba729 OStatus plugin: Rolling batch queueing for PuSH output to >50 subscribing sites. Keeps latency down for other things enqueued while we work... 2010-06-07 10:03:43 -07:00
Brion Vibber
cbf2e7cfea Avoid PHP notice about undefined array index when no avatar photo available from Google profile 2010-05-21 10:18:13 -07:00
James Walker
1999b836c0 accept either salmon endpoint (until they're unified in the spec) 2010-05-14 16:43:41 -04:00
Brion Vibber
5f5d9518bd Avoid spewing giant debug backtrace into exception in certain OStatus subscription failure cases.
The code pattern 'new XXXException($e)' to chain exceptions doesn't actually work as intended, as exceptions are actually expecting a string message here.
This caused an implicit string conversion from HTTP_Request2_Exception, which is a PEAR_Exception, which defines an absurdly detailed __toString() method including a giant HTML table with a backtrace if you happen to be on a web request.
Simply passing $e->getMessage() instead clears this up, as we'll get the nice short message like 'Couldn't connect to tcp://blahblah:80'
2010-05-04 17:11:43 -07:00
James Walker
c6c4510192 move base64_url_(encode|decode) to static functions in Magicsig 2010-03-26 13:37:46 -04:00
James Walker
cfca789b34 Updated Math_Biginteger from upstream - removing safe* workarounds 2010-03-24 15:18:41 -04:00
James Walker
10410907a0 A bit safer checking in the keypair parsing 2010-03-24 14:27:35 -04:00
Brion Vibber
5f32cf32cd Don't spew XML parse warnings to output when checking a remote XRD page 2010-03-23 14:18:45 -07:00
Brion Vibber
27bfd1211d 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.
2010-03-22 12:17:45 -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
db0cf50f65 Avoid notices for accessing undefined array indices in hcard processing 2010-03-19 15:54:54 -07: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
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
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
Evan Prodromou
4761c07ad8 Merge branch 'testing' of git@gitorious.org:statusnet/mainline into testing 2010-03-17 09:38:39 -05:00
Evan Prodromou
f21f78364a Change the workflow to get better discovery
Tried to re-structure the workflow of discovery to get more and richer
data and hints.
2010-03-16 11:25:18 -05:00
Brion Vibber
dfac4bfd09 Fix feed discovery: html:link@rel can contain multiple values; saw rel="updates alternate" in the wild at http://tantek.com/ which broke old discovery code. 2010-03-15 20:26:42 +00:00
James Walker
7aa49b5e87 use canonical user url in xrd 2010-03-15 15:17:31 -04:00
James Walker
85cf90cf0f Performing & allowing host-meta discovery by http url (in addition to webfinger acct) 2010-03-13 18:35:00 -05:00
James Walker
512e511053 fix invalid separator in magic-public-key XRD and matching parsing. 2010-03-11 14:49:12 -05:00
James Walker
06612e35e4 remove hard-coded me:env check in magicenvelope 2010-03-11 14:49:12 -05:00
James Walker
89582e7226 base64_encode/decode -> base64_url_encode/decode 2010-03-11 14:49:12 -05:00
Brion Vibber
58192ad687 OStatus: fix exception thrown on HTTP error during feed discovery 2010-03-09 10:56:33 -08:00
James Walker
ddc4a7d2ff Catch a previously uncaught exception and add some additional debug logs for signature verification 2010-03-04 01:46:34 -05:00
James Walker
1c8399fde1 refactor xrd to allow for ownerxrd - xrd document for the site owner.
introduced $config['webfinger']['owner'] for a custom xrd subject
2010-03-03 23:20:30 -05:00
Brion Vibber
24835c1164 OStatus: catchable exception instead of fatal when parsing valid XML that isn't a valid XRD doc 2010-03-03 18:31:35 -08:00
Brion Vibber
9fadf8da11 Put all required field setup into AtomUserNoticeFeed and AtomGroupNoticeFeed, consolidating some code. (RSS feeds pulling title, logo etc from the Atom data structure so we don't dupe it.)
OStatus now calling the feed classes directly instead of faking a call into the API, should be less flakey.
2010-03-03 16:33:20 -08:00
Brion Vibber
ffa1931c9d Avoid warning/notice spew in XRD parser. Not all DOM nodes are elements. 2010-03-03 09:31:14 -08:00
Brion Vibber
e30af99873 Merge branch 'work' into testing 2010-03-01 16:57:58 -08:00
Brion Vibber
493b5479c1 OStatus: support @example.com/path/to/profile mentions as well as @profile@example.com (latter requires webfinger, former doesn't)
Plus misc warnings/notices cleanup in the submission path.
2010-03-01 16:43:36 -08:00
Brion Vibber
45e8819c1b Fix a bunch of notice & warning-level messages that were breaking my inter-instance communications 2010-03-01 16:35:36 -08:00
James Walker
1cf08c7ad7 MagicEnvelope::parse shouldn't be called statically 2010-02-26 17:09:50 -05:00
James Walker
c82cee1876 removing some extraneous debug logging 2010-02-26 16:26:04 -05:00
James Walker
e4c462570f move salmon posting to send application/magic-envelope+xml per http://salmon-protocol.googlecode.com/svn/trunk/draft-panzer-salmon-00.html#RPF 2010-02-26 15:39:58 -05:00
James Walker
223ebc765c move signing to take a local actor profile and use local keys 2010-02-26 14:22:49 -05:00
James Walker
bbb0a7d5bc updating to use latest salmon NS definitions 2010-02-26 14:22:49 -05:00
James Walker
ab8bb4d79e more cleanup 2010-02-26 04:07:58 -05:00
James Walker
d1256b547f bad merge.. cleaning up missing webfinger bits 2010-02-26 03:43:35 -05:00
James Walker
22062b665e remove webfinger.php 2010-02-26 03:28:29 -05:00
James Walker
84d0c865c4 salmon actually fetching remote keypairs 2010-02-26 03:25:51 -05:00
James Walker
7c8031dc4b Merge remote branch 'statusnet/testing' into testing
Conflicts:
	plugins/OStatus/lib/webfinger.php
2010-02-25 23:49:45 -05:00
James Walker
855692141d use a real keypair from discovery 2010-02-25 23:38:25 -05:00
Evan Prodromou
a43598c31e cache Web responses in Webfinger library 2010-02-25 21:07:24 -05:00
Evan Prodromou
cc0670791e use new hcard method for webfinger 2010-02-25 19:58:18 -05:00
James Walker
08413428a7 typo 2010-02-25 17:52:56 -05:00
James Walker
b2dabe6a48 removing the webfinger lib 2010-02-25 17:12:46 -05:00
James Walker
3d0ba3efc8 adding a new, more generic "discovery" class that does LRDD disco
(rather than webfinger specific)
2010-02-25 17:09:54 -05:00
James Walker
e62e49ed3b adding some exception handling for magicenv parsing 2010-02-25 17:09:54 -05:00
Brion Vibber
b798faf9ea OStatus: abort processing of this PuSH in item if we got an exception, rather than letting it be re-run. 2010-02-25 02:43:20 +00:00
Brion Vibber
93507a1927 OStatus: handle update-profile Salmon pings 2010-02-24 23:28:01 +00:00
Brion Vibber
c36bdc1ba5 - break OMB profile update pings to a background queue
- add event hooks to profile update pings
- send Salmon pings with custom update-profile event to OStatus subscribees and groups (subscribers will see it on your next post)
- fix OStatus queues with overlong transport names, should work on DB queues now
- Ostatus_profile::notifyActivity() and ::notifyDeferred() now can take XML, Notice, or Activity for convenience
2010-02-24 20:36:36 +00:00
Brion Vibber
2e58802cc9 OStatus: fix group delivery, send reply/group Salmon pings from background. 2010-02-24 02:20:31 +00:00
Brion Vibber
584b87cfe5 OStatus: consolidate the low-level notice save code between Salmon and PuSH input paths. Validation etc remains at higher levels. 2010-02-24 01:09:52 +00:00
James Walker
9494b0e5d7 magicsig shuffling 2010-02-22 23:30:32 -05:00
James Walker
cd561657c2 missing return value check 2010-02-22 23:30:31 -05:00
James Walker
cb32b676fa moving magicsig.php to classes - to add storage 2010-02-22 23:30:31 -05:00
Zach Copley
cbf6ebae01 Merge branch 'rationalize-activity' into testing
* rationalize-activity:
  Move ActivityObject and related stuff to core
  Add PoCo bits, avatar link, geo point, etc. to person activity obj output
2010-02-22 17:12:33 -08:00
Zach Copley
6a711c6cdc Move ActivityObject and related stuff to core 2010-02-22 17:10:50 -08:00
Brion Vibber
870e556faa Merge branch 'testing' of git@gitorious.org:statusnet/mainline into testing 2010-02-23 00:52:47 +00:00
Zach Copley
a3e800e67c Add PoCo bits, avatar link, geo point, etc. to person activity obj output 2010-02-22 16:46:54 -08:00
Brion Vibber
d410df0406 OStatus group delivery initial implementation.
- added rel="ostatus:attention" links for group delivery
- added events for plugins to override group profile/permalink pages
- pulled Notice::saveGroups up to save-time so we can override;
  it's relatively cheap and gives us a clean list of target
  groups for distrib time even with customized delivery.
- fixed notice::getGroups to return group objects as expected
- added some doc on new parameters to Notice::saveNew
 - 'groups' list of group IDs to push to in place of parsing
- messages that come in via PuSH and contain local group targets
  are delivered to local group members
- messages that come in via PuSH and contain remote group targets
  are delivered to local members of the remote group

Todo:
- handle group posts that only come through Salmon
- handle conflicts in case something comes in both through Salmon and PuSH
- better source verification
- need a cleaner interface to look up groups by URI
- need a way to handle remote groups with conflicting names
2010-02-23 00:44:45 +00:00
James Walker
caad5859b5 swapping pear error handling so Crypt_RSA can properly detect available
math libraries
2010-02-22 19:01:12 -05:00
Brion Vibber
06f155c02d OStatus: initial hookup of remote group membership (notice delivery not yet working quite right)
- added a temp config var to disable salmon magic signatures until they're working consistently
2010-02-22 12:13:57 -08:00