Relocate functions in items.php into several classes

This commit is contained in:
Michael 2018-01-20 23:52:54 +00:00
parent 3ac1992237
commit efa8dbcfb3
7 changed files with 304 additions and 285 deletions

View file

@ -1037,7 +1037,7 @@ class DFRN
XML::addElement($doc, $entry, "dfrn:diaspora_signature", $sign);
}
XML::addElement($doc, $entry, "activity:verb", construct_verb($item));
XML::addElement($doc, $entry, "activity:verb", self::constructVerb($item));
if ($item['object-type'] != "") {
XML::addElement($doc, $entry, "activity:object-type", $item['object-type']);
@ -3073,4 +3073,19 @@ class DFRN
return;
}
/**
* @brief Returns the activity verb
*
* @param array $item Item array
*
* @return string activity verb
*/
private static function constructVerb(array $item)
{
if ($item['verb']) {
return $item['verb'];
}
return ACTIVITY_POST;
}
}