Commit Graph

260 Commits

Author SHA1 Message Date
Mikael Nordfeldth
4238875ebe autoloading of Crypt_AES and Crypt_RSA is easier 2015-10-04 15:57:11 +02:00
Mikael Nordfeldth
2aed59a02a Diaspora plugin is almost there (for remote salmon slaps at least) 2015-10-04 12:06:48 +02:00
Mikael Nordfeldth
184293c634 Break out MagicEnvelope->toXML() functionality to allow for plugin flexibility 2015-10-04 00:17:07 +02:00
Mikael Nordfeldth
55b2d124bc The 'target' is an argument to common_local_url not the target profile 2015-07-10 22:49:38 +02:00
Mikael Nordfeldth
9a92b58057 ShowstreamAction tidying up
Lots of these changes mean that we're requiring certain values to
either by typed properly or return the expected value. If it doesn't
there should be a fatal exception thrown which we can followup in the
logs and won't go silently suppressed.
2015-07-10 13:44:47 +02:00
Mikael Nordfeldth
871912a00a Plugins didn't match lib/plugin.php onPluginVersion function definition
I ran:
for i in `grep -R onPluginVersion...version plugins/|cut -d: -f1`; do sed -i '{ s/\(onPluginVersion(\)\(\&\$versions\)/\1array \2/ }' $i; done
2015-06-06 22:04:01 +02:00
Mikael Nordfeldth
4de125dd84 Moved FeedSubException parent class to own file 2015-06-06 16:02:25 +02:00
Mikael Nordfeldth
e212f2ae77 Moved Diaspora specific metadata to own plugin 2015-06-06 13:49:27 +02:00
Mikael Nordfeldth
55894f02c7 TagProfileAction and OStatusPlugin now use less redundant code 2015-03-08 20:14:46 +01:00
Mikael Nordfeldth
7666ac34f9 Revert "Notices for faves are already sent as they are notices now."
This reverts commit 636d5141e9.

We want the salmon notifyActivity call
2015-02-03 17:50:21 +01:00
Mikael Nordfeldth
636d5141e9 Notices for faves are already sent as they are notices now. 2015-02-03 16:44:13 +01:00
Mikael Nordfeldth
7beec74f0c Differentiate on group and user for WebFinger data 2015-01-26 12:18:35 +01:00
Mikael Nordfeldth
2d0155a50f Added Magicsig onProfileDeleteRelated 2015-01-24 12:47:39 +01:00
Joshua Judson Rosen
f246dd4645 OStatusPlugin: fix ensureProfile catch-22 in onCheckActivityAuthorship()
Use profile URL (not URI), like elsewhere.

Profile::getUri() doesn't actually do anything useful, here--
it does nothing unless a plugin (like OStatus) is already
able to resolve the Profile into a backend object (e.g.: an Ostatus_profile).

If we might not already have an Ostatus_profile for a given Profile,
then we need to use $profile->getUrl() and fetch the data from that URL.
2014-12-30 23:56:33 -05:00
Mikael Nordfeldth
8056097478 Try to lookup the profile if we don't know it yet 2014-11-24 23:50:42 +01:00
Mikael Nordfeldth
720c2c9ff2 Ostatus_profile->checkAuthorship returns Profile
not Ostatus_profile
2014-11-24 23:40:06 +01:00
Mikael Nordfeldth
faae9d069a We're using URLMapper, not Net_URL_Mapper 2014-11-07 15:24:05 +01:00
Mikael Nordfeldth
29ac42addd Diaspora public key published in WebFinger 2014-11-06 21:05:31 +01:00
Mikael Nordfeldth
57b5e2483d A little bit more debugging. 2014-10-25 14:23:15 +02:00
Mikael Nordfeldth
2d0c7c2c99 ensureWebfinger was never complete in StatusNet. Worked a bit on it. 2014-07-27 23:08:02 +02:00
Mikael Nordfeldth
fffacaa27c FavorAction now uses Notice::saveActivity 2014-07-06 01:37:03 +02:00
Mikael Nordfeldth
eda69cabaf Remove Ostatus_profile when releted Profile is deleted 2014-07-04 11:45:42 +02:00
Mikael Nordfeldth
4b40d6bb2a TagprofileAction fiddled with, now doesn't require OStatus override
But it still doesn't quite work properly, so a lot of work is necessary for this.
2014-07-03 14:02:21 +02:00
Mikael Nordfeldth
b63f6e949c Converted all ActivityObject::fromProfile to $profile->asActivityObject 2014-07-03 10:51:36 +02:00
Mikael Nordfeldth
9f4bcbad8a checkAuthorship events, Ostatus_profile rewrite to handle it
Lost dependency of OStatus plugin for lib/microappplugin.php, whoo!

also noting which plugins should be upgraded to new saveActivity support.

Favorite plugin won't work with the new system just yet, it doesn't have
the necessary functions to extract activity objects, but that's coming
in the next (few) commits.
2014-07-02 11:38:45 +02:00
Mikael Nordfeldth
acb07ef52f Added saveActivity method to Notice class
saveActivity will accept an Activity which gets parsed and saved through
plugins. So when an ActivityHandlerPlugin (such as Favorite will be soon)
gets a feed to save, this will be the function called instead of saveNew.
2014-07-02 11:38:37 +02:00
Mikael Nordfeldth
aaef11077d Default of Magicsig keypair toString should be secure
Prevent crappy coders from leaking private keys.
2014-06-03 12:51:52 +02:00
Mikael Nordfeldth
0bc122ff58 Magicsig::generate is now static
This also fixes a problem with "initial salmon slap", which was a
problem for newly registered accounts which would have their first
salmon slap fail to distribute since there was a problem with Magicsig
keys. Apparently we have to re-read them with importKeys so the
Crypt_RSA objects publicKey and privateKey match later instances of them.

I think it may have been that generate() doesn't specify a signatureMode,
but I leave experimentation of that to the future.
2014-06-02 21:50:40 +02:00
Mikael Nordfeldth
f7479e3f57 Prepare for WebFinger magicsig data for remote profiles 2014-06-02 19:33:09 +02:00
Mikael Nordfeldth
228dc1f851 Ostatus_profile throws NoProfileException from localProfile()
Some implementations of the exception handling is included here,
the actions come in a later commit.
2014-05-19 17:59:36 +02:00
Mikael Nordfeldth
1207f4f06f isLocal() for User_group 2014-05-19 14:46:54 +02:00
Mikael Nordfeldth
869ca2d20b Missed a $user->id to $profile->id translation 2014-05-06 15:43:06 +02:00
Mikael Nordfeldth
c279a33feb More Exceptions for FeedSub doSubscribe and related functions
Now also garbageCollect will now throw exceptions of failures of all kinds
and only reply true/false on entirely successful runs of sub/unsub.
2014-05-06 15:40:57 +02:00
Mikael Nordfeldth
0fa00d5106 Type testing instead of just empty() in OStatusPlugin 2014-05-06 14:36:52 +02:00
Mikael Nordfeldth
b77a09fdee Notice URIs are not necessarily URLs.
Let's use getUrl() for URL retrieval. May throw exceptions, but
only if it's a Notice that cannot be linked like that anyway.
2014-04-30 20:44:23 +02:00
Mikael Nordfeldth
639cf48cc7 OStatus onStartNoticeSourceLink to use exceptions 2014-04-19 22:18:36 +02:00
Mikael Nordfeldth
c00491cd7a Cosmetic changes to common_redirect, clientError, serverError
Since these functions exit (or throw exception) after running, there
is no need to have a 'return' statement or similar afterwards.
2014-03-10 00:25:57 +01:00
Mikael Nordfeldth
698a7adb83 mentions from OStatus lookup were missing a 'type' attribute in common_linkify_mention 2014-02-23 21:49:55 +01:00
Mikael Nordfeldth
6ef1967cec Notice metadata for WebFinger. Not sure if implemented properly.
This is more of a proof of concept and will likely not stay in exactly
this form. We should reasonably deliver the entire notice upon webfinger
querying.
2013-11-01 17:37:18 +01:00
Mikael Nordfeldth
7ddd561837 Salmon only has one "rel" value now, so start deprecating 2013-11-01 17:00:12 +01:00
Mikael Nordfeldth
f110fc5c9a Using GNUSOCIAL_VERSION instead of STATUSNET_VERSION 2013-11-01 13:51:41 +01:00
Mikael Nordfeldth
ca66860a4f Better typing and minor fixes to OStatus related stuff 2013-11-01 13:20:45 +01:00
Mikael Nordfeldth
f75ddaa8aa Getting a profile from URI would throw exceptions on remote URL lookup failures 2013-10-30 14:43:40 +01:00
Mikael Nordfeldth
9b6633698c Group discovery from text functions polished
Also removed the entirely unused saveGroups function.

Now avoiding multiGet and using listFind in Profile->getGroups()
so we don't have to deal with ArrayWrapper.
2013-10-29 13:40:14 +01:00
Mikael Nordfeldth
e868ebfe77 WebFingerResource introduced, instead of strict Profile object
This is the beginning of getting notice URI info via WebFinger

*XrdActionLinks is renamed *WebFingerProfileLinks, check EVENTS.txt
in WebFinger plugin for new events.
2013-10-20 15:48:14 +02:00
Mikael Nordfeldth
1795267df9 Latest phpseclib stuff and moved into its own dir.
Source: https://github.com/phpseclib/phpseclib/
Commit: 77447a3fc7869773007fa3beeb8d6f8de842ec2a

There were bugs.
2013-10-05 00:22:14 +02:00
Mikael Nordfeldth
a0e107f17f Implemented WebFinger and replaced our XRD with PEAR XML_XRD
New plugins:
* LRDD
    LRDD implements client-side RFC6415 and RFC7033 resource descriptor
    discovery procedures. I.e. LRDD, host-meta and WebFinger stuff.

    OStatus and OpenID now depend on the LRDD plugin (XML_XRD).

* WebFinger
    This plugin implements the server-side of RFC6415 and RFC7033. Note:
    WebFinger technically doesn't handle XRD, but we serve both that and
    JRD (JSON Resource Descriptor), depending on Accept header and one
    ugly hack to check for old StatusNet installations.

    WebFinger depends on LRDD.

We might make this even prettier by using Net_WebFinger, but it is not
currently RFC7033 compliant (no /.well-known/webfinger resource GETs).

Disabling the WebFinger plugin would effectively render your site non-
federated (which might be desired on a private site).

Disabling the LRDD plugin would make your site unable to do modern web
URI lookups (making life just a little bit harder).
2013-09-30 22:04:52 +02:00
Joshua Judson Rosen
44f7ad612a Correctly distribute notices from remote posters through local groups to remote group-members via OStatus.
Allow the OStatus queue-handler to handle all posts,
and give it the smarts required to make correct decisions
about whether it should or shouldn't relay notices
over OStatus.
cf. http://status.net/open-source/issues/3540

Conflicts (staticGet => getKV):

	plugins/OStatus/lib/ostatusqueuehandler.php
2013-09-29 23:19:11 +02:00
Mikael Nordfeldth
8205c56e25 Stylesheet event now removed of StatusNet-remnants 2013-09-23 22:13:12 +02:00
Mikael Nordfeldth
747fe9d59b Tidying up getUser calls to profiles and some events
getUser calls are much more strict, and one place where this was found was
in the (un)subscribe start/end event handlers, which resulted in making the
Subscription class a bit stricter, regarding ::start and ::cancel at least.
Several minor fixes in many files were made due to this.

This does NOT touch the Foreign_link function, which should also have a more
strict getUser call. That is a future project.
2013-09-09 23:03:34 +02:00
Mikael Nordfeldth
de55d8f83b plugins onAutoload now only overloads if necessary (extlibs etc.)
lib/plugin.php now has a parent onAutoload function that finds most common
files that are used in plugins (actions, dataobjects, forms, libs etc.) if
they are put in the standardised directories ('actions', 'classes', 'forms',
'lib' and perhaps some others in the future).
2013-08-28 16:10:30 +02:00
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
0ee660af23 fix problem with using wrong arg to EndLeaveGroup event 2011-09-18 19:28:17 -04:00
Evan Prodromou
bba39c4aaf reorder routes for ostatus for better matches 2011-09-18 17:32:59 -04:00
Evan Prodromou
2f1953ca25 Correct args for join event 2011-09-18 14:06:35 -04:00
Evan Prodromou
915dd9c9b5 Copy-and-paste error in OStatus button output 2011-09-18 12:44:16 -04:00
Evan Prodromou
f52d33753e problem with remote subscription on groups in OStatus 2011-09-17 17:28:01 -04:00
Evan Prodromou
01fd24ce6a Make joinAdd() explicit in OStatusPlugin::onStartProfileCompletionSearch() 2011-08-27 12:06:34 -04:00
Siebrand Mazeland
1fa689e913 tag -> list 2011-08-20 20:30:37 +02:00
Evan Prodromou
7759aa51e6 extra logging for OStatus enqueuing 2011-06-29 13:20:18 -04:00
Siebrand Mazeland
1d1a929718 Update translator documentation and L10n. 2011-05-20 16:03:53 +02: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
4ab995dd1e Complete "people tag" to "list" in UI messages.
Update translator documentation accordingly.

Probably a few cases left where "tag[ged[" has to be replaced by "list[ed]".
2011-04-17 20:08:03 +02:00
Siebrand Mazeland
c27b9c0722 Update translator documentation.
i18n/L10n updates.
Whitespace updates.
2011-04-15 15:07:35 +02:00
Shashi Gowda
53af608ef8 People tags -> Lists (only UI changes, for experimentation) 2011-04-14 19:49:42 +00: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
a0ac51c22f use notifyDeferred for tag/untag so that it gets queued offline 2011-04-09 17:18:33 +05:30
Shashi Gowda
5a2bab07b2 Merge remote-tracking branch 'mainline/1.0.x' into people_tags_rebase
Conflicts:
	actions/tagother.php
	classes/Profile.php
	classes/Profile_tag.php
	js/util.min.js
2011-03-30 15:47:42 +05:30
Evan Prodromou
a74eda4e9a don't send private notices over OStatus 2011-03-28 16:37:35 -04:00
Shashi Gowda
bf121a695a Merge remote-tracking branch 'mainline/1.0.x' into people_tags_rebase
Conflicts:
	classes/Profile.php
2011-03-22 07:59:06 +05:30
Shashi Gowda
31c1177970 Merge branch '1.0.x' into people_tags_rebase
Conflicts:
	EVENTS.txt
	actions/peopletag.php
	actions/tagother.php
	classes/Notice.php
	js/util.js
	js/util.min.js
	lib/accountprofileblock.php
	lib/action.php
	lib/activityobject.php
	lib/command.php
	lib/personalgroupnav.php
	plugins/OStatus/OStatusPlugin.php
2011-03-22 07:56:25 +05:30
Brion Vibber
541dfa04fe Switch things from calling Group_member::join & leave & calling events manually to running through Profile::joinGroup() && Profile::leaveGroup(), with the events encapsulated. 2011-03-21 14:35:29 -07:00
Brion Vibber
a390e3e888 Fixes for GroupPrivateMessage, OStatus due to changes in group output events, and some internal bugs using wrong vars 2011-03-18 15:00:02 -07:00
Shashi Gowda
c335db4bbc OStatus support for people tags 2011-03-07 00:45:34 +05:30
Zach Copley
b7d0746694 Merge branch '0.9.x' into 1.0.x
Conflicts:
	actions/confirmaddress.php
	actions/emailsettings.php
	actions/hostmeta.php
	actions/imsettings.php
	actions/login.php
	actions/profilesettings.php
	actions/showgroup.php
	actions/smssettings.php
	actions/urlsettings.php
	actions/userauthorization.php
	actions/userdesignsettings.php
	classes/Memcached_DataObject.php
	index.php
	lib/accountsettingsaction.php
	lib/action.php
	lib/common.php
	lib/connectsettingsaction.php
	lib/designsettings.php
	lib/personalgroupnav.php
	lib/profileaction.php
	lib/userprofile.php
	plugins/ClientSideShorten/ClientSideShortenPlugin.php
	plugins/Facebook/FBConnectSettings.php
	plugins/Facebook/FacebookPlugin.php
	plugins/NewMenu/NewMenuPlugin.php
	plugins/NewMenu/newmenu.css
2011-02-28 15:39:43 -08:00
Evan Prodromou
22e8893fba OStatus uses Plugin::path() 2011-02-03 11:09:26 -05:00
Evan Prodromou
a2aa87fbff OStatusPlugin does discovery in Profile::fromURI() 2011-01-17 15:45:03 -05:00
Evan Prodromou
32eb4c5e2d Merge remote branch 'gitorious/0.9.x' into 1.0.x
Conflicts:
	lib/common.php
2010-12-30 15:52:08 -08:00
Evan Prodromou
ab92496ddc Stop using <activity:subject> for atom feeds 2010-12-27 10:03:34 -08:00
Brion Vibber
9df856e667 Merge branch '0.9.x' into merge
Conflicts:
	README
	actions/hostmeta.php
	classes/File_redirection.php
	lib/common.php
	lib/designsettings.php
	lib/router.php
	lib/util.php
	lib/xmppmanager.php
	plugins/OStatus/OStatusPlugin.php
2010-12-07 10:50:05 -08:00
Evan Prodromou
005a14272d Make OStatusPlugin define push feed rel 2010-11-26 22:10:18 -05:00
Evan Prodromou
fcc0825b14 Make userxrd part of the default hostmeta 2010-11-26 21:46:51 -05: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
Brion Vibber
aa02f6020e Merge branch '0.9.x' into 1.0.x 2010-10-08 11:47:50 -07: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
Brion Vibber
6c959c83ce Merge branch '0.9.x' into 1.0.x 2010-10-07 13:32:26 -07:00
Brion Vibber
a9654beb5d Fix regression in OStatus remote group delivery: local group check was bogus in updated Ostatus_profile::localGroupFromUrl() 2010-10-07 10:56:10 -07:00
Brion Vibber
8ff45823ba Merge branch '0.9.x' into 1.0.x 2010-10-05 11:40:49 -07:00
Brion Vibber
d6b3d7fb1a Fix unescaped dollar signs in double-quoted strings due to localization updates (%1$s etc) 2010-10-04 14:24:04 -07:00
Brion Vibber
59119482ca Merge branch '0.9.x' of gitorious.org:statusnet/mainline into 1.0.x
Conflicts:
	actions/hostmeta.php
	actions/imsettings.php
	classes/User.php
	lib/adminpanelaction.php
	lib/channel.php
	lib/default.php
	lib/router.php
	lib/util.php
2010-10-04 12:54:36 -07:00
Brion Vibber
617b6f4f7d User user_group.uri to look up local groups for OStatus addressing checks when available. Will still fall back to the URL-scheme-checking code if there's no matching user_group record.
Should help with keeping remote groups working when renaming sites -- as long as user_group.uri has been filled out on the site changing its domain and other issues with POST handling are resolved.
2010-09-27 11:29:54 -07:00
Evan Prodromou
b5cfcba471 Merge branch '0.9.x' into activityexport
Conflicts:
	plugins/OStatus/OStatusPlugin.php
2010-09-22 10:45:34 -04:00
Siebrand Mazeland
5a6f616206 * i18n/L10n update
* translator comments added
* remove superfluous whitespace
2010-09-19 15:17:36 +02:00
Evan Prodromou
a881ce23e7 note on why we don't use Group_member::asActivity() in OStatusPlugin 2010-09-14 11:02:54 -04:00
Evan Prodromou
d9b959fc64 move code for making activities from OStatus plugin to Subscription and Fave classes 2010-09-13 11:44:20 -04:00
Craig Andrews
8d54809c35 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-09-07 13:45:52 -04:00
Siebrand Mazeland
1bfbe9badf * i18n/L10n updates and FIXMEs added
* whitespace fixes
2010-09-03 01:35:04 +02:00
Evan Prodromou
82b1d6daef Merge branch 'swat0' into 0.9.x 2010-09-02 16:58:55 -04:00
Evan Prodromou
3baff9aa98 Handle profile-from-uri hook to return ostatus profile if there's a match 2010-09-01 16:16:38 -04:00