Copyright © 2005-2009 Collabora Limited Copyright © 2005-2009 Nokia Corporation Copyright © 2006 INdT

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Deprecated methods, signals, and properties have all been removed. A structure representing a contact whose attempt to join a group is to be confirmed by the local user using AddMembers. The contact to be added to the group The contact requesting or causing the change The reason for the change A human-readable message from the Actor, or an empty string if there is no message An array of contact handles to invite to the channel 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.

The AddMembers method can be used to add or invite members who are not already in the local pending list (which is always valid). The RemoveMembers method can be used to remove channel members (removing those on the pending local list is always valid). The RemoveMembers method can be used on people on the remote pending list. A message may be sent to the server when calling AddMembers on contacts who are not currently pending members. A message may be sent to the server when calling RemoveMembers on contacts who are currently channel members. A message may be sent to the server when calling AddMembers on contacts who are locally pending. A message may be sent to the server when calling RemoveMembers on contacts who are locally pending. A message may be sent to the server when calling RemoveMembers on contacts who are remote pending.

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.

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). 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. 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. A message may be sent to the server when calling RemoveMembers on the SelfHandle. This would be set for XMPP Multi-User Chat or IRC channels, but not for a typical implementation of streamed media calls.
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. A map from channel-specific handles to their owners. A nonzero channel-specific handle The global handle that owns the corresponding channel-specific handle, or 0 if this could not be determined 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.

Emitted whenever the HandleOwners property changes.

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 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 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.
An array of structs containing handles representing contacts requesting channel membership and awaiting local approval with AddMembers. The members of this channel. An array of handles representing contacts who have been invited to the channel and are awaiting remote approval.

Emitted whenever the SelfHandle property changes.

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

The new value of the SelfHandle property. The new value of the SelfHandle property's identifier.
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. 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. A bitwise OR of the flags which have been set A bitwise OR of the flags which have been cleared Emitted when the flags as retrieved by the GroupFlags property are changed. The user interface should be updated as appropriate.

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.

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.telepathy.v1.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.telepathy.v1.Error.Cancelled.

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.

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.telepathy.v1.Error.Offline.

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.telepathy.v1.Error.Channel.Kicked.

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.

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.telepathy.v1.Error.Busy.

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). Otherwise, what would it mean?

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.telepathy.v1.Error.Channel.Banned.

The change is due to an error occurring.

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.

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.telepathy.v1.Error.DoesNotExist.

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.

Documenting existing practice.

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

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.

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.telepathy.v1.Error.PermissionDenied.

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.

A map from handles to the corresponding normalized string identifier. A nonzero handle The normalized contact identifier. A list of members added to the channel A list of members removed from the channel A list of members who are pending local approval A list of members who are pending remote approval

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.

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. 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.

An array of contact handles to remove from the channel A string message, which can be blank if desired A reason for the change

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.

The provided reason code was invalid.

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.