Interface Connection.Interface.ContactGroups.DRAFT

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

Methods

SetContactGroups (u: Contact, as: Groups) nothing
SetGroupMembers (s: Group, au: Members) nothing
AddToGroup (s: Group, au: Members) nothing
RemoveFromGroup (s: Group, au: Members) nothing
RemoveGroup (s: Group) nothing
RenameGroup (s: Old_Name, s: New_Name) nothing

Signals

GroupsCreated (as: Names)
GroupRenamed (s: Old_Name, s: New_Name)
GroupsRemoved (as: Names)
GroupsChanged (au: Contact, as: Added, as: Removed)

Properties

DisjointGroups b Read only
GroupStorage u (Contact_Metadata_Storage_Type) Read only
Groups as Read only

Contact Attributes

org.freedesktop.Telepathy.Connection.Interface.ContactGroups.DRAFT/groups as
WARNING: This interface is experimental and is likely to cause havoc to your API/ABI if bindings are generated. Do not include this interface in libraries that care about compatibility.
Added in 0.19.6. (draft 1)
Objects implementing this interface must also implement:

Description

An interface for connections in which contacts can be placed in user-defined groups.

Methods

(Permalink)

SetContactGroups (u: Contact, as: Groups) → nothing

Parameters

  • Contact — u (Contact_Handle)
  • The contact to alter.
  • Groups — as
  • The set of groups which the contact should be in.

Add the given contact to the given groups (creating new groups if necessary), and remove them from all other groups.

Rationale:

This is the easiest and most correct way to implement user interfaces that display a single contact with a list of groups, resulting in a user expectation that when they apply the changes, the contact's set of groups will become exactly what was displayed.

If the user is removed from a group of which they were the only member, the group MAY be removed automatically.

Rationale:

In protocols like XMPP where groups behave like tags, a group with no members has no protocol representation.

Any GroupsCreated, GroupsChanged and GroupsRemoved signals that result from this method call MUST be emitted before the method returns.


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.
    Rationale:
    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.
  • Network Error
  • Raised when there is an error reading from or writing to the network.
  • Not Available
  • Raised if DisjointGroups is true and the list of groups has more than one member.
  • Not Implemented
  • Raised if GroupStorage is Contact_Metadata_Storage_Type_None, i.e. groups cannot be edited.
(Permalink)

SetGroupMembers (s: Group, au: Members) → nothing

Parameters

  • Group — s
  • The group to alter.
  • Members — au (Contact_Handle_List)
  • The set of members for the group. If this set is empty, this method MAY remove the group.

Add the given members to the given group (creating it if necessary), and remove all other members.

Rationale:

This is the easiest and most correct way to implement user interfaces that display a single group with a list of contacts, resulting in a user expectation that when they apply the changes, the groups's set of members will become exactly what was displayed.

If DisjointGroups is true, this will also remove each member from their previous group.

If the user is removed from a group of which they were the only member, the group MAY be removed automatically.

Any GroupsCreated, GroupsChanged and GroupsRemoved signals that result from this method call MUST be emitted before the method returns.


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.
    Rationale:
    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.
  • Network Error
  • Raised when there is an error reading from or writing to the network.
  • Not Implemented
  • Raised if GroupStorage is Contact_Metadata_Storage_Type_None, i.e. groups cannot be edited.
(Permalink)

AddToGroup (s: Group, au: Members) → nothing

Parameters

  • Group — s
  • The group to alter.
  • Members — au (Contact_Handle_List)
  • The set of members to include in the group.

Add the given members to the given group, creating it if necessary.

If DisjointGroups is true, this will also remove each member from their previous group.

Rationale:

This is good for user interfaces in which you can edit groups via drag-and-drop.

Any GroupsCreated, GroupsChanged and GroupsRemoved signals that result from this method call MUST be emitted before the method returns.


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.
    Rationale:
    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.
  • Network Error
  • Raised when there is an error reading from or writing to the network.
  • Not Implemented
  • Raised if GroupStorage is Contact_Metadata_Storage_Type_None, i.e. groups cannot be edited.
(Permalink)

RemoveFromGroup (s: Group, au: Members) → nothing

Parameters

  • Group — s
  • The group to alter. If it does not exist, then it has no members by definition, so this method SHOULD return successfully.
  • Members — au (Contact_Handle_List)
  • The set of members to remove from the group. It is not an error to remove members who are already not in the group. If there are no members left in the group afterwards, the group MAY itself be removed.

Remove the given members from the given group.

Rationale:

This is good for user interfaces in which you can edit groups via drag-and-drop.

Any GroupsChanged or GroupsRemoved signals that result from this method call MUST be emitted before the method returns.


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.
    Rationale:
    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.
  • Network Error
  • Raised when there is an error reading from or writing to the network.
  • Not Implemented
  • Raised if GroupStorage is Contact_Metadata_Storage_Type_None, i.e. groups cannot be edited.
(Permalink)

RemoveGroup (s: Group) → nothing

Parameters

  • Group — s
  • The group to remove.

Remove all members from the given group, then remove the group itself. If the group already does not exist, this method SHOULD return successfully.

Any GroupsChanged or GroupsRemoved signals that result from this method call MUST be emitted before the method returns.


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.
    Rationale:
    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.
  • Not Implemented
  • Raised if GroupStorage is Contact_Metadata_Storage_Type_None, i.e. groups cannot be edited.
(Permalink)

RenameGroup (s: Old_Name, s: New_Name) → nothing

Parameters

  • Old_Name — s
  • The group to rename.
  • New_Name — s
  • The new name for the group.

Rename the given group.

On protocols where groups behave like tags, this is an API short-cut for adding all of the group's members to a group with the new name, then removing the old group.

Rationale:

Otherwise, clients can't perform this operation atomically, even if the connection could.

Any GroupRenamed or GroupsRemoved signals that result from this method call MUST be emitted before the method returns.


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.
    Rationale:
    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.
  • Not Implemented
  • Raised if GroupStorage is Contact_Metadata_Storage_Type_None, i.e. groups cannot be edited.
  • Does Not Exist
  • Raised if there is no group with that name.
  • Not Available
  • Raised if there is already a group with the new name.

Signals

(Permalink)

GroupsCreated (as: Names)

Parameters

  • Names — as
  • The names of the new groups.
Emitted when new, empty groups are created. This will often be followed by GroupsChanged signals that add some members.
(Permalink)

GroupRenamed (s: Old_Name, s: New_Name)

Parameters

  • Old_Name — s
  • The old name of the group.
  • New_Name — s
  • The new name of the group.

Emitted when a group is renamed.

Immediately after this signal is emitted, GroupsCreated MUST signal the creation of a group with the new name, and GroupsRemoved MUST signal the removal of a group with the old name.

Rationale:

Emitting these extra signals, in this order, means that clients that are interested in the set of groups that exist (but treat a rename and a create/remove pair identically) to ignore the GroupRenamed signal entirely.

If the group was not empty, immediately after those signals are emitted, GroupsChanged MUST signal that the members of that group were removed from the old name and added to the new name.

On connection managers where groups behave like tags, renaming a group MAY be signalled as a set of GroupsCreated, GroupsRemoved and GroupsChanged signals, instead of emitting this signal.

Rationale:

On protocols like XMPP, another resource "renaming a group" is indistinguishable from changing contacts' groups individually.

(Permalink)

GroupsRemoved (as: Names)

Parameters

  • Names — as
  • The names of the groups.

Emitted when one or more groups are removed. If they had members at the time that they were removed, then immediately after this signal is emitted, GroupsChanged MUST signal that their members were removed.

Rationale:

Emitting the signals in this order allows for two modes of operation. A client interested only in a contact's set of groups can ignore GroupsRemoved and rely on the GroupsChanged signal that will follow; a more elaborate client wishing to distinguish between all of a group's members being removed, and the group itself being removed, can additionally watch for GroupsRemoved and use it to disambiguate.

(Permalink)

GroupsChanged (au: Contact, as: Added, as: Removed)

Parameters

  • Contact — au (Contact_Handle)
  • The relevant contacts.
  • Added — as
  • The names of groups to which the contacts were added.
  • Removed — as
  • The names of groups from which the contacts were removed.
Emitted when contacts' groups change.

Properties

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

DisjointGroups — b

Read only

True if each contact can be in at most one group; false if each contact can be in many groups.

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.

(Permalink)

GroupStorage — u (Contact_Metadata_Storage_Type)

Read only

Indicates the extent to which contacts' groups can be set and stored.

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.

(Permalink)

Groups — as

Read only

The names of all groups that currently exist. This may be a larger set than the union of all contacts' groups contact attributes, if the connection allows groups to be empty.

Change notification is via GroupsCreated and GroupsRemoved; clients can also distinguish between a create/remove pair and a renamed group by receiving GroupRenamed.

This property's value is not meaningful until the initial contact list has been received, in protocols where this is applicable. Clients MAY wait for this property to be meaningful by calling RequestContactList.

Contact Attributes

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

org.freedesktop.Telepathy.Connection.Interface.ContactGroups.DRAFT/groups — as

The names of groups of which a contact is a member.

Change notification is via GroupsChanged; clients can also get extra context for group membership changes by receiving GroupRenamed and GroupsRemoved.