1
1
Fork 0

We now use a central function to fetch the importer (#5636)

This commit is contained in:
Michael Vogel 2018-08-19 15:37:56 +02:00 committed by Hypolite Petovan
commit c1da44b7dc
4 changed files with 88 additions and 109 deletions

View file

@ -264,23 +264,10 @@ function consume_feed($xml, array $importer, array $contact, &$hub, $datedir = 0
if ($contact['network'] === Protocol::DFRN) {
logger("Consume DFRN messages", LOGGER_DEBUG);
$r = q("SELECT `contact`.*, `contact`.`uid` AS `importer_uid`,
`contact`.`pubkey` AS `cpubkey`,
`contact`.`prvkey` AS `cprvkey`,
`contact`.`thumb` AS `thumb`,
`contact`.`url` as `url`,
`contact`.`name` as `senderName`,
`user`.*
FROM `contact`
LEFT JOIN `user` ON `contact`.`uid` = `user`.`uid`
WHERE `contact`.`id` = %d AND `user`.`uid` = %d",
DBA::escape($contact["id"]), DBA::escape($importer["uid"])
);
if (DBA::isResult($r)) {
$dfrn_importer = DFRN::getImporter($contact["id"], $importer["uid"]);
if (!empty($dfrn_importer)) {
logger("Now import the DFRN feed");
DFRN::import($xml, $r[0], true);
DFRN::import($xml, $dfrn_importer, true);
return;
}
}