protected static function getActivityObjectProfile($object)
{
$uri = self::getActivityObjectProfileURI($object);
- return Ostatus_profile::staticGet('homeuri', $uri);
+ return Ostatus_profile::staticGet('uri', $uri);
}
protected static function getActorProfileURI($activity)
protected static function createActivityObjectProfile($object, $feeduri=null, $salmonuri=null)
{
- $homeuri = self::getActivityObjectProfileURI($object);
+ $homeuri = $object->id;
$nickname = self::getActivityObjectNickname($object);
- $avatar = self::getActivityObjectAvatar($object);
+ $avatar = self::getActivityObjectAvatar($object);
if (!$homeuri) {
common_log(LOG_DEBUG, __METHOD__ . " empty actor profile URI: " . var_export($activity, true));
// @todo tags from categories
// @todo lat/lon/location?
- $ok = $profile->insert();
+ $profile_id = $profile->insert();
- if (!$ok) {
+ if (!$profile_id) {
throw new ServerException("Can't save local profile");
}
$oprofile->uri = $homeuri;
$oprofile->feeduri = $feeduri;
$oprofile->salmonuri = $salmonuri;
- $oprofile->profile_id = $profile->id;
+ $oprofile->profile_id = $profile_id;
$oprofile->created = common_sql_now();
$oprofile->modified = common_sql_now();