Changes:
- fixed wrong type-hint uid => int - added returned type-hint - added some documentation - formatted arrays a bit
This commit is contained in:
parent
5ec407699b
commit
37bda3e5fb
|
@ -39,13 +39,13 @@ class OpenWebAuthToken
|
||||||
* @return boolean
|
* @return boolean
|
||||||
* @throws \Exception
|
* @throws \Exception
|
||||||
*/
|
*/
|
||||||
public static function create(string $type, uid $uid, string $token, string $meta)
|
public static function create(string $type, int $uid, string $token, string $meta)
|
||||||
{
|
{
|
||||||
$fields = [
|
$fields = [
|
||||||
'type' => $type,
|
'type' => $type,
|
||||||
'uid' => $uid,
|
'uid' => $uid,
|
||||||
'token' => $token,
|
'token' => $token,
|
||||||
'meta' => $meta,
|
'meta' => $meta,
|
||||||
'created' => DateTimeFormat::utcNow()
|
'created' => DateTimeFormat::utcNow()
|
||||||
];
|
];
|
||||||
return DBA::insert('openwebauth-token', $fields);
|
return DBA::insert('openwebauth-token', $fields);
|
||||||
|
|
|
@ -67,6 +67,7 @@ class Receive extends BaseModule
|
||||||
/**
|
/**
|
||||||
* Receive a public Diaspora posting
|
* Receive a public Diaspora posting
|
||||||
*
|
*
|
||||||
|
* @return void
|
||||||
* @throws HTTPException\InternalServerErrorException
|
* @throws HTTPException\InternalServerErrorException
|
||||||
* @throws \ImagickException
|
* @throws \ImagickException
|
||||||
*/
|
*/
|
||||||
|
@ -84,6 +85,7 @@ class Receive extends BaseModule
|
||||||
/**
|
/**
|
||||||
* Receive a Diaspora posting for a user
|
* Receive a Diaspora posting for a user
|
||||||
*
|
*
|
||||||
|
* @return void
|
||||||
* @throws HTTPException\InternalServerErrorException
|
* @throws HTTPException\InternalServerErrorException
|
||||||
* @throws \ImagickException
|
* @throws \ImagickException
|
||||||
*/
|
*/
|
||||||
|
@ -127,7 +129,7 @@ class Receive extends BaseModule
|
||||||
* @throws HTTPException\InternalServerErrorException
|
* @throws HTTPException\InternalServerErrorException
|
||||||
* @throws \ImagickException
|
* @throws \ImagickException
|
||||||
*/
|
*/
|
||||||
private function decodePost(bool $public = true, string $privKey = '')
|
private function decodePost(bool $public = true, string $privKey = ''): array
|
||||||
{
|
{
|
||||||
if (empty($_POST['xml'])) {
|
if (empty($_POST['xml'])) {
|
||||||
|
|
||||||
|
|
|
@ -1357,15 +1357,15 @@ class Diaspora
|
||||||
}
|
}
|
||||||
|
|
||||||
$fields = [
|
$fields = [
|
||||||
'url' => $data['url'],
|
'url' => $data['url'],
|
||||||
'nurl' => Strings::normaliseLink($data['url']),
|
'nurl' => Strings::normaliseLink($data['url']),
|
||||||
'name' => $data['name'],
|
'name' => $data['name'],
|
||||||
'nick' => $data['nick'],
|
'nick' => $data['nick'],
|
||||||
'addr' => $data['addr'],
|
'addr' => $data['addr'],
|
||||||
'batch' => $data['batch'],
|
'batch' => $data['batch'],
|
||||||
'notify' => $data['notify'],
|
'notify' => $data['notify'],
|
||||||
'poll' => $data['poll'],
|
'poll' => $data['poll'],
|
||||||
'network' => $data['network']
|
'network' => $data['network'],
|
||||||
];
|
];
|
||||||
|
|
||||||
Contact::update($fields, ['addr' => $old_handle]);
|
Contact::update($fields, ['addr' => $old_handle]);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user