OStatus: save categories from the Atom entry as hashtags.

This commit is contained in:
Brion Vibber
2010-02-25 11:26:33 -08:00
parent 39a8e9d8e6
commit 79c0d52daa
4 changed files with 106 additions and 18 deletions

View File

@@ -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,