ws仅加密对话消息

This commit is contained in:
kuaifan 2023-04-12 17:51:45 +08:00
parent 4024cfb7c7
commit 80dd76b078

View File

@ -205,11 +205,14 @@ class PushTask extends AbstractTask
{
$encrypt = Base::json2array(Cache::get("User::encrypt:" . $fid));
if ($encrypt['type'] == 'pgp') {
if (is_array($msg) && $msg['type'] == 'dialog') {
// 仅加密对话消息
$msg = [
'type' => 'encrypt',
'encrypted' => Doo::pgpEncryptApi($msg, $encrypt['key']),
];
}
}
return Base::array2json($msg);
}
}