-
Couldn't load subscription status.
- Fork 413
MSC4175: Profile field for user time zone #4175
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
Changes from 8 commits
7340a2f
68105db
416bb7e
30701f0
1179248
99591dc
32f4ec6
0bcd686
401cfc8
8957878
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,127 @@ | ||
| # MSC4175: Profile field for user time zone | ||
|
|
||
| Knowing another user's time zone is useful for knowing whether they are likely | ||
| to respond or not. Example uses include: | ||
|
|
||
| * Showing a user's time zone or time zone offset directly. | ||
| * Showing a user's local time (with hints of whether it is day or night there). | ||
|
|
||
|
|
||
| ## Proposal | ||
|
|
||
| Profiles can provide an optional `m.tz` field with values equal to names from the | ||
| [IANA Time Zone Database](https://www.iana.org/time-zones). | ||
| Clients can set and fetch this via the [normal API endpoints](https://spec.matrix.org/v1.14/client-server-api/#profiles). | ||
|
|
||
| * Servers MAY validate that the value is a valid IANA time zone. If deemed invalid | ||
| they MUST return a 400 error with error code `M_INVALID_PARAM`. | ||
| * Clients MUST handle invalid or unknown values. One approach may be processing the value as though it was never set. | ||
|
|
||
| The rationale for somewhat loose validation is that different clients/servers may have | ||
| different understanding of valid time zones, e.g. different versions of the time zone | ||
| database. | ||
|
|
||
| If the field is not provided it SHOULD be interpreted as having no time zone information | ||
| for that user. | ||
|
|
||
|
|
||
| ## Potential issues | ||
|
|
||
| Clients may need to understand IANA time zone names to show useful information to users. | ||
clokep marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| Some languages make this easy, e.g. JavaScript can handle this using | ||
| [`Date.toLocaleString()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString). | ||
| This may cause clients to bundle the IANA time zone database (and thus also keep it | ||
| up to date). | ||
|
|
||
| Using the IANA time zone name has the downside that it does now allow arbitrary offsets, | ||
| which may be required for time zones which are not internationally recognized. | ||
|
|
||
| Clients will need to manually update the profile field when the user changes time zone. | ||
| This could be automated by clients based on location, or left as a manual change to | ||
| users. | ||
|
|
||
| Clients may wish to periodically fetch the time one of other users as it is | ||
clokep marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| liable to change somewhat frequently. Currently, profile data isn't propagated/synchronized | ||
| between servers, but that's left to a future MSC to solve. It is recommended that | ||
| clients cache the value for 12 - 24 hours. | ||
|
|
||
| There should not be backwards compatibility concerns since clients should be ignoring | ||
| unknown profile fields. | ||
|
|
||
|
|
||
| ## Alternatives | ||
|
|
||
| The time zone offset could be included directly (in minutes/seconds or in `[+-]HH:MM` form). | ||
| This would require clients to manually update the profile field during daylight | ||
| savings. Using the IANA time zone name is robust against this. | ||
|
|
||
|
|
||
| ### Delegate profile fields | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have to say i am quite uneasy about this MSC - it feels like a slippery slope towards bloating out the Matrix spec with an overlapping and incomplete implementation of JSContact (RFC9553). But on the other hand, RFC9553 simply doesn't contain a "current timezone for user" attribute - it's only available as an attribute on physical addresses. And RFC9553 is for describing addressbook entries... not profile information (which is subtly semantically different: the data you expect to see in your Contacts app in your phone is definitely different shape to the data you expect to see on someone's LinkedIin profile for instance). So perhaps the best bet here is to just bite the bullet and spec our own field types like this. But I really hope we end up finding a way to put them in their own registry rather than bulk out the rest of the spec - and to indirect to the likes of RFC9553 where we conceivably can. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This is the reason I let this sit for so long without pushing this harder after MSC4133 was merged. I'm not really sure how I feel about it but didn't see a better option, especially given there is no explicit time zone field in RFC9553 as you mention below. I was hoping other SCT members would shout if this seemed to go in the direction of NIH.
Agreed that it is different, much of the info overlaps as it is describing a person, but the context is different.
We could have a field contains a JScontact (or a link to one), but that's a bit beyond this MSC. I agree though that we should not redefine solved things. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ara4n Let me know if you want any updates for this or not, I'm unsure if the alternatives section should be fleshed out more? |
||
|
|
||
| There are several standards related to storing of contact information electronically, | ||
| notably vCard and its derivatives (see below). It is unclear if Matrix profile | ||
| information is similar enough to the contact information found in vCard to warrant using | ||
| that format directly, although there is certainly some overlap. | ||
|
|
||
| Some of the JSON formats for vCard which include time zone information are detailed below: | ||
|
|
||
| [RFC7095: jCard The JSON Format for vCard](https://datatracker.ietf.org/doc/html/rfc7095) | ||
| format could be used instead, but this doesn't make much sense unless the entire | ||
| profile was replaced. | ||
|
|
||
| [RFC9553](https://datatracker.ietf.org/doc/html/rfc9553) offers an alternative | ||
| representation for contacts (which is not backwards compatible with vCard). There | ||
| exists `timeZone` field under the `addresses` field which uses an time zone name | ||
| from the IANA Time Zone Database. | ||
|
|
||
| Note there's an alternative [jCard](https://microformats.org/wiki/jCard) format | ||
| which is a non-standard derivative of [hCard](https://microformats.org/wiki/hcard). | ||
|
|
||
|
|
||
| ### Competitive analysis | ||
|
|
||
| Slack's [`users.info` API call](https://api.slack.com/methods/users.info) includes | ||
| 3 separate fields: | ||
|
|
||
| * `tz`: the time zone database name (e.g. `"America/New_York"`) | ||
| * `tz_label`: a friendly name (e.g. `"Eastern Daylight Time"`) | ||
| * `tz_offset`: offset in seconds as an integer (e.g. `-14400`) | ||
|
|
||
| XMPP uses either: | ||
|
|
||
| * [XEP-054](https://xmpp.org/extensions/xep-0054.html) uses vCard | ||
| ([RFC2426](https://datatracker.ietf.org/doc/html/rfc2426)) converted to XML via | ||
| [draft-dawson-vcard-xml-dtd-01](https://datatracker.ietf.org/doc/html/draft-dawson-vcard-xml-dtd-01) | ||
| * [XEP-0292](https://xmpp.org/extensions/xep-0292.html) uses xCard: vCard XML Representation | ||
| ([RFC6351](https://datatracker.ietf.org/doc/html/rfc6351)), see also vCard4 | ||
| ([RFC6351](https://datatracker.ietf.org/doc/html/rfc6351)) | ||
|
|
||
| Rocket.Chat provides a user's [time zone offset](https://developer.rocket.chat/docs/user) | ||
| in the `utcOffset` field. | ||
|
|
||
| Mattermost [returns an object](https://api.mattermost.com/#tag/users/operation/GetUser) | ||
| with the user's manual and/or automatic IANA time zone name. | ||
|
|
||
| Discord, Twitter, and IRC don't provide a user's time zone. | ||
|
|
||
|
|
||
| ## Security considerations | ||
|
|
||
| Showing a user's time zone gives some information to their location. There is currently | ||
| no way to limit what profile fields other users can see. | ||
clokep marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| Clients may wish to warn users when providing a timezone and give | ||
| the option to not include it in their profile. | ||
|
|
||
|
|
||
| ## Unstable prefix | ||
|
|
||
| `us.cloke.msc4175.tz` should be used in place of `m.tz`. | ||
|
|
||
| Clients may immediately use the stable profile field once this MSC is accepted. This is | ||
| a client-to-client protocol and no feature negotiation is necessary. | ||
|
|
||
|
|
||
| ## Dependencies | ||
|
|
||
| Requires [MSC4133](https://github.com/matrix-org/matrix-spec-proposals/pull/4133). | ||
Uh oh!
There was an error while loading. Please reload this page.