Commit Graph

91 Commits

Author SHA1 Message Date
Mikael Nordfeldth
7889b21e7b Handle selfLink in ActivityObject 2017-05-06 11:57:16 +02:00
Mikael Nordfeldth
39e8c13afb Properly parse incoming bookmarks 2016-06-24 13:51:40 +02:00
Mikael Nordfeldth
7aa9a69c2f Link to attachment page instead of big-ass image 2016-05-01 11:35:51 +02:00
Stephen Paul Weber
03c68d283d Respect isPermalLink=false on RSS guid 2015-10-27 03:18:04 +00:00
Mikael Nordfeldth
286b54e527 Use getUrl() on File and File_thumbnail instead of ->url 2015-03-04 13:13:20 +01:00
Mikael Nordfeldth
0193c7548f RSS feed items did not get a type assigned 2015-01-15 21:13:21 +01:00
Joshua Judson Rosen
238095a719 Parse remote users' fullnames from PoCo::displayName elements
Try this first; use activity:subject->atom:title only as a fallback.

The code that output activity:subject was removed 2013-10-08,
and it it was deprecated for years before that....
2014-12-08 21:55:51 -05:00
Mikael Nordfeldth
ae62b91940 Unifying HTML stripping functions to common_strip_html 2014-07-14 13:52:23 +02:00
Mikael Nordfeldth
fffacaa27c FavorAction now uses Notice::saveActivity 2014-07-06 01:37:03 +02:00
Mikael Nordfeldth
b63f6e949c Converted all ActivityObject::fromProfile to $profile->asActivityObject 2014-07-03 10:51:36 +02:00
Mikael Nordfeldth
1d981b826a ActivityObject::fromProfile implemented in Profile 2014-07-02 18:39:53 +02:00
Mikael Nordfeldth
96babc59f5 getIdentifiers, resolveUri, findLocalObject Activity algorithms
Also modified related classes to support this feature.
2014-07-02 11:38:20 +02:00
Mikael Nordfeldth
5a3d74d9a8 UseFileAsThumbnailException (helps support GIFs) 2014-06-17 12:15:11 +02:00
Mikael Nordfeldth
70cb488106 ActivityObject::fromProfile used some non-included class definitions 2014-06-03 03:18:13 +02:00
Mikael Nordfeldth
9a1109bd14 Revert "There were referenced in ActivityObject not autoloaded"
This reverts commit 6e35544a67.
2014-06-03 03:16:18 +02:00
Mikael Nordfeldth
6e35544a67 There were referenced in ActivityObject not autoloaded 2014-06-03 01:33:48 +02:00
Mikael Nordfeldth
7d191f8062 s/bestUrl/getUrl/ for notices and microapp objects 2014-04-29 19:46:58 +02:00
Mikael Nordfeldth
37ce1f4766 Better fallback on UnsupportedMediaException 2014-04-28 12:12:06 +02:00
Mikael Nordfeldth
9ea57e5cb2 getAcctUri function added with related exception
Used in ActivityObject for Atom Title generation.

New events:
    * StartGetProfileAcctUri
    * EndGetProfileAcctUri
2013-10-28 18:21:10 +01:00
Mikael Nordfeldth
addd84aa22 Make Atom titles a bit more verbose 2013-10-28 17:54:34 +01:00
Mikael Nordfeldth
d632df320a Apparently only one atom:content is allowed 2013-10-20 13:15:37 +02:00
Mikael Nordfeldth
802734d07e Switch order of html/text for StatusNet backwards compatibility
StatusNet chooses the first content element in an Atom feed, while
it should really choose the 'html' representation for its 'rendered'
and 'text' representation for the (text-only) 'content'.

GNU social will implement a better algorithm for retrieving Atom
feeds, but that is yet to be done. So to avoid having link-less posts
on remote nodes, we'll just do the old switch-a-roo.

Other Atom readers, such as Mozilla Firefox, has the reverse priority
(choosing the last of the content elements).
2013-10-20 12:50:27 +02:00
Mikael Nordfeldth
e1c9061735 Atom output of ActivityObject now has html AND text 2013-10-08 15:00:54 +02:00
Mikael Nordfeldth
db363cdad9 Revert "Don't set the title of a notice to its plain-text content."
This reverts commit 74ec87c27c.
2013-10-08 14:06:27 +02:00
Mikael Nordfeldth
fb94a16217 Moved Avatar retrieval into Avatar class
Backwards compatible functions are still in Profile class.
2013-10-06 15:55:06 +02:00
Mikael Nordfeldth
5f867f98c2 Typing and static declaration in PoCo class 2013-10-06 03:48:41 +02:00
Mikael Nordfeldth
39f43e415d Do not name anything getOriginal (because DB_DataObject calls that)
Avatar->getOriginal has been renamed getUploaded
Notice->getOriginal has been renamed getParent
2013-10-02 15:01:11 +02:00
Mikael Nordfeldth
7979918ba9 Various minor Avatar fixes, but pretty necessary.
One typing thing. And a missed exception case.

Get src from displayUrl() instead of url for example.
2013-10-02 14:49:01 +02:00
Mikael Nordfeldth
b0dfc70a54 Properly unlink all old avatars when deleting/uploading a new
We're also now using $config['image']['jpegquality'] to determine the
quality setting for resized images.

To set Avatar max size, adjust $config['avatar']['maxsize']

The getAvatar call now throws exceptions too. Related changes applied.
Now let's move Profile->avatarUrl to the Avatar class!
2013-10-01 17:00:10 +02:00
Mikael Nordfeldth
a23c4aa236 Avatar resizing improvements and better code reuse
* getOriginal added to Avatar class
    This is a static function that retrieves the original avatar in a leaner
    way than Profile->getOriginalAvatar() did (see below).
    This will throw an Exception if there was none to be found.

* getProfileAvatars added to Avatar class
    This gets all Avatars from a profile and returns them in an array.

* newSize added to Avatar class
    This will scale an original avatar or throw an Exception (originally from
    Avatar::getOriginal) if one wasn't found.

* deleteFromProfile added to Avatar class
    Deletes all avatars for a Profile. This makes the code much smarter when
    removing all avatars from a user.
    Previously only specific, hardcoded (through constants) sizes would be
    deleted. If you ever changed lib/framework.php then many oddsized avatars
    would remain with the old method.

* Migrated Profile class to new Avatar::getOriginal support
    Profile class now uses Avatar::getOriginal through its own
    $this->getOriginalAvatar and thus remains backwards compatible.

* Updating stock GNU Social to use Avatar::getOriginal
    All places where core StatusNet code used the
    $profile->getOriginalAvatar, it will now useAvatar::getOriginal with
    proper error handling.

* Updated Profile class to use Avatar::newSize
    When doing setOriginal, the scaling will be done with the new method
    introduced in this merge.
    This also edits the _fillAvatar function to avoid adding NULL values to
    the array (which causes errors when attempting to access array entries as
    objects). See issue #3478 at http://status.net/open-source/issues/3478
2013-09-30 22:23:03 +02:00
Mikael Nordfeldth
f268c3f877 Completing extra-element-without-text patch from 4015a58d1c 2013-09-24 01:26:51 +02:00
Mikael Nordfeldth
4015a58d1c Sometimes there's no text content, so pad the array (thanks mrvdb)
mrvdb used '' rather than null for the padding argument. MMN-o changed that.
2013-09-24 00:12:30 +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
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
14fbd68a12 Cast lat/lon to float; check for non-empty 2013-06-08 21:16:58 -04:00
Evan Prodromou
8853821db2 Bad variable in ActivityObject::fromMessage() 2013-06-08 21:07:56 -04:00
Evan Prodromou
96d7b68c50 Store direct messages as an activity 2013-06-08 17:54:27 -04:00
Evan Prodromou
caf5f0b3bd Some more well-known sources from plugins 2013-06-07 11:49:47 -04:00
Evan Prodromou
08eca420ca Add generator to JSON output 2013-06-07 11:35:06 -04:00
Evan Prodromou
6164940e8c Some better context for notices as arrays 2013-06-07 03:11:23 -04:00
Evan Prodromou
221c724b4c Fix the switch on type 2013-06-05 16:58:54 -04:00
Evan Prodromou
0e83c5c824 Better type check, better URL 2013-06-05 16:51:46 -04:00
Evan Prodromou
a9b2a86004 Better URL creation for attachments 2013-06-05 16:12:54 -04:00
Evan Prodromou
5ba2cb07ea Better handling of null values in ActivityObject::mimeTypeToObjectType 2013-06-05 16:11:51 -04:00
Evan Prodromou
7229533b0f Use real attachments for JSON output 2013-06-05 09:39:43 -04:00
Evan Prodromou
74ec87c27c Don't set the title of a notice to its plain-text content. 2013-06-04 22:27:29 -04:00
Evan Prodromou
759754555d Change geopoint to location 2013-06-04 17:22:51 -04:00
Evan Prodromou
a2dd5dfef3 Remove duplicate of extensions 2013-06-04 17:16:34 -04:00
Evan Prodromou
f66fedaac8 Use status_net, portablecontacts_net namespaces 2013-06-04 17:12:28 -04:00
Evan Prodromou
879a6f9ce7 Slightly better ActivityStreams JSON output 2013-06-04 17:00:51 -04:00