GSConnect / gnome-shell-extension-gsconnect

KDE Connect implementation for GNOME
GNU General Public License v2.0
3.12k stars 254 forks source link

Number pattern in messaging #1760

Open InFerYes opened 4 months ago

InFerYes commented 4 months ago

Describe your request

I just noticed when messaging someone that the number pattern/format at the top is "xxx-xxx-xxxx". The pattern in my country is xxxx/xx.xx.xx. When flipping through my messages I noticed that sometimes this formatting is not applied, and never applied when the number has the country code (number starting with +). I thought the "xxx-xxx-xxxx" pattern was a bit grating, because it's odd to read.

Proposed solution

Customizable pattern or country-specific patterns based on country code/default country setting.

Alternatives

No response

GSConnect version

56

Installed from

GNOME Extensions website

GNOME Shell version

45.5

Linux distribution/release

Arch

Additional context

image

andyholmes commented 4 months ago

As far as I know, GSConnect applies no formatting to phone numbers. The only thing it does do is strip non-numeric characters for equality comparisons, but that doesn't modify the original string.

It's more likely the Android app is returning these strings and we're just passing them through as-is. Can you check the logs or the file in ~/.cache/gsconnect/<device ID>/sms.json?

InFerYes commented 4 months ago

I've been going through this file with grep on the address field, but none of the numbers appear to be formatted that way. One number in particular has an address starting with a country code but is formatted without the country code in messaging. Maybe I'm not looking in the right place, but I can't really post these online.

andyholmes commented 4 months ago

What ends up in the UI may be overridden by the provided contacts list (e.g. ~/.cache/gsconnect/<device ID>/contacts.json), but there again we just assume the phone is providing data in a format that makes sense for the device's configured locale.

We looked at libphonenumber once upon a time, but that turned out to be far more work than it was worth. I definitely wouldn't have written anything that added such formatting.