RocketChat / Rocket.Chat

The communications platform that puts data protection first.
https://rocket.chat/
Other
40.27k stars 10.44k forks source link

Don't auto-link 10 digit numbers #810

Closed dbussert closed 8 years ago

dbussert commented 9 years ago

any 10 digit number typed in will be auto-linked as a telephone number. Chat should not assume a 10 digit number (with no hyphens even) is a telephone number. We post calculations and lat/lon, and it will pull out even part of a number and link it.

image

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

marceloschmidt commented 9 years ago

We use https://www.npmjs.com/package/autolinker and it does have an option for not parsing phone numbers. I just wonder if that should be the default behavior, an admin settings or a user settings. @RocketChat/owners what's your take on this?

marceloschmidt commented 9 years ago

@sampaiodiego @rodrigok @engelgabriel @Sing-Li @geekgonecrazy @gmsecrieru

geekgonecrazy commented 9 years ago

:) I'd think it'd be user specific. Cause it seems like that'd kinda be a personal preference

engelgabriel commented 9 years ago

Should be an admin settings for the default behavior and overwrittable by an user settings

geekgonecrazy commented 9 years ago

:+1: I like that.

rwakida commented 9 years ago

Too much configuration settings is overwhelming.

I think if the user wants to enter a phone number, they should either format it themselves or use a specific syntax that the autolinker understands to convert to a phone number. Like in GitHub how we type : +1: to specify :+1:

Also, if we auto format, then there has to be a way to specify the format. Or would we guess based on their locale?

dbussert commented 9 years ago

If the syntax specific for phone numbers was better, it would solve this specific issue. For a US number, it should only match 123-456-6789, not any 10 digits. I don't know how that library handles international numbers, but I believe everyone uses 1 or more dashes somewhere.

mitar commented 9 years ago

Those configuration settings is just for admins though. I think this is OK. Slack also has a lot of settings, but somehow it is good.

Why would parsing numbers be useful at all? Where do they point to?

engelgabriel commented 9 years ago

They would create the call... so if you have a softphone.. you can just click and it will dial. Skype can also dial phone number on web pages.

mitar commented 9 years ago

So I see it reasonable that this would be enabled by default for phone apps, but on desktop is probably strange default?

gmsecrieru commented 9 years ago

Update: Looks like this is affecting 8+ digits:

digits

LeonardOliveros commented 9 years ago

No results with disabling phone: false in the package / rocketchat-autolinker / autolinker.coffee still affecting more than 8 digits

LeonardOliveros commented 9 years ago

captura de pantalla de 2015-10-05 16 13 39 No results :(

richardwlu commented 8 years ago

:+1: Has there been any workaround or resolution for this?