forked from GNUsocial/gnu-social
OStatus: save categories from the Atom entry as hashtags.
This commit is contained in:
@@ -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,
|
||||
|
Reference in New Issue
Block a user