Skip to content

Hiding the one-time pass code using style approach in Signal #598

@oleua

Description

@oleua

Hi! With the recent update in the bbernhard's Signal CLI REST API, dev branch it is possible to use styles:

**bold**
*italic*
`monospaced`
~stricken-through~ 
||this is a spoiler||

My suggestion is to hide the one-time passcode from unintended eyes by hiding it under the cut, so it will look like this:

image

A user will click on blurred rectangle and see it.

For that I've made a small workaround to the code:
lib/Provider/AProvider.php:

108 + $secret = '||'.$secret.'||'

and

lib/Service/Gateway/Signal/Gateway.php:

80                     $response = $client->post(
81                             $this->config->getUrl() . '/v2/send',
82                             [
83                                     'json' => [
84 +                                           'text_mode' => 'styled',
85                                             'message' => $message,
86                                             'number' => $registered_acct,
87                                             'recipients' => $recipient_acct
88                                              ],
89
90                             ]
91                     );

I understand that this is a workaround, and there should be a nicer solution, eg

  1. to detach $secret from the whole var $message
  2. to rewrite the Signal provider Gateway.php: apply styling to $secret and concatenate with the rest in $message.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions