mirror of
https://github.com/friendica/friendica
synced 2025-04-27 17:50:17 +00:00
Simplified signature creation
This commit is contained in:
parent
a26a2a0228
commit
835152d418
2 changed files with 14 additions and 9 deletions
|
@ -4044,14 +4044,25 @@ class Diaspora
|
|||
/**
|
||||
* Creates the signature for Comments that are created on our system
|
||||
*
|
||||
* @param integer $uid The user of that comment
|
||||
* @param array $item Item array
|
||||
*
|
||||
* @return array Signed content
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function createCommentSignature($uid, array $item)
|
||||
public static function createCommentSignature(array $item)
|
||||
{
|
||||
$contact = Contact::getById($item['author-id'], ['url']);
|
||||
if (empty($contact['url'])) {
|
||||
Logger::warning('Author Contact not found', ['author-id' => $item['author-id']]);
|
||||
return false;
|
||||
}
|
||||
|
||||
$uid = User::getIdForURL($contact['url']);
|
||||
if (empty($uid)) {
|
||||
Logger::info('No owner post, so not storing signature', ['url' => $contact['url']]);
|
||||
return false;
|
||||
}
|
||||
|
||||
$owner = User::getOwnerDataById($uid);
|
||||
if (empty($owner)) {
|
||||
Logger::info('No owner post, so not storing signature');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue