Interface Channel.Interface.Group1

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

Methods

AddMembers (au: Contacts, s: Message) nothing
RemoveMembers (au: Contacts, s: Message, u: Reason) nothing

Signals

HandleOwnersChanged (a{uu}: Added, au: Removed, a{us}: Identifiers)
SelfContactChanged (u: Self_Handle, s: Self_ID)
GroupFlagsChanged (u: Added, u: Removed)
MembersChanged (au: Added, au: Removed, au: Local_Pending, au: Remote_Pending, a{sv}: Details)

Properties

GroupFlags u (Channel_Group_Flags) Read only
HandleOwners a{uu} (Handle_Owner_Map) Read only
LocalPendingMembers a(uuus) (Local_Pending_Info_List) Read only
Members au (Contact_Handle_List) Read only
RemotePendingMembers au (Contact_Handle_List) Read only
SelfHandle u (Contact_Handle) Read only
MemberIdentifiers a{us} (Handle_Identifier_Map) Read only

Types

Channel_Group_Change_Reason Enum u
Channel_Group_Flags Flags u
Handle_Owner_Map Mapping a{uu}
Handle_Identifier_Map Mapping a{us}
Local_Pending_Info Struct (uuus)
Changed in UNRELEASED. Deprecated methods, signals, and properties have all been removed.
Objects implementing this interface must also implement:

Description

Interface for channels which have multiple members, and where the members of the channel can change during its lifetime. Your presence in the channel cannot be presumed by the channel's existence (for example, a channel you may request membership of but your request may not be granted).

This interface implements three lists: a list of current members (Members), and two lists of local pending and remote pending members (LocalPendingMembers and RemotePendingMembers, respectively). Contacts on the remote pending list have been invited to the channel, but the remote user has not accepted the invitation. Contacts on the local pending list have requested membership of the channel, but the local user of the framework must accept their request before they may join. A single contact should never appear on more than one of the three lists. The lists are empty when the channel is created, and the MembersChanged signal should be emitted when information is retrieved from the server, or changes occur.

If the MembersChanged signal indicates that the SelfHandle has been removed from the channel, and the channel subsequently emits Closed, clients SHOULD consider the details given in the MembersChanged signal to be the reason why the channel closed.

Addition of members to the channel may be requested by using AddMembers. If remote acknowledgement is required, use of the AddMembers method will cause users to appear on the remote pending list. If no acknowledgement is required, AddMembers will add contacts to the member list directly. If a contact is awaiting authorisation on the local pending list, AddMembers will grant their membership request.

Removal of contacts from the channel may be requested by using RemoveMembers. If a contact is awaiting authorisation on the local pending list, RemoveMembers will refuse their membership request. If a contact is on the remote pending list but has not yet accepted the invitation, RemoveMembers will rescind the request if possible.

It should not be presumed that the requester of a channel implementing this interface is immediately granted membership, or indeed that they are a member at all, unless they appear in the list. They may, for instance, be placed into the remote pending list until a connection has been established or the request acknowledged remotely.

If the local user joins a Group channel whose members or other state cannot be discovered until the user joins (e.g. many chat room implementations), the connection manager should ensure that the channel is, as far as possible, in a consistent state before adding the local contact to the members set; until this happens, the local contact should be in the remote-pending set. For instance, if the connection manager queries the server to find out the initial members list for the channel, it should leave the local contact in the remote-pending set until it has finished receiving the initial members list.

If the protocol provides no reliable way to tell whether the complete initial members list has been received yet, the connection manager should make a best-effort attempt to wait for the full list (in the worst case, waiting for a suitable arbitrary timeout) rather than requiring user interfaces to do so on its behalf.

Methods

(Permalink)

AddMembers (au: Contacts, s: Message) → nothing

Parameters

  • Contacts — au (Contact_Handle_List)
  • An array of contact handles to invite to the channel
  • Message — s
  • A string message, which can be blank if desired

Invite all the given contacts into the channel, or accept requests for channel membership for contacts on the pending local list.

A message may be provided along with the request, which will be sent to the server if supported. See the CHANNEL_GROUP_FLAG_MESSAGE_ADD and CHANNEL_GROUP_FLAG_MESSAGE_ACCEPT GroupFlags to see in which cases this message should be provided.

Attempting to add contacts who are already members is allowed; connection managers must silently accept this, without error.


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 Available
  • Raised when the requested functionality is temporarily unavailable.
  • Not Capable
  • Raised when requested functionality is unavailable due to contact not having required capabilities.
  • Permission Denied
  • The user is not permitted to perform the requested operation.
  • Invalid Handle
  • The handle specified is unknown on this channel or connection.
  • Channel.Full
  • The channel is full.
  • Channel.Invite Only
  • The requested channel is invite-only.
  • Channel.Banned
  • You are banned from the channel.
(Permalink)

RemoveMembers (au: Contacts, s: Message, u: Reason) → nothing

Parameters

Requests the removal of contacts from a channel, reject their request for channel membership on the pending local list, or rescind their invitation on the pending remote list.

If the SelfHandle is in a Group, it can be removed via this method, in order to leave the group gracefully. This is the recommended way to leave a chatroom.

Accordingly, connection managers SHOULD support doing this, regardless of the value of GroupFlags. If doing so fails with PermissionDenied, this is considered to a bug in the connection manager, but clients MUST recover by falling back to closing the channel with the Close method.

Removing any contact from the local pending list is always allowed. Removing contacts other than the SelfHandle from the channel's members is allowed if and only if Channel_Group_Flag_Can_Remove is in the GroupFlags, while removing contacts other than the SelfHandle from the remote pending list is allowed if and only if Channel_Group_Flag_Can_Rescind is in the GroupFlags.

A message may be provided along with the request, which will be sent to the server if supported. See the Channel_Group_Flag_Message_Remove, Channel_Group_Flag_Message_Depart, Channel_Group_Flag_Message_Reject and Channel_Group_Flag_Message_Rescind GroupFlags to see in which cases this message should be provided.

The reason code may be ignored if the underlying protocol is unable to represent the given reason.


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 Available
  • Raised when the requested functionality is temporarily unavailable.
  • Permission Denied
  • The user is not permitted to perform the requested operation.
  • Invalid Handle
  • The handle specified is unknown on this channel or connection.
  • Invalid Argument
  • The provided reason code was invalid.

Signals

(Permalink)

HandleOwnersChanged (a{uu}: Added, au: Removed, a{us}: Identifiers)

Added in 0.23.4.

Parameters

  • Added — a{uu} (Handle_Owner_Map)
  • A map from channel-specific handles to their owners, in which the keys include all the handles that were added to the keys of the HandleOwners property, and all the handles in that property whose owner has changed
  • Removed — au (Contact_Handle_List)
  • The channel-specific handles that were removed from the keys of the HandleOwners property, as a result of the contact leaving this group in a previous MembersChanged signal
  • Identifiers — a{us} (Handle_Identifier_Map)
  • The string identifiers for handles mentioned in this signal, to give clients the minimal information necessary to create contacts without waiting for round-trips. Connection managers MUST include at least the identifiers for all handles in the Added map, and MAY include those from Removed array.

Emitted whenever the HandleOwners property changes.

(Permalink)

SelfContactChanged (u: Self_Handle, s: Self_ID)

Added in 0.23.4.

Parameters

  • Self_Handle — u (Contact_Handle)
  • The new value of the SelfHandle property.
  • Self_ID — s
  • The new value of the SelfHandle property's identifier.

Emitted whenever the SelfHandle property changes.

Clients can assume this signal is emitted by the Connection Manager if the MemberIdentifiers property exists.

(Permalink)

GroupFlagsChanged (u: Added, u: Removed)

Parameters

Emitted when the flags as retrieved by the GroupFlags property are changed. The user interface should be updated as appropriate.
(Permalink)

MembersChanged (au: Added, au: Removed, au: Local_Pending, au: Remote_Pending, a{sv}: Details)

Added in 0.17.16.

Parameters

  • Added — au (Contact_Handle_List)
  • A list of members added to the channel
  • Removed — au (Contact_Handle_List)
  • A list of members removed from the channel
  • Local_Pending — au (Contact_Handle_List)
  • A list of members who are pending local approval
  • Remote_Pending — au (Contact_Handle_List)
  • A list of members who are pending remote approval
  • Details — a{sv} (String_Variant_Map)
  • Information about the change, which may include the following well-known keys:

    actor (u — Contact_Handle)
    The contact handle of the person who made the change; 0 or omitted if unknown or not applicable.
    change-reason (u — Channel_Group_Change_Reason)
    A reason for the change.
    contact-ids (a{us} — Handle_Identifier_Map)

    The string identifiers for handles mentioned in this signal, to give clients the minimal information necessary to react to the event without waiting for round-trips. Connection managers SHOULD include the identifiers for members added to the group and for the actor (if any); they MAY omit the identifiers for handles which have been removed from the group.

    Rationale:

    On IRC, an event such as a netsplit could cause the vast majority of a channel to leave. Given that clients should already know the identifiers of a channel's members, including potentially hundreds of strings in the netsplit signal is unnecessary.

    Clients MUST NOT assume that the presence or absence of a handle in this mapping is meaningful. This mapping is merely an optimization for round-trip reduction, and connection managers MAY add additional handles, omit some handles, or omit the mapping completely.

    message (s)
    A string message from the server regarding the change
    error (s — DBus_Error_Name)
    A (possibly implementation-specific) DBus error describing the change, providing more specific information than the Channel_Group_Change_Reason enum allows. This MUST only be present if it is strictly more informative than 'change-reason'; if present, 'change-reason' MUST be set to the closest available reason.
    Rationale:
    A SIP connection manager might want to signal "402 Payment required" as something more specific than Error or Permission_Denied so that a SIP-aware UI could handle it specially; including a namespaced error permits this to be done without Channel_Group_Change_Reason being extended to encompass every error any CM ever wants to report.
    debug-message (s)
    Debugging information on the change. SHOULD NOT be shown to users in normal circumstances.

Emitted when contacts join any of the three lists (members, local pending or remote pending) or when they leave any of the three lists.

All channel-specific handles that are mentioned in this signal MUST be represented in the value of the HandleOwners property.

Properties

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

GroupFlags — u (Channel_Group_Flags)

Read only
Added in 0.17.6.
An integer representing the bitwise-OR of flags on this channel. The user interface can use this to present information about which operations are currently valid. Change notification is via the GroupFlagsChanged signal.
(Permalink)

HandleOwners — a{uu} (Handle_Owner_Map)

Read only
Added in 0.17.6.
A map from channel-specific handles to their owners, including at least all of the channel-specific handles in this channel's members, local-pending or remote-pending sets as keys. Any handle not in the keys of this mapping is not channel-specific in this channel. Handles which are channel-specific, but for which the owner is unknown, MUST appear in this mapping with 0 as owner. Change notification is via the HandleOwnersChanged signal.
(Permalink)

LocalPendingMembers — a(uuus) (Local_Pending_Info_List)

Read only
Added in 0.17.6.
An array of structs containing handles representing contacts requesting channel membership and awaiting local approval with AddMembers.
(Permalink)

Members — au (Contact_Handle_List)

Read only
Added in 0.17.6.
The members of this channel.
(Permalink)

RemotePendingMembers — au (Contact_Handle_List)

Read only
Added in 0.17.6.
An array of handles representing contacts who have been invited to the channel and are awaiting remote approval.
(Permalink)

SelfHandle — u (Contact_Handle)

Read only
Added in 0.17.6.
The handle for the user on this channel (which can also be a local or remote pending member), or 0 if the user is not a member at all (which is likely to be the case, for instance, on the old ContactList channels). Note that this is different from the value of the Connection.SelfHandle property on some protocols, so the value of this handle should always be used with the methods of this interface.
(Permalink)

MemberIdentifiers — a{us} (Handle_Identifier_Map)

Read only
Added in 0.23.4.
The string identifiers for handles mentioned in this channel, to give clients the minimal information necessary to create contacts without waiting for round-trips. Connection managers MUST include at least the identifiers for SelfHandle, Members, RemotePendingMembers and HandleOwners.

Types

Enum (Permalink)

Channel_Group_Change_Reason — u

The reason for a set of handles to move to one of Members, LocalPendingMembers or RemotePendingMembers, or to be removed from the group. A client may supply a reason when attempting to remove members from a group with RemoveMembers, and reasons are supplied by the CM when emitting MembersChanged. Some reason codes have different meanings depending on the Actor in a MembersChanged signal.

  • None (0)
  • No reason was provided for this change.

    In particular, this reason SHOULD be used when representing users joining a named chatroom in the usual way, users leaving a chatroom by their own request, and normal termination of a StreamedMedia call by the remote user.

    If the SelfHandle is removed from a group for this reason and the actor is not the SelfHandle, the equivalent D-Bus error is im.telepathy1.Error.Terminated.

    If the SelfHandle is removed from a group for this reason and the actor is also the SelfHandle, the equivalent D-Bus error is im.telepathy1.Error.Cancelled.

  • Offline (1)
  • The change is due to a user going offline. Also used when user is already offline, but this wasn't known previously.

    If a one-to-one StreamedMedia call fails because the contact being called is offline, the connection manager SHOULD indicate this by removing both the SelfHandle and the other contact's handle from the Group interface with reason Offline.

    Rationale:
    For 1-1 calls, the call terminates as a result of removing the remote contact, so the SelfHandle should be removed at the same time as the remote contact and for the same reason.

    If a handle is removed from a group for this reason, the equivalent D-Bus error is im.telepathy1.Error.Offline.

  • Kicked (2)
  • The change is due to a kick operation.

    If the SelfHandle is removed from a group for this reason, the equivalent D-Bus error is im.telepathy1.Error.Channel.Kicked.

  • Busy (3)
  • The change is due to a busy indication.

    If a one-to-one StreamedMedia call fails because the contact being called is busy, the connection manager SHOULD indicate this by removing both the SelfHandle and the other contact's handle from the Group interface with reason Busy.

    Rationale:
    For 1-1 calls, the call terminates as a result of removing the remote contact, so the SelfHandle should be removed at the same time as the remote contact and for the same reason.

    If the SelfHandle is removed from a group for this reason, the equivalent D-Bus error is im.telepathy1.Error.Busy.

  • Invited (4)
  • The change is due to an invitation. This reason SHOULD only be used when contacts are added to the remote-pending set (to indicate that the contact has been invited) or to the members (to indicate that the contact has accepted the invitation).
    Rationale:
    Otherwise, what would it mean?
  • Banned (5)
  • The change is due to a kick+ban operation.

    If the SelfHandle is removed from a group for this reason, the equivalent D-Bus error is im.telepathy1.Error.Channel.Banned.

  • Error (6)
  • The change is due to an error occurring.
  • Invalid_Contact (7)
  • The change is because the requested contact does not exist.

    For instance, if the user invites a nonexistent contact to a chatroom or attempts to call a nonexistent contact, this could be indicated by the CM adding that contact's handle to remote-pending for reason None or Invited, then removing it for reason Invalid_Contact. In the case of a 1-1 StreamedMedia call, the CM SHOULD remove the self handle from the Group in the same signal.

    Rationale:
    For 1-1 calls, the call terminates as a result of removing the remote contact, so the SelfHandle should be removed at the same time as the remote contact and for the same reason.

    If a contact is removed from a group for this reason, the equivalent D-Bus error is im.telepathy1.Error.DoesNotExist.

  • No_Answer (8)
  • The change is because the requested contact did not respond.

    If a one-to-one StreamedMedia call fails because the contact being called did not respond, or the local user did not respond to an incoming call, the connection manager SHOULD indicate this by removing both the SelfHandle and the other contact's handle from the Group interface with reason No_Answer.

    Rationale:
    Documenting existing practice.

    If a contact is removed from a group for this reason, the equivalent D-Bus error is im.telepathy1.Error.NoAnswer.

  • Renamed (9)
  • The change is because a contact's unique identifier changed. There must be exactly one handle in the removed set and exactly one handle in one of the added sets. The Renamed signal on the Renaming1 interface will have been emitted for the same handles, shortly before this MembersChanged signal is emitted.

  • Permission_Denied (10)
  • The change is because there was no permission to contact the requested handle.

    If a contact is removed from a group for this reason, the equivalent D-Bus error is im.telepathy1.Error.PermissionDenied.

  • Separated (11)
  • If members are removed with this reason code, the change is because the group has split into unconnected parts which can only communicate within themselves (e.g. netsplits on IRC use this reason code).

    If members are added with this reason code, the change is because unconnected parts of the group have rejoined. If this channel carries messages (e.g. Text channels) applications must assume that the contacts being added are likely to have missed some messages as a result of the separation, and that the contacts in the group are likely to have missed some messages from the contacts being added.

    Note that from the added contacts' perspective, they have been in the group all along, and the contacts we indicate to be in the group (including the local user) have just rejoined the group with reason Separated. Application protocols in Tubes should be prepared to cope with this situation.

    The SelfHandle SHOULD NOT be removed from channels with this reason.

Flags (Permalink)

Channel_Group_Flags — u

  • Can_Add (1)
  • The AddMembers method can be used to add or invite members who are not already in the local pending list (which is always valid).
  • Can_Remove (2)
  • The RemoveMembers method can be used to remove channel members (removing those on the pending local list is always valid).
  • Can_Rescind (4)
  • The RemoveMembers method can be used on people on the remote pending list.
  • Message_Add (8)
  • A message may be sent to the server when calling AddMembers on contacts who are not currently pending members.
  • Message_Remove (16)
  • A message may be sent to the server when calling RemoveMembers on contacts who are currently channel members.
  • Message_Accept (32)
  • A message may be sent to the server when calling AddMembers on contacts who are locally pending.
  • Message_Reject (64)
  • A message may be sent to the server when calling RemoveMembers on contacts who are locally pending.
  • Message_Rescind (128)
  • A message may be sent to the server when calling RemoveMembers on contacts who are remote pending.
  • Channel_Specific_Handles (256)
  • The members of this group have handles which are specific to this channel, and are not valid as general-purpose handles on the connection. Depending on the channel, it may be possible to check the HandleOwners property to find the owners of these handles, which should be done if you wish to (e.g.) subscribe to the contact's presence.

    Connection managers must ensure that any given handle is not simultaneously a general-purpose handle and a channel-specific handle.

  • Only_One_Group (512)
  • Placing a contact in multiple groups of this type is not allowed and will raise NotAvailable (on services where contacts may only be in one user-defined group, user-defined groups will have this flag).
  • Handle_Owners_Not_Available (1024)
  • In rooms with channel specific handles (i.e. Channel_Specific_Handles flag is set), this flag indicates that no handle owners are available, apart from the owner of the SelfHandle.
    Rationale:
    This used to be an important optimization to avoid repeated calls to the now-removed GetHandleOwners method, before we introduced the HandleOwners property and HandleOwnersChanged signal.
  • Message_Depart (2048)
  • Added in 0.17.21.
    A message may be sent to the server when calling RemoveMembers on the SelfHandle.
    Rationale:
    This would be set for XMPP Multi-User Chat or IRC channels, but not for a typical implementation of streamed media calls.
Mapping (Permalink)

Handle_Owner_Map — a{uu}

Added in 0.17.6.
A map from channel-specific handles to their owners.
  • Channel_Specific_Handle — u (Contact_Handle)
  • A nonzero channel-specific handle
  • Global_Handle — u (Contact_Handle)
  • The global handle that owns the corresponding channel-specific handle, or 0 if this could not be determined
Mapping (Permalink)

Handle_Identifier_Map — a{us}

Added in 0.17.17.
A map from handles to the corresponding normalized string identifier.
Struct (Permalink)

Local_Pending_Info — (uuus)

A structure representing a contact whose attempt to join a group is to be confirmed by the local user using AddMembers.
  • To_Be_Added — u (Contact_Handle)
  • The contact to be added to the group
  • Actor — u (Contact_Handle)
  • The contact requesting or causing the change
  • Reason — u (Channel_Group_Change_Reason)
  • The reason for the change
  • Message — s
  • A human-readable message from the Actor, or an empty string if there is no message