Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WhatsApp, Telegram] Channel Label #725

Closed
KrzysztofMadejski opened this issue Feb 19, 2019 · 5 comments
Closed

[WhatsApp, Telegram] Channel Label #725

KrzysztofMadejski opened this issue Feb 19, 2019 · 5 comments
Labels
enhancement New feature or request tengo
Milestone

Comments

@KrzysztofMadejski
Copy link
Contributor

Is your feature request related to a problem? Please describe.

Example image of the message relayed from WhatsApp to Slack:
whatsapp

Channel in case of WhatsApp and Telegram is a complex unique ID string, which doesn't look great when visualized.

I'm using a RemoteNickFormat="[{LABEL} #{CHANNEL}] @{NICK}" which results in [CfP #48111222333-1549986983@g.us] @Virus APP [10:45 AM] being shown as sender.

Problem is that

  1. it looks bad, and
  2. in case of WhatsApp, it reveals the creator's of the group phone number.

Describe the solution you'd like

What I'd love to have is an ability to set a channel label that would be used by {CHANNEL} instead of channel id when set.

Example config:

    [[gateway.inout]]
    account="whatsapp.cfall"
    channel="48111222333-1549986983@g.us"
    channelLabel = "Code for Pakistan"

That would result in above RemoteNickFormat to be formatted as [CfP #Code for Pakistan] @Virus APP [10:45 AM].

Describe alternatives you've considered
Not using {CHANNEL} in a RemoteNickFormat.

Additional context
The idea was born while implementing WhatsApp, see #711.

@qaisjp
Copy link
Collaborator

qaisjp commented Feb 19, 2019

The CHANNEL could probably just be the name of the WhatsApp group instead?

@KrzysztofMadejski
Copy link
Contributor Author

I don't think so. Group names are not unique in WhatsApp so we need unique channel ID.

@KrzysztofMadejski KrzysztofMadejski changed the title Channel Label [WhatsApp, Telegram] Channel Label Feb 21, 2019
@42wim 42wim added this to the 1.14.1 milestone Mar 2, 2019
@42wim 42wim added the enhancement New feature or request label Mar 2, 2019
@42wim 42wim modified the milestones: 1.14.1, 1.15.0 Mar 21, 2019
@42wim
Copy link
Owner

42wim commented Apr 8, 2019

@KrzysztofMadejski can you take a look at #793
This allows your own scripting for the RemoteNickFormat and could solve this issue.

@42wim 42wim added the tengo label May 19, 2019
@42wim
Copy link
Owner

42wim commented May 19, 2019

Can be fixed using tengo

Save below as myremotenickformat.tengo

if channel == "48111222333-1549986983@g.us" {
        result = "[CfP #Code for Pakistan] @"+nick
}

Add RemoteNickFormat="{TENGO}" to the specific bridge

and add the following in matterbridge.toml

[tengo]
RemoteNickFormat="myremotenickformat.tengo"

@42wim 42wim closed this as completed May 19, 2019
@ilmaisin
Copy link
Contributor

What is that tengo thing? Could there be a some sort of step-by-step instruction on how to extract the channel number?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request tengo
Projects
None yet
Development

No branches or pull requests

4 participants