Commit Graph

50 Commits

Author SHA1 Message Date
Evan Prodromou b28266b3d6 Convert Notice::asAtomEntry() to use Notice::asActivity() and Activity::asString()
We had two ways to generate an activity entry from a notice; one through
Notice::asAtomEntry() and one through Notice::asActivity() and
Activity::asString(). The code paths had already diverged somewhat. I
took the conditions that were in Notice::asAtomEntry() and made sure
they were replicated in the other two functions. Then, I rewrote
Notice::asAtomEntry() to use the other two functions instead.

This change passes the ActivityGenerationTests unit tests, but there
may be some other stuff that's not getting covered.
2010-12-05 16:15:05 -05:00
Siebrand Mazeland b9177f5e2e * i18n/L10n and translator documentation updates.
* whitespace and indentation updates
2010-09-29 00:39:45 +02:00
Evan Prodromou 670ad53215 Merge branch '0.9.x' into activityexport 2010-09-15 23:31:20 -04:00
Evan Prodromou 0a5aa95746 flag to leave out author information in activity output 2010-09-15 07:11:50 -04:00
Evan Prodromou a2fe29388d Activity::asString() should format numerical not string time 2010-09-13 17:05:02 -04:00
Siebrand Mazeland 8c94ebf537 * update/add translator documentation
* remove superfluous whitespace
2010-09-13 21:10:54 +02:00
Brion Vibber 2260d6ec7c Merge branch 'testing' into 0.9.x
Conflicts:
	index.php
2010-04-29 15:14:51 -07:00
Brion Vibber 8fd0059bf6 Test cases and fixes for Atom and RSS content decoding.
Fix extraction of Atom <content type="text"> and <content type="html">; we were failing to escape plaintext source data to HTML, and doing an extraneous double-deescape on HTML source resulting in breakage of notices containing text that looks like HTML. Only <content type="xhtml"> was working correctly previously.
Fixes for RSS2 content processing: we were failing to load <content:encoded> at all due to using wrong element name, and were applying an extraneous de-escape for <description> rather than the escaping that is required to turn plaintext into HTML. (Per spec, <description> must be plaintext.)
2010-04-23 15:40:48 -07:00
Siebrand Mazeland 9b788471d4 Add translator documentation. 2010-04-10 22:50:15 +02:00
Evan Prodromou 29566c5d4b move check for bad IDs from activityobject to activity and make simpler 2010-03-27 22:44:10 -04:00
Zach Copley b8e97ac709 Some initial media parsing
- Activity now returns a list of activity objects
- Processing of photo objects
2010-03-22 18:55:17 -07:00
Evan Prodromou 11a86d046e move atom category to its own file, too 2010-03-20 16:55:36 -05:00
Evan Prodromou 323ff31fbd special-case Posterous author element for activity actor 2010-03-20 16:53:30 -05:00
Evan Prodromou 99454be38c 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.
2010-03-20 16:06:22 -05:00
Evan Prodromou 2fc0f0433e allow html content in summary and clean it out of title 2010-03-20 09:30:28 -05:00
Evan Prodromou 65c8dc313c 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.
2010-03-20 07:19:54 -05:00
Evan Prodromou 022c13418d make deriving a subject from an RSS channel work 2010-03-19 15:49:38 -05:00
Evan Prodromou 1292230e38 move ActivityObject constructors from Activity to ActivityObject 2010-03-19 15:41:48 -05:00
Evan Prodromou 13b1acdd08 only search elements for links 2010-03-19 15:28:25 -05:00
Evan Prodromou 05e3768e6a 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".
2010-03-19 09:48:39 -05: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
Zach Copley b994d529f4 Throw an exception if we receive a document instead of a feed's root element 2010-03-15 19:06:06 -07:00
Brion Vibber c9232d8f26 Ticket #2242: fix reading of inline XHTML content in Atom feeds for OStatus input.
Lookup of the <div> needed to check for the XHTML namespace.
2010-03-15 20:21:55 +00:00
James Walker c4f89b06f1 give preference to rel="photo" (per latest ActivityStreams spec), but still support rel="avatar" for compat 2010-03-14 12:57:24 -04:00
James Walker a9dabbe77e * wrong param order to in_array
* in getContent() if "type" isn't set, assume text (per atom spec)
2010-03-13 10:37:08 -05:00
Zach Copley 78f0d6bbd2 Scrub all atom output with common_xml_safe_str() 2010-03-12 01:12:30 +00:00
Brion Vibber 62d5f1addb Merge branch 'testing' 2010-03-04 07:00:45 -08:00
Zach Copley 8ffb34a90c Temp fix for problem getting actor from PuSH updates where actor is only specified in subject 2010-03-03 20:58:34 -08:00
Brion Vibber 7313cd9094 Merge branch 'testing' of git@gitorious.org:statusnet/mainline
Conflicts:
	plugins/OStatus/OStatusPlugin.php
2010-03-03 09:53:38 -08:00
Brion Vibber 79ffebb51b OStatus: save file records for enclosures
Also stripping id from foreign HTML messages (could interfere with UI) and disabled failing attachment popup for a.attachment links that don't have a proper id, so you can click through instead of getting an error.

Issues:
* any other links aren't marked and saved
* inconsistent behavior between local and remote attachments (local displays in lightbox, remote doesn't)
* if the enclosure'd object isn't referenced in the content, you won't be offered a link to it in our UI
2010-03-02 16:36:08 -08:00
Brion Vibber 7175e7c7a1 OStatus fix: look for <link>s in the current element's children, not in all its descendants. Was breaking notice URL transfer, pulling a profile link by mistake. 2010-03-02 15:38:52 -08:00
Brion Vibber 2fa953da22 Merge branch 'testing' of gitorious.org:statusnet/mainline into testing 2010-02-25 18:52:26 -08:00
Brion Vibber 2feb09f434 OStatus: pull best-sized avatar image (96x96 if found, otherwise largest, otherwise if none labeled takes the first) 2010-02-25 18:51:44 -08:00
Zach Copley 207cc89074 Set avatar height correctly 2010-02-25 18:06:03 -08:00
Zach Copley 7922edb5b6 Add lots of fun avatars to our Atom output 2010-02-25 16:06:49 -08:00
Zach Copley bac959ad46 Merge branch 'testing' of gitorious.org:statusnet/mainline into testing
* 'testing' of gitorious.org:statusnet/mainline:
  Not sure how this ended up in wrong-cased dir...
  OStatus: fix remote groups to work with new user_groups/local_groups split.

Conflicts:
	classes/User_group.php
2010-02-25 13:40:14 -08:00
Zach Copley e61edb55d9 Rationalize group activity stuff 2010-02-25 13:34:43 -08:00
Brion Vibber b5b5184c88 OStatus: fix remote groups to work with new user_groups/local_groups split.
- fix <activity:subject> generation so we get the profile info (what's available so far)
- use id instead of nickname for group join/leave forms so we can join/leave remote groups
  while the rest of the groups UI remains limited to local groups
  (plugins are responsible for making sure remote notifications and permission checks are done)
- fix remote notification when joining group through OStatus's remote subscribe form
2010-02-25 13:02:08 -08:00
Brion Vibber 79c0d52daa OStatus: save categories from the Atom entry as hashtags. 2010-02-25 11:26:33 -08:00
Zach Copley 10884dcd49 Merge branch 'testing' of gitorious.org:statusnet/mainline into testing
* 'testing' of gitorious.org:statusnet/mainline:
  Merge StatusNet core localization updates from 0.9.x branch
  Fix update_po_templates.php to support the plural and context variants of _m() in plugins
  Drop HTMLPurifier; we don't need its extra capabilities and we're already using htmLawed which is lighter-weight.
  OStatus: handle update-profile Salmon pings
  Revert "Updated jQuery Form Plugin from v2.17 to v2.36"
  OStatus: disable HTMLPurify cache unless we've configured a writable path for it.
2010-02-24 16:52:16 -08:00
Zach Copley 543ff40ef6 Populate more profile information when doing a remote subscribe 2010-02-24 16:51:24 -08:00
Brion Vibber ec4899e617 OStatus: disable HTMLPurify cache unless we've configured a writable path for it.
Updated plugin README with available config options.
Cleanup for a bad element fallback lookup in Activity
2010-02-24 22:16:17 +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 5cabb63e4e Include <author> with actor ID and name in Activity::asString(); fixes Salmon signature on OStatus unsub pings 2010-02-24 17:36:31 +00:00
Zach Copley 3a3af6782a Add PoCo parsing and some other fixes. 2010-02-23 22:35:48 -08:00
Zach Copley fa178a8aa7 Add poco:displayName to Atom output for person object 2010-02-23 14:26:34 -08:00
Brion Vibber 90d34b26c6 OStatus: do PuSH subscription setup from subscribe/join event hooks, so resubscribing directly from a profile/group list works correctly if there aren't active subscriptions at the moment. 2010-02-23 20:44:27 +00:00
Zach Copley 1f859e72a2 Add activity.php to common includes 2010-02-22 17:47:40 -08: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