Contacts with protocol = AP are now delivered only via AP

This commit is contained in:
Michael 2019-05-11 05:58:22 +00:00
parent 2a2b147758
commit 55557a8f18
3 changed files with 43 additions and 14 deletions

View file

@ -212,7 +212,7 @@ class Diaspora
*/
public static function participantsForThread($thread, array $contacts)
{
$r = DBA::p("SELECT `contact`.`batch`, `contact`.`id`, `contact`.`name`, `contact`.`network`,
$r = DBA::p("SELECT `contact`.`batch`, `contact`.`id`, `contact`.`name`, `contact`.`network`, `contact`.`protocol`,
`fcontact`.`batch` AS `fbatch`, `fcontact`.`network` AS `fnetwork` FROM `participation`
INNER JOIN `contact` ON `contact`.`id` = `participation`.`cid`
INNER JOIN `fcontact` ON `fcontact`.`id` = `participation`.`fid`
@ -224,6 +224,10 @@ class Diaspora
}
unset($contact['fnetwork']);
if (empty($contact['protocol'])) {
$contact['protocol'] = $contact['network'];
}
if (empty($contact['batch']) && !empty($contact['fbatch'])) {
$contact['batch'] = $contact['fbatch'];
}