cinnyapp / cinny

Yet another matrix client
https://cinny.in
GNU Affero General Public License v3.0
1.9k stars 246 forks source link

Display local time for 1on1 chats #620

Open SharkyRawr opened 2 years ago

SharkyRawr commented 2 years ago

Describe the problem

A friend just told me that they keep getting confused about what time of day it is in my timezone.

Describe the solution you'd like

Have an optional/configurable display of the local time for whomeever I'm chatting with. This will likely be most useful in 1on1 chats and I don't know if it is useful for group chats.

Alternatives considered

No response

Additional context

I glanced through the synapse spec and messages do contain a origin_server_ts but without timezone so this will likely need some kind of room state setup or support in Synapse/other servers.

Airyzz commented 2 years ago

Adding to this, I think it could be a useful feature to be able to insert dates and times in messages, which can then be automatically converted by the client to the local time.

For example, I can say:

'Lets talk at 8:00'

and my friend who is in a timezone an hour ahead of me would read

'Lets talk at 9:00'

Ideally, the time would be highlighted in some way to indicate that the message has changed, and you should be able to view the original message as well, I guess by hovering the mouse over highlighted timestamp

One interesting problem will be figuring out how to allow the user to insert these timestamps in a intuitive way. It would be nice to be able to automatically parse timestamps from messages before they are sent, and maybe attach some extra data to the message event about where to insert the timestamp. In this case, I think the message timestamp parser should also try to determine the format of the time string, so it can parse 8:00 to maybe HH:MM and 8:30:12 to HH:MM:SS, this way the users messages are changed as little as possible.

For more complicated times, such as 'January 1st, 1970, 12:00:00am' it might be necessary to create a date time picker, which can be used to insert the time instead, and a simple text formatting can be inserted in to the message, so other clients can still read the intended time, just without the conversion. Having a date time picker will also be useful for other languages, for which we might not have an implemented time parser.

Relevant: https://github.com/matrix-org/matrix-spec-proposals/pull/3160

kfiven commented 3 weeks ago

https://github.com/matrix-org/matrix-spec-proposals/pull/4133 seems to be good way to do this.

tcpipuk commented 3 weeks ago

In fact, https://github.com/matrix-org/matrix-spec-proposals/pull/4175 does exactly this, and is already in Element Web so I'd love to see more clients adopt it!