mirror of
https://github.com/friendica/friendica
synced 2025-04-26 21:10:16 +00:00
Centralize owner data fetch
This commit is contained in:
parent
e37cf8fea2
commit
df02238659
3 changed files with 36 additions and 31 deletions
|
@ -10,6 +10,7 @@ use Friendica\Core\System;
|
|||
use Friendica\Core\Config;
|
||||
use Friendica\Database\DBM;
|
||||
use Friendica\Model\Contact;
|
||||
use Friendica\Model\User;
|
||||
use Friendica\Protocol\Diaspora;
|
||||
use Friendica\Protocol\DFRN;
|
||||
use Friendica\Protocol\Email;
|
||||
|
@ -140,20 +141,11 @@ class Delivery {
|
|||
}
|
||||
}
|
||||
|
||||
$r = q("SELECT `contact`.*, `user`.`prvkey` AS `uprvkey`,
|
||||
`user`.`timezone`, `user`.`nickname`, `user`.`sprvkey`, `user`.`spubkey`,
|
||||
`user`.`page-flags`, `user`.`account-type`, `user`.`prvnets`
|
||||
FROM `contact` INNER JOIN `user` ON `user`.`uid` = `contact`.`uid`
|
||||
WHERE `contact`.`uid` = %d AND `contact`.`self` = 1 LIMIT 1",
|
||||
intval($uid)
|
||||
);
|
||||
|
||||
if (!DBM::is_result($r)) {
|
||||
$owner = User::getOwnerDataById($uid);
|
||||
if (!$owner) {
|
||||
return;
|
||||
}
|
||||
|
||||
$owner = $r[0];
|
||||
|
||||
$walltowall = (($top_level && ($owner['id'] != $items[0]['contact-id'])) ? true : false);
|
||||
|
||||
$public_message = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue