Give Webfinger response to group queries

This commit is contained in:
Mikael Nordfeldth
2016-06-25 20:13:19 +02:00
parent 3d6e25ee5f
commit d10ce6ac7c
3 changed files with 63 additions and 29 deletions

View File

@@ -140,6 +140,20 @@ class WebFingerPlugin extends Plugin
throw $e;
}
try {
common_debug(__METHOD__.': Finding User_group URI for WebFinger lookup on resource=='._ve($resource));
$group = new User_group();
$group->whereAddIn('uri', array_keys($alt_urls), $group->columnType('uri'));
$group->limit(1);
if ($group->find(true)) {
$profile = $group->getProfile();
}
unset($group);
} catch (Exception $e) {
common_log(LOG_ERR, get_class($e).': '._ve($e->getMessage()));
throw $e;
}
// User URI did not match, so let's try our alt_urls as Profile URL values
if (!$profile instanceof Profile) {
common_debug(__METHOD__.': Finding Profile URLs for WebFinger lookup on resource=='._ve($resource));