ws仅加密对话消息

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

View File

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