Merge pull request #7791 from annando/more-warnings

Some more warnings removed
This commit is contained in:
Tobias Diekershoff 2019-10-31 10:06:15 +01:00 committed by GitHub
commit bc18cde412
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 12 deletions

View file

@ -809,14 +809,11 @@ class GContact
return;
}
// When the profile doesn't have got a feed, then we exit here
if (empty($data['poll'])) {
return;
}
if ($data['network'] == Protocol::ACTIVITYPUB) {
if (!empty($data['outbox'])) {
self::updateFromOutbox($data['outbox'], $data);
} elseif (!empty($data['poll']) && ($data['network'] == Protocol::ACTIVITYPUB)) {
self::updateFromOutbox($data['poll'], $data);
} else {
} elseif (!empty($data['poll'])) {
self::updateFromFeed($data);
}
}
@ -885,10 +882,17 @@ class GContact
}
$last_updated = '';
foreach ($items as $activity) {
if ($last_updated < $activity['published']) {
$last_updated = $activity['published'];
if (!empty($activity['published'])) {
$published = DateTimeFormat::utc($activity['published']);
} elseif (!empty($activity['object']['published'])) {
$published = DateTimeFormat::utc($activity['object']['published']);
} else {
continue;
}
if ($last_updated < $published) {
$last_updated = $published;
}
}

View file

@ -176,7 +176,7 @@ class Diaspora
* @return array with the contact
* @throws \Exception
*/
private static function getRelayContact(string $server_url, array $fields = ['batch', 'id', 'name', 'network', 'protocol', 'archive', 'blocked'])
private static function getRelayContact(string $server_url, array $fields = ['batch', 'id', 'url', 'name', 'network', 'protocol', 'archive', 'blocked'])
{
// Fetch the relay contact
$condition = ['uid' => 0, 'nurl' => Strings::normaliseLink($server_url),
@ -250,7 +250,7 @@ class Diaspora
*/
public static function participantsForThread($thread, array $contacts)
{
$r = DBA::p("SELECT `contact`.`batch`, `contact`.`id`, `contact`.`name`, `contact`.`network`, `contact`.`protocol`,
$r = DBA::p("SELECT `contact`.`batch`, `contact`.`id`, `contact`.`url`, `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`

View file

@ -404,6 +404,7 @@ class Notifier
"SELECT
`batch`,
ANY_VALUE(`id`) AS `id`,
ANY_VALUE(`url`) AS `url`,
ANY_VALUE(`name`) AS `name`,
ANY_VALUE(`network`) AS `network`,
ANY_VALUE(`protocol`) AS `protocol`