'owner-id' => $owner_id, 'private' => $private, 'psid' => $psid];
self::update($fields, ['id' => $item_id]);
- self::updateThread($item_id);
-
Worker::add(['priority' => PRIORITY_HIGH, 'dont_fork' => true], 'Notifier', Delivery::POST, $item_id);
/// @todo This code should be activated by the end of the year 2020
$fields = ['uid', 'guid', 'created', 'edited', 'commented', 'received', 'changed', 'post-type',
'wall', 'private', 'pubmail', 'moderated', 'visible', 'starred', 'contact-id', 'uri-id',
'deleted', 'origin', 'forum_mode', 'network', 'author-id', 'owner-id'];
- $condition = ["`id` = ? AND (`parent` = ? OR `parent` = 0)", $itemid, $itemid];
- $item = self::selectFirst($fields, $condition);
+ $item = self::selectFirst($fields, ['id' => $itemid, 'gravity' => GRAVITY_PARENT]);
if (!DBA::isResult($item)) {
return;
}
}
}
- $profile = self::getByNickname($nickname, $user['uid']);
+ $profile = User::getOwnerDataById($user['uid'], false);
if (empty($profile) && empty($profiledata)) {
Logger::log('profile error: ' . DI::args()->getQueryString(), Logger::DEBUG);
* @}
*/
+ private static $owner;
+
/**
* Returns true if a user record exists with the provided id
*
*/
public static function getOwnerDataById($uid, $check_valid = true)
{
+ if (!empty(self::$owner)) {
+ return self::$owner;
+ }
+
$owner = DBA::selectFirst('owner-view', [], ['uid' => $uid]);
if (!DBA::isResult($owner)) {
if (!DBA::exists('user', ['uid' => $uid]) || !$check_valid) {
$owner = self::getOwnerDataById($uid, false);
}
+ self::$owner = $owner;
return $owner;
}
"dfrn-id" => ["dfrn-id(64)"],
"issued-id" => ["issued-id(64)"],
"network_uid_lastupdate" => ["network", "uid", "last-update"],
- "uid_lastitem" => ["uid", "last-item"],
+ "uid_lastitem" => ["uid", "last-item"],
"gsid" => ["gsid"]
]
],
"resource-id" => ["resource-id"],
"deleted_changed" => ["deleted", "changed"],
"uid_wall_changed" => ["uid", "wall", "changed"],
+ "uid_unseen_wall" => ["uid", "unseen", "wall"],
"mention_uid_id" => ["mention", "uid", "id"],
"uid_eventid" => ["uid", "event-id"],
"icid" => ["icid"],
"account_removed" => ["user", "account_removed"],
"account_expired" => ["user", "account_expired"],
"account_expires_on" => ["user", "account_expires_on"],
- "expire_notification_sent" => ["user", "expire_notification_sent"],
+ "expire_notification_sent" => ["user", "expire_notification_sent"],
"def_gid" => ["user", "def_gid"],
"allow_cid" => ["user", "allow_cid"],
"allow_gid" => ["user", "allow_gid"],