mirror of
https://github.com/friendica/friendica
synced 2025-05-08 08:24:10 +02:00
Remove unused upubkey and uprvkey from queries
- Switched queries to new dba::* functions
This commit is contained in:
parent
ec6f5193e2
commit
2196a0577b
8 changed files with 49 additions and 43 deletions
|
@ -140,7 +140,7 @@ class Delivery {
|
|||
}
|
||||
}
|
||||
|
||||
$r = q("SELECT `contact`.*, `user`.`pubkey` AS `upubkey`, `user`.`prvkey` AS `uprvkey`,
|
||||
$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`
|
||||
|
|
|
@ -108,7 +108,7 @@ class Notifier {
|
|||
$recipients[] = $suggest[0]['cid'];
|
||||
$item = $suggest[0];
|
||||
} elseif ($cmd === 'removeme') {
|
||||
$r = q("SELECT `contact`.*, `user`.`pubkey` AS `upubkey`, `user`.`prvkey` AS `uprvkey`,
|
||||
$r = q("SELECT `contact`.*, `user`.`prvkey` AS `uprvkey`,
|
||||
`user`.`timezone`, `user`.`nickname`, `user`.`sprvkey`, `user`.`spubkey`,
|
||||
`user`.`page-flags`, `user`.`prvnets`, `user`.`account-type`, `user`.`guid`
|
||||
FROM `contact` INNER JOIN `user` ON `user`.`uid` = `contact`.`uid`
|
||||
|
@ -173,7 +173,7 @@ class Notifier {
|
|||
|
||||
}
|
||||
|
||||
$r = q("SELECT `contact`.*, `user`.`pubkey` AS `upubkey`, `user`.`prvkey` AS `uprvkey`,
|
||||
$r = q("SELECT `contact`.*, `user`.`prvkey` AS `uprvkey`,
|
||||
`user`.`timezone`, `user`.`nickname`, `user`.`sprvkey`, `user`.`spubkey`,
|
||||
`user`.`page-flags`, `user`.`prvnets`, `user`.`account-type`
|
||||
FROM `contact` INNER JOIN `user` ON `user`.`uid` = `contact`.`uid`
|
||||
|
|
|
@ -80,33 +80,29 @@ class Queue
|
|||
|
||||
$q_item = $r[0];
|
||||
|
||||
$c = q(
|
||||
"SELECT * FROM `contact` WHERE `id` = %d LIMIT 1",
|
||||
intval($q_item['cid'])
|
||||
);
|
||||
|
||||
if (!DBM::is_result($c)) {
|
||||
$contact = dba::select('contact', [], ['id' => intval($q_item['cid'])], ['limit' => 1]);
|
||||
if (!DBM::is_result($contact)) {
|
||||
remove_queue_item($q_item['id']);
|
||||
return;
|
||||
}
|
||||
|
||||
$dead = Cache::get($cachekey_deadguy . $c[0]['notify']);
|
||||
$dead = Cache::get($cachekey_deadguy . $contact['notify']);
|
||||
|
||||
if (!is_null($dead) && $dead) {
|
||||
logger('queue: skipping known dead url: ' . $c[0]['notify']);
|
||||
logger('queue: skipping known dead url: ' . $contact['notify']);
|
||||
update_queue_time($q_item['id']);
|
||||
return;
|
||||
}
|
||||
|
||||
$server = PortableContact::detectServer($c[0]['url']);
|
||||
$server = PortableContact::detectServer($contact['url']);
|
||||
|
||||
if ($server != "") {
|
||||
$vital = Cache::get($cachekey_server . $server);
|
||||
|
||||
if (is_null($vital)) {
|
||||
logger("Check server " . $server . " (" . $c[0]["network"] . ")");
|
||||
logger("Check server " . $server . " (" . $contact["network"] . ")");
|
||||
|
||||
$vital = PortableContact::checkServer($server, $c[0]["network"], true);
|
||||
$vital = PortableContact::checkServer($server, $contact["network"], true);
|
||||
Cache::set($cachekey_server . $server, $vital, CACHE_QUARTER_HOUR);
|
||||
}
|
||||
|
||||
|
@ -117,12 +113,8 @@ class Queue
|
|||
}
|
||||
}
|
||||
|
||||
$u = q(
|
||||
"SELECT `user`.*, `user`.`pubkey` AS `upubkey`, `user`.`prvkey` AS `uprvkey`
|
||||
FROM `user` WHERE `uid` = %d LIMIT 1",
|
||||
intval($c[0]['uid'])
|
||||
);
|
||||
if (!DBM::is_result($u)) {
|
||||
$user = dba::select('user', [], ['uid' => intval($contact['uid'])], ['limit' => 1]);
|
||||
if (!DBM::is_result($user)) {
|
||||
remove_queue_item($q_item['id']);
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue