diff --git a/lib/Provider/Channel/Signal/Gateway.php b/lib/Provider/Channel/Signal/Gateway.php index b729d6bf..a6dc1702 100644 --- a/lib/Provider/Channel/Signal/Gateway.php +++ b/lib/Provider/Channel/Signal/Gateway.php @@ -76,6 +76,10 @@ public function createSettings(): Settings { #[\Override] public function send(string $identifier, string $message, array $extra = []): void { $client = $this->clientService->newClient(); + + // look for 6 digits to hide the OTP code in the message + $message = preg_replace('/(\d{6})/', '||$1||', $message); + // determine type of gateway // test for native signal-cli JSON RPC. @@ -138,7 +142,8 @@ public function send(string $identifier, string $message, array $extra = []): vo $json = [ // signal-cli-rest-api v2 expects recipients as a string array. 'recipients' => [$identifier], - 'message' => $message, + 'message' => $message, // add styling + 'text_mode' => 'styled', ]; $account = $this->getAccount(); if ($account != self::ACCOUNT_UNNECESSARY) {