Commit Graph

66 Commits

Author SHA1 Message Date
Diogo Cordeiro
c03ed457a6 Fix broken user activitystreams feed due to deleted notices 2019-05-06 23:27:38 +01:00
Mikael Nordfeldth
dd149a76f3 AtomPub should work now, at least for post/note 2015-10-09 16:19:26 +02:00
Mikael Nordfeldth
216a04df86 Switching variable access in ApiTimelineUser to GNUsocial improvements 2015-10-09 11:23:20 +02:00
Mikael Nordfeldth
f7553d73a2 501 Not Implemented on timelines for remote users. 2015-02-25 16:31:02 +01:00
Mikael Nordfeldth
0deaf6c50c use common_purify to purify HTML, one function to rule them all 2015-02-18 00:14:28 +01:00
Mikael Nordfeldth
48680942fd Avoid undefined variables. 2014-12-06 19:56:21 +01:00
Mikael Nordfeldth
e006b73505 Revert "Report a 404 not found if no posts found for User timeline"
This reverts commit 5295e8d4de.

Just reply with an empty timeline...
2014-12-04 19:45:27 +01:00
Mikael Nordfeldth
5295e8d4de Report a 404 not found if no posts found for User timeline 2014-11-22 12:29:13 +01:00
Mikael Nordfeldth
d1b10ee92b Don't define a variable in a function call 2014-11-22 12:26:51 +01:00
Mikael Nordfeldth
9a192473d5 declared "next_id" used to set the max_id for next link 2014-08-08 11:35:38 +02:00
Mikael Nordfeldth
2766c2aeec User timeline ActivityStreams output now has paging data 2014-08-07 22:40:55 +02:00
Mikael Nordfeldth
ae62b91940 Unifying HTML stripping functions to common_strip_html 2014-07-14 13:52:23 +02:00
Mikael Nordfeldth
49fa34e234 Make Profile::fromUri use UnknownUriException 2014-05-26 15:05:14 +02:00
Mikael Nordfeldth
f8b49e69d0 Protected function prepare with array $args defaulting to array() 2013-10-29 10:26:46 +01:00
Mikael Nordfeldth
23a6b4595f Reworked the ActivityContext->attention structure
Removing Evan's obscure attentionType solution and directly using the attention array
2013-10-28 22:21:14 +01:00
Mikael Nordfeldth
29d0871e5a Making many of the API actions more consistent with coding style
clientError and serverError exit after they're done so no need for
break or return. Also, $this->format is default.

We also got rid of the incredibly verbose version of $this->isPost()
which was spread all over the place.

Not all of this cleaning up is done yet.
2013-10-15 03:07:40 +02:00
Mikael Nordfeldth
34a6624452 Qvitter API changes (thanks hannes2peer)
I implemented changes from quitter.se's new API that their front-end qvitter
uses, https://github.com/hannesmannerheim/qvitter/blob/master/api-changes-1.1.1/CHANGES

However I left out the URL shortening commens, since I believe whatever behaviour
they experienced that caused them to implement this was a bug (or many) and should
be fixed in their proper areas and that shortening should not be entirely left
out in API calls.
2013-10-06 21:51:50 +02:00
Mikael Nordfeldth
a9c4bcd71f Removing unnecessary require_once lines (autoload!) 2013-09-09 23:06:56 +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
abdae45679 allow posting to groups through atompub 2011-08-27 17:37:10 -04:00
Evan Prodromou
20396ce8e1 ActivityStreamJSONDocument served as application/stream+json 2011-06-23 11:38:46 -04:00
Siebrand Mazeland
84a2fb44b9 Add/update translator documentation. 2011-04-04 00:12:52 +02:00
Brion Vibber
9e9cbdf505 Suppress PHP warnings/notices during AtomPub XML parsing to avoid HTTP header problems when given bad input.
If display_errors is on, typical settings would cause PHP error messages to spew to output before the HTTP headers for setting a 400 error go through.
Also switched from deprecated static DOMDocument::loadXML() to non-static call.
2011-03-15 10:09:20 -07:00
Zach Copley
68017392ff Make other timeline API endpoints output Activity Streams JSON 2011-02-18 15:43:40 -08:00
Siebrand Mazeland
a159352b65 * improve L10n consistency for English. For example proper punctuation for all button and label titles.
* fix some i18n bugs (in-message variables).
* update/add translator documentation.
* remove superfluous whitespace.
2011-02-17 00:40:47 +01:00
Siebrand Mazeland
7db24c32d6 * fix some i18n and L10n issues
* update/add translator documentation
* remove superfluous whitespace
2011-01-29 00:33:13 +01:00
Brion Vibber
6fa0bea76d Merge branch '0.9.x' into testing 2011-01-20 15:12:57 -08:00
Siebrand Mazeland
6658bd1893 Update translator documentation
Remove unneeded i18n for debug message
Remove superfluous whitespace
2011-01-20 18:45:13 +01:00
Brion Vibber
64844473f8 fix wrong datatypes (saving string instead of array) in AtomPub notice processing 2011-01-19 14:26:31 -08:00
Evan Prodromou
0bcc3ee005 include saved notice in atompub events 2010-12-27 22:11:30 -08:00
Evan Prodromou
a85bbd9088 Add a user parameter to atom pub api events 2010-12-27 20:49:08 -08:00
Brion Vibber
6c67114198 Mark OembedAction, XrdAction, and (plugin) AutocompleteAction as read-only. Tweaked ApiStatusesShow and ApiTimelineUser to still claim read-only when hit with a HEAD request (usually link checkers or a precursor to a GET, and should be semantically equivalent to a GET without actually transferring data) 2010-12-14 16:14:15 -08:00
Brion Vibber
82a9560a2d AtomPub fix: correct the response URL given from posting a new message (wrong parameter meant we got the main page instead of the message's URL) 2010-12-14 13:19:22 -08:00
Brion Vibber
54a0e801f3 AtomPub fixes: return '201 Created' on POST of new message; better error checking on Atom input 2010-12-14 13:12:24 -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
Siebrand Mazeland
086d6c9f36 * Fix an incorrectly formatted message parameter in line 334.
* i18n/L10n updates
* translator documentation updated
2010-12-02 12:33:03 +01:00
Evan Prodromou
d038d0fa46 AtomPub-related actions are only read-only on GET 2010-11-15 14:14:09 -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
Evan Prodromou
cb371d65c1 add hooks for atom pub posts 2010-11-15 11:54:42 -05:00
Siebrand Mazeland
04ae500749 * i18n/L10n fixes.
* translator documentation updated.
* superfluous whitespace removed.
2010-10-28 01:21:21 +02:00
Evan Prodromou
e6ba379c8b navigation links in user timeline (for AtomPub) 2010-10-25 11:08:10 -04:00
Evan Prodromou
c0664599aa allow posting to user timeline using AtomPub 2010-10-24 22:50:13 -04:00
Brion Vibber
64cdbe6c55 Ticket #2750: fixes to HTTP caching behavior across login/logout boundaries
* now ignoring if-modified-since if we failed an etag if-none-match comparison, per spec
* now including a hash of user id/nickname in most etags, so we'll update the view properly after login/logout

For API methods, checking the API-auth'ed user. (Many change results to include things like 'you're subscribed to this user' or 'this is one of your favorites', so user info is again needed)

There'll still be some last-modified stamps that aren't including user info properly, probably.
2010-09-20 13:42:58 -07:00
Craig Andrews
6317f7d92b Assigning my copyrights to the Free Software Foundation 2010-05-27 18:27:33 -04:00
Zach Copley
c5b61078e1 Pass auth user into Atom feed generators (needed for outputting favorited status in statusnet:notice_info tag) 2010-05-27 13:49:23 -07:00
Zach Copley
e1537d8387 More generalized method for calculating Atom rel="self" links 2010-03-12 01:40:52 +00:00
Zach Copley
212b20e876 Add self link to user and group rss2 feeds 2010-03-11 23:43:03 +00: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
6b134ae4c7 Dropped deprecated timestamp-based 'since' parameter for all API methods. When it sneaks in it can cause some very slow queries due to mismatches with the indexing.
Twitter removed 'since' support some time ago, and we've already removed it from the public timeline, so it shouldn't be missed.
2010-03-02 11:54:02 -08:00
Zach Copley
792f0942f7 Fix atom feed IDs in user and group atom feeds 2010-02-25 18:13:06 -08:00