get_public_key support application actor

This commit is contained in:
Django Doucet 2023-05-05 12:52:24 -06:00
parent e827221ee6
commit 35496f5026

View file

@ -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 = \get_user_meta( $user_id, 'magic_sig_public_key' ); $key = array( \get_option('activitypub_magic_sig_public_key' ) );
} else {
$key = \get_user_meta( $user_id, 'magic_sig_public_key' );
}
return $key[0]; return $key[0];
} }