Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion lib/Provider/Channel/Signal/Gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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) {
Expand Down
Loading