Interface org.freedesktop.Telepathy.Connection.Interface.Location

Interface Index (Compact) | Summary | Description | Methods | Signals | Properties | Contact Attributes | Types

Methods

GetLocations (au: Contacts) a{ua{sv}}: Locations
RequestLocation (u: Contact) a{sv}: Location
SetLocation (a{sv}: Location) nothing
SetLocationAndControl (a{sv}: Location, u: Access_Control_Type, v: Access_Control_Detail) nothing

Signals

LocationUpdated (u: Contact, a{sv}: Location)
LocationAccessControlChanged (u: Type, v: Detail)

Properties

CanSetLocation b Read only
LocationAccessControlTypes au (Rich_Presence_Access_Control_Type_List) Read only
LocationAccessControl (uv) (Rich_Presence_Access_Control) Read/Write

Contact Attributes

org.freedesktop.Telepathy.Connection.Interface.Location/location a{sv} (Location)

Types

Location Mapping a{sv}
Contact_Locations Mapping a{ua{sv}}
Added in 0.17.27. (as stable API)
Objects implementing this interface must also implement:

Description

An interface on connections to support protocols which allow users to publish their current geographical location, and subscribe to the current location of their contacts.

This interface is geared strongly towards automatic propagation and use of this information, so focuses on latitude, longitude and altitude which can be determined by GPS, although provision is also included for an optional human-readable description of locations. All co-ordinate information is required to be relative to the WGS84 datum.

The information published through this interface is intended to have the same scope as presence information, so will normally be made available to those individuals on the user's "publish" contact list. Even so, user interfaces should not automatically publish location information without the consent of the user, and it is recommended that an option is made available to reduce the accuracy of the reported information to allow the user to maintain their privacy.

Location information is represented using the terminology of XMPP's XEP-0080 or the XEP-0080-derived Geoclue API where possible.

Methods

(Permalink)

GetLocations (au: Contacts) → a{ua{sv}}: Locations

Parameters

  • Contacts — au (Contact_Handle_List)
  • The contacts whose locations should be returned or signalled.

Returns

  • Locations — a{ua{sv}} (Contact_Locations)
  • The contacts' locations, if already known. Contacts whose locations are not already known are omitted from the mapping; contacts known to have no location information appear in the mapping with an empty Location dictionary.
Return the current locations of the given contacts, if they are already known. If any of the given contacts' locations are not known, request their current locations, but return immediately without waiting for a reply; if a reply with a non-empty location is later received for those contacts, the LocationUpdated signal will be emitted for them.
This method is appropriate for "lazy" location finding, for instance displaying the location (if available) of everyone in your contact list.

Possible Errors

  • Disconnected
  • The connection is not currently connected and cannot be used. This error may also be raised when operations are performed on a Connection for which StatusChanged has signalled status Disconnected for reason None.
    The second usage corresponds to None in the Connection_Status_Reason enum; if a better reason is available, the corresponding error should be used instead.
  • Invalid Handle
  • The handle specified is unknown on this channel or connection.
(Permalink)

RequestLocation (u: Contact) → a{sv}: Location

Parameters

  • Contact — u (Contact_Handle)
  • The contact whose location should be returned.

Returns

  • Location — a{sv} (Location)
  • The contact's location. It MAY be empty, indicating that no location information was found.
Return the current location of the given contact. If necessary, make a request to the server for up-to-date information, and wait for a reply.
This method is appropriate for use in a "Contact Information..." dialog; it can be used to show progress information (while waiting for the method to return), and can distinguish between various error conditions.

Possible Errors

  • Disconnected
  • The connection is not currently connected and cannot be used. This error may also be raised when operations are performed on a Connection for which StatusChanged has signalled status Disconnected for reason None.
    The second usage corresponds to None in the Connection_Status_Reason enum; if a better reason is available, the corresponding error should be used instead.
  • Network Error
  • Raised when there is an error reading from or writing to the network.
  • Invalid Handle
  • The handle specified is unknown on this channel or connection.
  • Permission Denied
  • The requested contact does not allow the local user to see their location information.
(Permalink)

SetLocation (a{sv}: Location) → nothing

Parameters

  • Location — a{sv}
  • The location to advertise, with the same semantics as the first parameter to SetLocationAndControl.
Set the local user's own location as if via SetLocationAndControl, but keep the current LocationAccessControl.

Possible Errors

  • Disconnected
  • The connection is not currently connected and cannot be used. This error may also be raised when operations are performed on a Connection for which StatusChanged has signalled status Disconnected for reason None.
    The second usage corresponds to None in the Connection_Status_Reason enum; if a better reason is available, the corresponding error should be used instead.
  • Not Implemented
  • Raised when the requested method, channel, etc is not available on this connection.
  • Permission Denied
  • The user is not permitted to perform the requested operation.
(Permalink)

SetLocationAndControl (a{sv}: Location, u: Access_Control_Type, v: Access_Control_Detail) → nothing

Added in 0.19.UNRELEASED.

Parameters

  • Location — a{sv}
  • The location to advertise. If the user wants to obscure their exact location by reducing the precision or accuracy, clients MUST do this themselves, rather than relying on the connection manager to do so. Clients that interact with more than one connection SHOULD advertise the same reduced-accuracy location to all of them, so that contacts cannot obtain an undesirably accurate location by assuming that random errors have been added and averaging the locations advertised on multiple connections.
  • Access_Control_Type — u (Rich_Presence_Access_Control_Type)
  • The access control mode to apply to the user's location, chosen from LocationAccessControlTypes.
  • Access_Control_Detail — v
  • Any additional information required by the Access_Control_Type; the required type and semantics are defined for each Rich_Presence_Access_Control_Type.

Set the local user's own location, and simultaneously set the access control to be applied to it.

Because the user's geographical location is sensitive information, clients that set it should ensure that an access control mode has been set. Setting both in the same call makes mistakes less likely.


Possible Errors

  • Disconnected
  • The connection is not currently connected and cannot be used. This error may also be raised when operations are performed on a Connection for which StatusChanged has signalled status Disconnected for reason None.
    The second usage corresponds to None in the Connection_Status_Reason enum; if a better reason is available, the corresponding error should be used instead.
  • Not Implemented
  • Raised when the requested method, channel, etc is not available on this connection.
  • Permission Denied
  • The user is not permitted to perform the requested operation.
  • Invalid Argument
  • Either the Access_Control_Type is not supported, or the Access_Control_Detail is not appropriate for it.

Signals

(Permalink)

LocationUpdated (u: Contact, a{sv}: Location)

Parameters

  • Contact — u (Contact_Handle)
  • The contact
  • Location — a{sv} (Location)
  • The contact's location, or empty to indicate that nothing is known about the contact's location.
Emitted when a contact's location changes or becomes known.
(Permalink)

LocationAccessControlChanged (u: Type, v: Detail)

Added in 0.19.UNRELEASED.

Parameters

Emitted when LocationAccessControl changes.

Properties

Accessed using the org.freedesktop.DBus.Properties interface.
(Permalink)

CanSetLocation — b

Read only

Whether SetLocation and SetLocationAndControl can be expected to work on this connection.

On XMPP, Location is advertised in a PEP node. If the user is connected to a server that doesn't support PEP (like Google Talk), they can't advertise their own location; however, the Location interface should still appear in Connection.Interfaces, since the user can still retrieve other contacts' locations.

The value of this property is undefined, and may change at any time without change notification, until the Connection.Status changes to CONNECTED. After the connection becomes connected, this property may not change.

On XMPP, you don't know what the server supports until you ask it. The definition of this property implies that implementations using XMPP will need to check whether the server supports PEP before moving to the CONNECTED state.

(Permalink)

LocationAccessControlTypes — au (Rich_Presence_Access_Control_Type_List)

Read only

The types of access control that are supported by this connection.

The value of this property is undefined, and may change at any time without change notification, until the Connection.Status changes to CONNECTED. After the connection becomes connected, this property may not change.

(Permalink)

LocationAccessControl — (uv) (Rich_Presence_Access_Control)

Read/Write

The current access control mechanism and settings for this connection. Before publishing location for the first time, if this has not been set by a client, implementations SHOULD set it to be as restrictive as possible (an empty whitelist, if supported).

Since version 0.19.UNRELEASED, clients can also set this property by calling SetLocationAndControl, and there is change notification via LocationAccessControlChanged.

Contact Attributes

Attributes that a contact can have, accessed with the org.freedesktop.Telepathy.Connection.Interface.Contacts interface.
(Permalink)

org.freedesktop.Telepathy.Connection.Interface.Location/location — a{sv} (Location)

The same mapping that would be returned by GetLocations for this contact. Omitted from the result if the contact's location is not known.

Types

Mapping (Permalink)

Location — a{sv}

A user's location, represented as an extensible mapping.
  • Key — s
  • Civic addresses are represented by the following well-known keys (all of which have string values), which should be kept in sync with those used in XEP-0080 and in the Geoclue project:

    • countrycode - s: an ISO-3166-1 alpha-2 (two-letter) country code, e.g. "us", "gb", "fr"
    • country - s: a country name in unspecified locale, e.g. "USA"
    • region - s: an administrative region of the nation, such as a state or province
    • locality - s: a locality within the administrative region, such as a town or city
    • area - s: a named area such as a campus or neighborhood
    • postalcode - s: a code used for postal delivery
    • street - s: a thoroughfare within the locality, or a crossing of two thoroughfares

    The following address keys are defined in XEP-0080 but not by Geoclue, and are also allowed:

    • building - s: a specific building on a street or in an area
    • floor - s: a particular floor in a building
    • room - s: a particular room in a building
    • text - s: any more specific information, e.g. "Northwest corner of the lobby"
    • description - s: A natural-language name for or description of the location, e.g. "Bill's house"
    • uri - s: a URI representing the location or pointing to more information about it

    Since the previous strings have data intended to be read by users, the language used should be stated using:

    • language - s: a specific language or locale of location information in a format compatible to RFC 4646. Note that UTF-8 is the only allowed encoding, e.g. "en" or "fr-CA".

    Positions are represented by the following well-known keys:

    • lat - d: latitude in decimal degrees north, -90 to +90, relative to the WGS-84 datum
      This is from XEP-0080; the XEP allows use of a different datum, but recommends this one. We enforce sanity by requiring a consistent datum: a minimal compliant implementation of this specification in terms of XEP-0080 would simply ignore the <lat> and <lon> elements if <datum> exists and has a value other than WGS-84, while an advanced implementation might correct for the different datum.
    • lon - d: Longitude in decimal degrees east, -180 to +180, relative to the WGS-84 datum
      Same rationale as 'lat'
    • alt - d: altitude in metres above sea level (negative if below sea level)
      This is from XEP-0080
    • accuracy - d: horizontal position error in metres if known
      This is from XEP-0080

    Velocities are represented by the following well-known keys:

    • speed - d: speed in metres per second
      This is from XEP-0080
    • bearing - d: direction of movement in decimal degrees, where North is 0 and East is 90
      This is from XEP-0080, and is equivalent to the struct field called "direction" in GeoClue

    Other well-known keys:

    • timestamp - x (Unix_Timestamp64): the time that the contact was at this location, in seconds since 1970-01-01T00:00:00Z (i.e. the beginning of 1970 in UTC)
      XEP-0080 uses an ISO 8601 string for this, but a number of seconds since the epoch is probably easier to work with.
  • Value — v
  • The value corresponding to the well-known key.
Mapping (Permalink)

Contact_Locations — a{ua{sv}}

A map from contacts to their locations.
  • Contact — u (Contact_Handle)
  • A contact
  • Location — a{sv} (Location)
  • The contact's location, which MAY be empty to indicate that the contact's location is unknown