diff options
author | Brion Vibber <brion@pobox.com> | 2010-02-25 11:26:33 -0800 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-02-25 11:26:33 -0800 |
commit | 79c0d52daa92b60e8eed80fa9459367c26f97122 (patch) | |
tree | 6bb2e206ef30cab5ce0cfbcf46b413f0633d57ee /plugins | |
parent | 39a8e9d8e679cfd02e47fa93aa26373101515cf9 (diff) |
OStatus: save categories from the Atom entry as hashtags.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/OStatus/classes/Ostatus_profile.php | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/plugins/OStatus/classes/Ostatus_profile.php b/plugins/OStatus/classes/Ostatus_profile.php index 300e38c05..d66939399 100644 --- a/plugins/OStatus/classes/Ostatus_profile.php +++ b/plugins/OStatus/classes/Ostatus_profile.php @@ -638,7 +638,9 @@ class Ostatus_profile extends Memcached_DataObject 'uri' => $sourceUri, 'rendered' => $rendered, 'replies' => array(), - 'groups' => array()); + 'groups' => array(), + 'tags' => array()); + // Check for optional attributes... @@ -673,6 +675,16 @@ class Ostatus_profile extends Memcached_DataObject } } + // Atom categories <-> hashtags + foreach ($activity->categories as $cat) { + if ($cat->term) { + $term = common_canonical_tag($cat->term); + if ($term) { + $options['tags'][] = $term; + } + } + } + try { $saved = Notice::saveNew($oprofile->profile_id, $content, |