Methods
RequestContactList | (as: Interfaces, b: Hold) | → | a{ua{sv}}: Attributes | |
RequestSubscription | (au: Contacts, s: Message) | → | nothing | |
AuthorizePublication | (au: Contacts) | → | nothing | |
RemoveContacts | (au: Contacts) | → | nothing | |
Unsubscribe | (au: Contacts) | → | nothing | |
Unpublish | (au: Contacts) | → | nothing |
Signals
ContactsChanged | (a{u(uus)}: Changes, au: Removals) |
Properties
SubscriptionsPersist | b | Read only | |
CanChangeSubscriptions | b | Read only | |
RequestUsesMessage | b | Read only |
Contact Attributes
Types
Presence_State | Enum | u | |
Contact_Metadata_Storage_Type | Enum | u | |
Contact_Subscription_Map | Mapping | a{u(uus)} | |
Contact_Subscriptions | Struct | (uus) |
Description
An interface for connections that have any concept of a list of known contacts (roster, buddy list, friends list etc.)
Rationale:
The list of contacts is not exposed as a D-Bus property; it can be fetched using RequestContactList.
Rationale:
Methods
RequestContactList (as: Interfaces, b: Hold) → a{ua{sv}}: Attributes
Parameters
- Interfaces — as (DBus_Interface_List)
- Hold — b
A list of strings indicating which D-Bus interfaces the calling process is interested in. Equivalent to the corresponding argument to GetContactAttributes, except that if this list does not contain the ContactList interface itself, it is treated as though that interface was also requested.
Whether to hold the handles on behalf of the calling process. Equivalent to the corresponding argument to GetContactAttributes.
FIXME: if we do distributed refcounting, we should probably rename this to 'Reference' and implement handle-refcounting semantics first? On the other hand, if we make handles persist for the lifetime of the connection, we can just remove this parameter.
Returns
- Attributes — a{ua{sv}} (Contact_Attributes_Map)
A dictionary mapping the contact handles to contact attributes, equivalent to the result of GetContactAttributes.
Return some contact attributes for a list of contacts somehow associated with the user.
This definition is deliberately vague: in practice, most user interfaces should display some subset of this list, by filtering it by some contact attributes (for instance, displaying all contacts whose "subscribe" attribute is Yes is expected to be a common case). This list MAY contain any contacts whatsoever, but MUST contain at least the following:
- all contacts whose "subscribe" attribute is Ask or Yes
- all contacts whose "publish" attribute is Ask or Yes
- all contacts with a persistently-stored stored alias, if supported
- all contacts in user-defined contact groups, if supported
This list does not need to contain every visible contact: for instance, contacts seen in XMPP or IRC chatrooms SHOULD NOT appear here. Blocked contacts SHOULD NOT appear here either, unless they are still stored in a persistent roster/contact list as well as being blocked.
Rationale:
This method SHOULD NOT return before the contact list has been retrieved, on protocols where this is possible. As a result, clients SHOULD use a longer-than-default timeout for this method call, since retrieving the contact list can take a significant time on some servers.
Rationale:
Possible Errors
- Disconnected
Rationale:
RequestSubscription (au: Contacts, s: Message) → nothing
Parameters
- Contacts — au (Contact_Handle_List)
- Message — s
One or more contacts to whom requests are to be sent.
An optional plain-text message from the user, to send to those contacts with the subscription request. The RequestUsesMessage property indicates whether this message will be used or ignored.
Clients SHOULD NOT send a non-empty message without first giving the user an opportunity to edit it.
Rationale:
Connections where this message is not useful MUST still allow it to be non-empty.
Request that the given contacts allow the local user to subscribe to their presence, i.e. that their subscribe attribute becomes Yes.
Before calling this method on a connection where GetAliasFlags returns the User_Set
flag,
user interfaces SHOULD obtain, from the user, an alias to
identify the contact in future, and store it using SetAliases.
The user MAY be
prompted using the contact's current self-assigned nickname, or
something derived from the contact's (presumably self-assigned)
identifier, as a default, but these names chosen by the contact
SHOULD NOT be used without user approval.
Rationale:
For contacts with subscribe=Yes, this method has no effect. It MUST return successfully if all contacts are in this state.
For contacts with subscribe=Ask, this method SHOULD send a new request, with the given message, if allowed by the underlying protocol.
For contacts with subscribe=No, this method SHOULD request that the contact allows the local user to subscribe to their presence; in general, this will change their publish attribute from No to Ask (although it could change directly from No to Yes in some situations).
Any state changes that immediately result from this request MUST be signalled via ContactsChanged before this method returns.
Rationale:
If the remote contact accepts the request, their subscribe attribute will later change from Ask to Yes; if they explicitly reject the request (in protocols that allow this), their subscribe attribute will later change from Ask to No.
Possible Errors
- Disconnected
- Invalid Handle
- Network Error
- Not Implemented
Rationale:
AuthorizePublication (au: Contacts) → nothing
Parameters
- Contacts — au (Contact_Handle_List)
One or more contacts to authorize.
For each of the given contacts, request that the local user's presence is sent to that contact, i.e. that their publish attribute becomes Yes.
For contacts with publish=Yes, this method has no effect; it MUST return successfully if all contacts given have this state.
For contacts with publish=Ask, this method accepts the contact's request to see the local user's presence, changing their publish attribute from Ask to Yes.
For contacts with publish=No, if the protocol allows it, this method allows the contacts to see the local user's presence even though they have not requested it, changing their publish attribute from No to Yes. Otherwise, it merely records the fact that presence publication to those contacts is allowed; if any of those contacts ask to receive the local user's presence later in the lifetime of the connection, the connection SHOULD immediately allow them to do so, changing their publish attribute directly from No to Yes.
Rationale:
Any state changes that immediately result from this request MUST be signalled via ContactsChanged before this method returns.
Rationale:
Possible Errors
- Disconnected
- Invalid Handle
- Network Error
- Not Implemented
Rationale:
RemoveContacts (au: Contacts) → nothing
Parameters
- Contacts — au (Contact_Handle_List)
One or more contacts to remove.
Remove the given contacts from the contact list entirely. It is protocol-dependent whether this works, and under which circumstances.
If possible, this method SHOULD set the contacts' subscribe and publish attributes to No, remove any stored aliases for those contacts, and remove the contacts from the result of RequestContactList.
This method SHOULD succeed even if it was not possible to carry out the request entirely or for all contacts (for instance, if there is an outstanding request to subscribe to the contact's presence, and it's not possible to cancel such requests). However, all signals that immediately result from this method call MUST be emitted before it returns, so that clients can interpret the result.
Rationale:
Possible Errors
- Disconnected
- Invalid Handle
- Network Error
- Not Implemented
Rationale:
Unsubscribe (au: Contacts) → nothing
Parameters
- Contacts — au (Contact_Handle_List)
One or more contacts to remove.
Attempt to set the given contacts' subscribe attribute to No, i.e. stop receiving their presence.
For contacts with subscribe=Ask, this attempts to cancel an earlier request to subscribe to the contact's presence; for contacts with subscribe=Yes, this attempts to unsubscribe from the contact's presence.
As with RemoveContacts, this method SHOULD succeed even if it was not possible to carry out the request entirely or for all contacts; however, all signals that immediately result from this method call MUST be emitted before it returns.
Possible Errors
- Disconnected
- Invalid Handle
- Network Error
- Not Implemented
Rationale:
Unpublish (au: Contacts) → nothing
Parameters
- Contacts — au (Contact_Handle_List)
One or more contacts to remove.
Attempt to set the given contacts' publish attribute to No, i.e. stop sending presence to them.
For contacts with publish=Ask, this method explicitly rejects the contact's request to subscribe to the user's presence; for contacts with publish=Yes, this method attempts to prevent the user's presence from being received by the contact.
As with RemoveContacts, this method SHOULD succeed even if it was not possible to carry out the request entirely or for all contacts; however, all signals that immediately result from this method call MUST be emitted before it returns.
Possible Errors
- Disconnected
- Invalid Handle
- Network Error
- Not Implemented
Rationale:
Signals
ContactsChanged (a{u(uus)}: Changes, au: Removals)
Parameters
- Changes — a{u(uus)} (Contact_Subscription_Map)
- Removals — au (Contact_Handle_List)
Emitted when the contact list becomes available, when contacts' basic stored properties change, when new contacts are added to the list that would be returned by RequestContactList, or when contacts are removed from that list.
Rationale:
Properties
SubscriptionsPersist — b
If true, presence subscriptions (in both directions) on this connection are stored by the server or other infrastructure.
Rationale:
If false, presence subscriptions on this connection are not stored.
Rationale:
If CanChangeSubscriptions is true, Telepathy clients (e.g. user interfaces or address books) MAY keep a record of permission to publish and requests to subscribe locally, and attempt to restore it for each Connection. If SubscriptionsPersist is false, clients MAY do this for all contacts; if SubscriptionsPersist is true, clients SHOULD NOT change the state of contacts that were not changed locally.
Rationale:
Clients that replay requests like this SHOULD do so by calling AuthorizePublication to pre-approve publication of presence to the appropriate contacts, followed by RequestSubscription to request the appropriate contacts' presences.
This property cannot change after the connection has moved to the Connected state. Until then, its value is undefined, and it may change at any time, without notification.
CanChangeSubscriptions — b
If true, presence subscription and publication can be changed using the RequestSubscription, AuthorizePublication and RemoveContacts methods.
If false, all of those methods will always fail; they SHOULD raise the error org.freedesktop.Telepathy.Error.NotImplemented.
Rationale:
This property cannot change after the connection has moved to the Connected state. Until then, its value is undefined, and it may change at any time, without notification.
RequestUsesMessage — b
If true, the Message parameter to RequestSubscription is likely to be significant, and user interfaces SHOULD prompt the user for a message to send with the request; a message such as "I would like to add you to my contact list", translated into the local user's language, might make a suitable default.
Rationale:
If false, the parameter is ignored; user interfaces SHOULD avoid prompting the user, and SHOULD pass an empty string to RequestSubscription.
Rationale:
Contact Attributes
org.freedesktop.Telepathy.Connection.Interface.ContactList.DRAFT2/subscribe — u (Presence_State)
If this attribute on a contact is Yes, this connection can expect to receive their presence, along with any other information that has the same access control.
Rationale:
If this attribute is No or Ask, the local user cannot generally expect to receive presence from this contact. Their presence status as returned by GetPresences is likely to be (Unknown, "unknown", ""), unless the local user can temporarily see their presence for some other reason (for instance, on XMPP, contacts seen in chatrooms will temporarily have available presence).
If this attribute is Ask, this indicates that the local user has asked to receive the contact's presence at some time. It is implementation-dependent whether contacts' subscribe attributes can remain set to Ask, or are reset to No, when the connection disconnects.
Rationale:
This attribute SHOULD be omitted from the Contact_Attributes_Map returned by GetContactAttributes until the initial contact list has been received, in protocols where this is applicable. Clients MAY wait for this by calling RequestContactList.
org.freedesktop.Telepathy.Connection.Interface.ContactList.DRAFT2/publish — u (Presence_State)
If this attribute on a contact is Yes, the local user's presence is published to that contact, along with any other information that shares an access-control mechanism with presence (depending on protocol, server configuration and/or user configuration, this may include avatars, "rich presence" such as location, etc.).
Rationale:
If this attribute is No or Ask, the local user's presence is not published to that contact; however, if it is Ask, the contact has requested that the local user's presence is made available to them.
It is implementation-dependent whether contacts' publish attributes can remain set to Ask, or are reset to No, when the connection disconnects.
Rationale:
This attribute SHOULD be omitted from the Contact_Attributes_Map returned by GetContactAttributes until the initial contact list has been received, in protocols where this is applicable. Clients MAY wait for this by calling RequestContactList.
org.freedesktop.Telepathy.Connection.Interface.ContactList.DRAFT2/publish-request — s
If the "publish" attribute is Ask, an optional message that was sent by the contact asking to receive the local user's presence; omitted if none was given.
Rationale:
Otherwise, this SHOULD be omitted.
This attribute SHOULD be omitted from the Contact_Attributes_Map returned by GetContactAttributes until the initial contact list has been received. Clients MAY wait for this by calling RequestContactList.
Types
Presence_State — u
A tristate indicating whether presence subscription is denied, denied but pending permission, or allowed. The exact semantics vary according to where this type is used.
- No (0)
- Ask (1)
- Yes (2)
Contact_Metadata_Storage_Type — u
- None (0)
- Subscribed_Or_Pending (1)
- Subscribed (2)
- Anyone (3)
This connection cannot store this type of metadata at all, and attempting to do so will fail with NotImplemented.
Rationale:
This type of metadata can only be stored permanently for contacts whose subscribe attribute is Ask or Yes.
Rationale:
If this type of metadata is set on a contact with subscribe=No, the Connection MUST cache it until disconnected, and return it if requested. If subscription to the contact's presence is subsequently requested, making it possible to store this metadata, the Connection MUST store the cached value at that time.
Rationale:
This type of metadata can only be stored permanently for contacts whose subscribe attribute is Yes.
Rationale:
If this type of metadata is set on a contact with subscribe != Yes, the Connection MUST cache it until disconnected, and return it if requested. If subscription to the contact's presence is subsequently allowed, making it possible to store this metadata, the Connection MUST store the cached value at that time.
Rationale:
The user can set this metadata for any valid contact identifier, whether or not they have any presence subscription relationship to it, and it will be stored on their contact list.
Rationale:
Contact_Subscription_Map — a{u(uus)}
- Contact — u (Contact_Handle)
- States — (uus) (Contact_Subscriptions)
Contact_Subscriptions — (uus)
- Subscribe — u (Presence_State)
- Publish — u (Presence_State)
- Publish_Request — s