get_public_key support application actor
This commit is contained in:
parent
e827221ee6
commit
35496f5026
1 changed files with 7 additions and 6 deletions
|
@ -17,14 +17,15 @@ class Signature {
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public static function get_public_key( $user_id, $force = false ) {
|
public static function get_public_key( $user_id, $force = false ) {
|
||||||
$key = \get_user_meta( $user_id, 'magic_sig_public_key' );
|
if ( $force ) {
|
||||||
|
self::generate_key_pair( $user_id );
|
||||||
if ( $key && ! $force ) {
|
|
||||||
return $key[0];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
self::generate_key_pair( $user_id );
|
if ( -1 === $user_id ) {
|
||||||
|
$key = array( \get_option('activitypub_magic_sig_public_key' ) );
|
||||||
|
} else {
|
||||||
$key = \get_user_meta( $user_id, 'magic_sig_public_key' );
|
$key = \get_user_meta( $user_id, 'magic_sig_public_key' );
|
||||||
|
}
|
||||||
|
|
||||||
return $key[0];
|
return $key[0];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue