With KDE Itinerary gaining the option to share locations via the Matrix protocol, we had to make sure KDE’s own Matrix client NeoChat can actually properly handle this as well.

Matrix location sharing

Besides chat messages, files, and a bunch of other content the Matrix protocol also allows to exchange locations. There’s two ways to do that:

  • A static location. That’s most similar to a regular chat message, just that it’s a geo coordinate instead of text. It’s a singular event in a room timeline.
  • A live location. That’s a location that is continuously updated, e.g. based on the user’s GPS position. That’s an entire stream of events that the Matrix client accumulates and displays very similar to a static location, just that the map marker is now moving. Internally this is much less similar than it looks in the UI though. Two sub-variants of live location sharing exist, with and without history.

Most of this is only at the edge of being integrated into the official Matrix protocol specification though and exists as “Matrix Spec Change (MSC)” proposals. MSC 3488, MSC 3672 and MSC 3489 are the relevant ones here if you want to dig into the details.

Nevertheless Matrix clients like Element and NeoChat have implemented some of this already. And so does Itinerary, which can share both static and live location data.

Itinerary's location action context menu offering to share a location via Matrix.
Matrix location sharing action in Itinerary.

Showing shared locations

Showing static locations in NeoChat was added by Tobias in March already, and it’s what all the following work is based on.

NeoChat showing a map with a location shared from the corresponding event reservation in Itinerary.
NeoChat showing a location shared from Itinerary.

As of recently we can also show live locations in the same way, with the map marker being grayed out when the sharing is no longer live.

Maps embedded in the timeline are rather small, a change allowing to expand them to full screen by tapping on them has just been merged, similar to how shared images behave as well.

Room-wide map

All this basically matches what other Matrix clients have as well, but more is possible.

If a room has multiple locations shared we can also show those on a single map. Say you travel with a group and people shared various points of interest this allows you to easily see where all of those are. Or you are trying to meet with multiple people in an unknown city, and everyone is sharing their current position.

NeoChat showing a map with multiple locations shared in the currently selected room.
NeoChat showing a map with all locations shared in the current room.

The corresponding changes have landed yesterday as well.

More location metadata

All of the above is so far limited to a geographic coordinate and two icon variants (pin or avatar of the sender). This could be a lot more useful with additional information about the location though. Speed and heading for live locations for example, or the type of a static location (e.g. hotel, event venue, restaurant, etc).

You can convey all that manually in the text chat of course, but if we had this in structured/machine readable form it could be properly shown on the map as well, instead of just having a bunch of nondescript pins there.

We do have all that information in Itinerary. Fortunately extending Matrix messages is trivial (just add more fields to their JSON payload), so it should be easy to share it from there and experiment with what can be done with it on the NeoChat side then.

In case you are interested in this, join us in the NeoChat or Itinerary matrix channels and share your ideas!

See you at Akademy!

One big group travel is coming up in a few weeks, KDE Akademy in Thessaloniki, Greece, which should provide plenty of opportunities for field-testing :)

I'm going to Akademy 2023!

There’s also a talk in the conference program about using the Matrix protocol for this kind of cross-application integration, by Alexey, Carl and Tobias.