Top |
TpBaseConnection * | connection | Read / Write / Construct Only |
gboolean | download-at-connection | Read / Write / Construct |
struct | TpBaseContactList |
struct | TpBaseContactListClass |
#define | TP_TYPE_MUTABLE_CONTACT_LIST |
struct | TpMutableContactListInterface |
#define | TP_TYPE_CONTACT_GROUP_LIST |
struct | TpContactGroupListInterface |
#define | TP_TYPE_MUTABLE_CONTACT_GROUP_LIST |
struct | TpMutableContactGroupListInterface |
#define | TP_TYPE_BLOCKABLE_CONTACT_LIST |
struct | TpBlockableContactListInterface |
This class represents a connection's contact list (roster, buddy list etc.) inside a connection manager. It can be used to implement the ContactList D-Bus interface on the Connection.
Connection managers should subclass TpBaseContactList, implementing the
virtual methods for core functionality in TpBaseContactListClass.
Then, in the TpBaseConnectionClass.fill_contact_attributes implementation,
call tp_base_contact_list_fill_contact_attributes()
and do not chain up if it
returns TRUE
:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
// ... if (!tp_strdiff (dbus_interface, MY_IFACE_CONNECTION_INTERFACE_HATS)) { // ... fill in Hats attributes ... return; } if (tp_base_contact_list_fill_contact_attributes (self->priv->contact_list, dbus_interface, contact, attributes)) { return; } ((TpBaseConnectionClass *) my_connection_parent_class)-> fill_contact_attributes (self, dbus_interface, contact, attributes); |
Optionally, one or more of the TP_TYPE_MUTABLE_CONTACT_LIST, TP_TYPE_CONTACT_GROUP_LIST, TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, and TP_TYPE_BLOCKABLE_CONTACT_LIST GObject interfaces may also be implemented, as appropriate to the protocol.
TpContactListState tp_base_contact_list_get_state (TpBaseContactList *self
,GError **error
);
Return how much progress this object has made towards retrieving the contact list.
If this contact list's connection has disconnected, or retrieving the
contact list has failed, return TP_CONTACT_LIST_STATE_FAILURE
.
self |
a contact list |
|
error |
used to raise an error if something other than
|
Since 0.13.0
TpBaseConnection * tp_base_contact_list_get_connection (TpBaseContactList *self
,GError **error
);
Return the Connection this contact list uses. If this contact list's
connection has already disconnected, return NULL
instead.
Since 0.13.0
void
tp_base_contact_list_set_list_pending (TpBaseContactList *self
);
Record that receiving the initial contact list is in progress.
Since 0.13.0
void tp_base_contact_list_set_list_failed (TpBaseContactList *self
,GQuark domain
,gint code
,const gchar *message
);
Record that receiving the initial contact list has failed.
This method cannot be called after tp_base_contact_list_set_list_received()
is called.
Since 0.13.0
void
tp_base_contact_list_set_list_received
(TpBaseContactList *self
);
Record that the initial contact list has been received. This allows the contact list manager to reply to requests for the list of contacts that were previously made, and reply to subsequent requests immediately.
This method can be called at most once for a contact list manager.
In protocols where there's no good definition of the point at which the initial contact list has been received (such as link-local XMPP), this method may be called immediately.
The TpBaseContactListDupContactsFunc and TpBaseContactListDupStatesFunc must already give correct results when entering this method.
If implemented, tp_base_contact_list_dup_blocked_contacts()
must also
give correct results when entering this method.
Since 0.13.0
void tp_base_contact_list_contacts_changed (TpBaseContactList *self
,TpHandleSet *changed
,TpHandleSet *removed
);
Emit signals for a change to the contact list.
The results of TpBaseContactListDupContactsFunc and TpBaseContactListDupStatesFunc must already reflect the contacts' new statuses when entering this method (in practice, this means that implementations must update their own cache of contacts before calling this method).
self |
the contact list manager |
|
changed |
a set of contacts added to the contact list or with a changed status. |
[allow-none] |
removed |
a set of contacts removed from the contact list. |
[allow-none] |
Since 0.13.0
void tp_base_contact_list_one_contact_changed (TpBaseContactList *self
,TpHandle changed
);
Convenience wrapper around tp_base_contact_list_contacts_changed()
for a
single handle in the 'changed' set and no 'removed' set.
Since 0.13.0
void tp_base_contact_list_one_contact_removed (TpBaseContactList *self
,TpHandle removed
);
Convenience wrapper around tp_base_contact_list_contacts_changed()
for a
single handle in the 'removed' set and no 'changed' set.
Since 0.13.0
gboolean
(*TpBaseContactListBooleanFunc) (TpBaseContactList *self
);
Signature of a virtual method that returns a boolean result. These are used for feature-discovery.
For the simple cases of a constant result, use
tp_base_contact_list_true_func()
or tp_base_contact_list_false_func()
.
Since 0.13.0
gboolean
tp_base_contact_list_false_func (TpBaseContactList *self
);
An implementation of TpBaseContactListBooleanFunc that returns FALSE
,
for use in simple cases.
Since 0.13.0
gboolean
tp_base_contact_list_true_func (TpBaseContactList *self
);
An implementation of TpBaseContactListBooleanFunc that returns TRUE
,
for use in simple cases.
Since 0.13.0
gboolean
tp_base_contact_list_get_contact_list_persists
(TpBaseContactList *self
);
Return whether subscriptions on this protocol persist between sessions (i.e. are stored on the server).
This is a virtual method, implemented using TpBaseContactListClass.get_contact_list_persists.
The default implementation is tp_base_contact_list_true_func()
, which is
correct for most protocols. Protocols where the contact list isn't stored
should use tp_base_contact_list_false_func()
as their implementation.
In the rare case of a protocol where subscriptions sometimes persist
and this is detected while connecting, the subclass can implement another
TpBaseContactListBooleanFunc (whose result must remain constant
after the TpBaseConnection has moved to state
TP_CONNECTION_STATUS_CONNECTED
), and use that as the implementation.
Since 0.13.0
TpHandleSet *
(*TpBaseContactListDupContactsFunc) (TpBaseContactList *self
);
Signature of a virtual method to list contacts with a particular state; the required state is defined by the particular virtual method being implemented.
The implementation is expected to have a cache of contacts on the contact list, which is updated based on protocol events.
Since 0.13.0
TpHandleSet *
tp_base_contact_list_dup_contacts (TpBaseContactList *self
);
Return the contact list. It is incorrect to call this method before
tp_base_contact_list_set_list_received()
has been called, or after the
connection has disconnected.
This is a virtual method, implemented using TpBaseContactListClass.dup_contacts. Every subclass of TpBaseContactList must implement this method.
If the contact list implements TP_TYPE_BLOCKABLE_CONTACT_LIST
, blocked
contacts should not appear in the result of this method unless they are
considered to be on the contact list for some other reason.
Since 0.13.0
void (*TpBaseContactListDupStatesFunc) (TpBaseContactList *self
,TpHandle contact
,TpSubscriptionState *subscribe
,TpSubscriptionState *publish
,gchar **publish_request
);
Signature of a virtual method to get contacts' presences. It should return
subscribe
= TP_SUBSCRIPTION_STATE_NO
, publish
= TP_SUBSCRIPTION_STATE_NO
and publish_request
= "", without error, for any contact not on the
contact list.
self |
the contact list manager |
|
contact |
the contact |
|
subscribe |
used to return the state of the user's
subscription to |
[out][allow-none] |
publish |
used to return the state of |
[out][allow-none] |
publish_request |
if |
[out][allow-none][transfer full] |
Since 0.13.0
void tp_base_contact_list_dup_states (TpBaseContactList *self
,TpHandle contact
,TpSubscriptionState *subscribe
,TpSubscriptionState *publish
,gchar **publish_request
);
Return the presence subscription state of contact
. It is incorrect to call
this method before tp_base_contact_list_set_list_received()
has been
called, or after the connection has disconnected.
This is a virtual method, implemented using TpBaseContactListClass.dup_states. Every subclass of TpBaseContactList must implement this method.
self |
a contact list manager |
|
contact |
the contact |
|
subscribe |
used to return the state of the user's
subscription to |
[out][allow-none] |
publish |
used to return the state of |
[out][allow-none] |
publish_request |
if |
[out][allow-none][transfer full] |
Since 0.13.0
guint
(*TpBaseContactListUIntFunc) (TpBaseContactList *self
);
Signature of a virtual method that returns an unsigned integer result. These are used for feature-discovery.
Since 0.13.0
void (*TpBaseContactListAsyncFunc) (TpBaseContactList *self
,GAsyncReadyCallback callback
,gpointer user_data
);
Signature of a virtual method that needs no additional information.
self |
the contact list manager |
|
callback |
a callback to call on success, failure or disconnection |
|
user_data |
user data for the callback |
Since 0.18.0
gboolean (*TpBaseContactListAsyncFinishFunc) (TpBaseContactList *self
,GAsyncResult *result
,GError **error
);
Signature of a virtual method to finish an async operation.
self |
the contact list manager |
|
result |
the result of the asynchronous operation |
|
error |
used to raise an error if |
Since 0.13.0
void tp_base_contact_list_download_async (TpBaseContactList *self
,GAsyncReadyCallback callback
,gpointer user_data
);
Download the contact list when it is not done automatically at connection.
If the TpBaseContactList subclass does not override download_async, the default implementation will raise TP_ERROR_NOT_IMPLEMENTED asynchronously.
self |
a contact list manager |
|
callback |
a callback to call when the operation succeeds or fails |
|
user_data |
optional data to pass to |
Since 0.18.0
gboolean tp_base_contact_list_download_finish (TpBaseContactList *self
,GAsyncResult *result
,GError **error
);
Interpret the result of an asynchronous call to
tp_base_contact_list_download_async()
.
This is a virtual method which may be implemented using
TpBaseContactListClass.download_finish. If the result
will be a GSimpleAsyncResult, the default implementation may be used.
self |
a contact list manager |
|
result |
the result passed to |
|
error |
used to raise an error if |
Since 0.18.0
gboolean
tp_base_contact_list_get_download_at_connection
(TpBaseContactList *self
);
This function returns the “download-at-connection” property.
Since 0.18.0
gboolean tp_base_contact_list_fill_contact_attributes (TpBaseContactList *self
,const gchar *dbus_interface
,TpHandle contact
,GVariantDict *attributes
);
If dbus_interface
is an interface that is relevant for this
object, fill attributes
with the attributes for contact
and return TRUE
.
gboolean
tp_base_contact_list_can_change_contact_list
(TpBaseContactList *self
);
Return whether the contact list can be changed.
If the TpBaseContactList subclass does not implement
TP_TYPE_MUTABLE_CONTACT_LIST
, this method always returns FALSE
.
For implementations of TP_TYPE_MUTABLE_CONTACT_LIST
this is a virtual
method, implemented using
TpMutableContactListInterface.can_change_contact_list.
The default implementation always returns TRUE
.
In the rare case of a protocol where subscriptions can only sometimes be
changed and this is detected while connecting, the TpBaseContactList
subclass should implement TP_TYPE_MUTABLE_CONTACT_LIST
.
TpMutableContactListInterface.can_change_contact_list to its own
implementation, whose result must remain constant after the
TpBaseConnection has moved to state TP_CONNECTION_STATUS_CONNECTED
.
(For instance, this could be useful for XMPP, where subscriptions can normally be altered, but on connections to Facebook Chat servers this is not actually supported.)
Since 0.13.0
gboolean
tp_base_contact_list_get_request_uses_message
(TpBaseContactList *self
);
Return whether the tp_base_contact_list_request_subscription_async()
method's message
argument is actually used.
If the TpBaseContactList subclass does not implement
TP_TYPE_MUTABLE_CONTACT_LIST
, this method is meaningless, and always
returns FALSE
.
For implementations of TP_TYPE_MUTABLE_CONTACT_LIST
, this is a virtual
method, implemented using
TpMutableContactListInterface.get_request_uses_message.
The default implementation always returns TRUE
, which is correct for most
protocols; subclasses may reimplement this method with
tp_base_contact_list_false_func()
or a custom implementation if desired.
TRUE
if tp_base_contact_list_request_subscription_async()
will not
ignore its message
argument
Since 0.13.0
void (*TpBaseContactListRequestSubscriptionFunc) (TpBaseContactList *self
,TpHandleSet *contacts
,const gchar *message
,GAsyncReadyCallback callback
,gpointer user_data
);
Signature of a virtual method to request permission to see some contacts' presence.
The virtual method should call tp_base_contact_list_contacts_changed()
for any contacts it has changed, before it calls callback
.
self |
the contact list manager |
|
contacts |
the contacts whose subscription is to be requested |
|
message |
an optional human-readable message from the user |
|
callback |
a callback to call on success, failure or disconnection |
|
user_data |
user data for the callback |
Since 0.13.0
void tp_base_contact_list_request_subscription_async (TpBaseContactList *self
,TpHandleSet *contacts
,const gchar *message
,GAsyncReadyCallback callback
,gpointer user_data
);
Request permission to see some contacts' presence.
If the TpBaseContactList subclass does not implement
TP_TYPE_MUTABLE_CONTACT_LIST
, it is an error to call this method.
For implementations of TP_TYPE_MUTABLE_CONTACT_LIST
, this is a virtual
method which must be implemented, using
TpMutableContactListInterface.request_subscription_async.
The implementation should call tp_base_contact_list_contacts_changed()
for any contacts it has changed, before it calls callback
.
If message
will be ignored,
TpMutableContactListInterface.get_request_uses_message should also be
reimplemented to return FALSE
.
self |
a contact list manager |
|
contacts |
the contacts whose subscription is to be requested |
|
message |
an optional human-readable message from the user |
|
callback |
a callback to call when the request for subscription succeeds or fails |
|
user_data |
optional data to pass to |
Since 0.13.0
gboolean tp_base_contact_list_request_subscription_finish (TpBaseContactList *self
,GAsyncResult *result
,GError **error
);
Interpret the result of an asynchronous call to
tp_base_contact_list_request_subscription_async()
.
If the TpBaseContactList subclass does not implement
TP_TYPE_MUTABLE_CONTACT_LIST
, it is an error to call this method.
For implementations of TP_TYPE_MUTABLE_CONTACT_LIST
, this is a virtual
method which may be implemented using
TpMutableContactListInterface.request_subscription_finish. If the result
will be a GSimpleAsyncResult, the default implementation may be used.
self |
a contact list manager |
|
result |
the result passed to |
|
error |
used to raise an error if |
Since 0.13.0
void (*TpBaseContactListActOnContactsFunc) (TpBaseContactList *self
,TpHandleSet *contacts
,GAsyncReadyCallback callback
,gpointer user_data
);
Signature of a virtual method that acts on a set of contacts and needs no additional information, such as removing contacts, approving or cancelling presence publication, cancelling presence subscription, or removing contacts.
The virtual method should call tp_base_contact_list_contacts_changed()
for any contacts it has changed, before returning.
self |
the contact list manager |
|
contacts |
the contacts on which to act |
|
callback |
a callback to call on success, failure or disconnection |
|
user_data |
user data for the callback |
Since 0.13.0
void tp_base_contact_list_authorize_publication_async (TpBaseContactList *self
,TpHandleSet *contacts
,GAsyncReadyCallback callback
,gpointer user_data
);
Give permission for some contacts to see the local user's presence.
If the TpBaseContactList subclass does not implement
TP_TYPE_MUTABLE_CONTACT_LIST
, it is an error to call this method.
For implementations of TP_TYPE_MUTABLE_CONTACT_LIST
, this is a virtual
method which must be implemented, using
TpMutableContactListInterface.authorize_publication_async.
The implementation should call tp_base_contact_list_contacts_changed()
for any contacts it has changed, before it calls callback
.
self |
a contact list manager |
|
contacts |
the contacts to whom presence will be published |
|
callback |
a callback to call when the authorization succeeds or fails |
|
user_data |
optional data to pass to |
Since 0.13.0
gboolean tp_base_contact_list_authorize_publication_finish (TpBaseContactList *self
,GAsyncResult *result
,GError **error
);
Interpret the result of an asynchronous call to
tp_base_contact_list_authorize_publication_async()
.
If the TpBaseContactList subclass does not implement
TP_TYPE_MUTABLE_CONTACT_LIST
, it is an error to call this method.
For implementations of TP_TYPE_MUTABLE_CONTACT_LIST
, this is a virtual
method which may be implemented using
TpMutableContactListInterface.authorize_publication_finish. If the result
will be a GSimpleAsyncResult, the default implementation may be used.
self |
a contact list manager |
|
result |
the result passed to |
|
error |
used to raise an error if |
Since 0.13.0
void tp_base_contact_list_store_contacts_async (TpBaseContactList *self
,TpHandleSet *contacts
,GAsyncReadyCallback callback
,gpointer user_data
);
Store contacts
on the contact list, without attempting to subscribe to
them or send presence to them. If this is not possible, do nothing.
If the TpBaseContactList subclass does not implement
TP_TYPE_MUTABLE_CONTACT_LIST
, it is an error to call this method.
For implementations of TP_TYPE_MUTABLE_CONTACT_LIST
, this is a virtual
method, which may be implemented using
TpMutableContactListInterface.store_contacts_async.
The implementation should call tp_base_contact_list_contacts_changed()
for any contacts it has changed, before calling callback
.
If the implementation of
TpMutableContactListInterface.store_contacts_async is NULL
(which is
the default), this method calls callback
to signal success, but does
nothing in the underlying protocol.
self |
a contact list manager |
|
contacts |
the contacts to be stored |
|
callback |
a callback to call when the operation succeeds or fails |
|
user_data |
optional data to pass to |
Since 0.13.0
gboolean tp_base_contact_list_store_contacts_finish (TpBaseContactList *self
,GAsyncResult *result
,GError **error
);
Interpret the result of an asynchronous call to
tp_base_contact_list_store_contacts_async()
.
If the TpBaseContactList subclass does not implement
TP_TYPE_MUTABLE_CONTACT_LIST
, it is an error to call this method.
For implementations of TP_TYPE_MUTABLE_CONTACT_LIST
, this is a virtual
method which may be implemented using
TpMutableContactListInterface.store_contacts_finish. If the result
will be a GSimpleAsyncResult, the default implementation may be used.
self |
a contact list manager |
|
result |
the result passed to |
|
error |
used to raise an error if |
Since 0.13.0
void tp_base_contact_list_remove_contacts_async (TpBaseContactList *self
,TpHandleSet *contacts
,GAsyncReadyCallback callback
,gpointer user_data
);
Remove contacts
from the contact list entirely; this includes the
effect of both tp_base_contact_list_unsubscribe_async()
and
tp_base_contact_list_unpublish_async()
, and also reverses the effect of
tp_base_contact_list_store_contacts_async()
.
If the TpBaseContactList subclass does not implement
TP_TYPE_MUTABLE_CONTACT_LIST
, this method does nothing.
For implementations of TP_TYPE_MUTABLE_CONTACT_LIST
, this is a virtual
method which must be implemented, using
TpMutableContactListInterface.remove_contacts_async.
The implementation should call tp_base_contact_list_contacts_changed()
for any contacts it has changed, before calling callback
.
self |
a contact list manager |
|
contacts |
the contacts to be removed |
|
callback |
a callback to call when the operation succeeds or fails |
|
user_data |
optional data to pass to |
Since 0.13.0
gboolean tp_base_contact_list_remove_contacts_finish (TpBaseContactList *self
,GAsyncResult *result
,GError **error
);
Interpret the result of an asynchronous call to
tp_base_contact_list_remove_contacts_async()
.
If the TpBaseContactList subclass does not implement
TP_TYPE_MUTABLE_CONTACT_LIST
, it is an error to call this method.
For implementations of TP_TYPE_MUTABLE_CONTACT_LIST
, this is a virtual
method which may be implemented using
TpMutableContactListInterface.remove_contacts_finish. If the result
will be a GSimpleAsyncResult, the default implementation may be used.
self |
a contact list manager |
|
result |
the result passed to |
|
error |
used to raise an error if |
Since 0.13.0
void tp_base_contact_list_unsubscribe_async (TpBaseContactList *self
,TpHandleSet *contacts
,GAsyncReadyCallback callback
,gpointer user_data
);
Cancel a pending subscription request to contacts
, or attempt to stop
receiving their presence.
If the TpBaseContactList subclass does not implement
TP_TYPE_MUTABLE_CONTACT_LIST
, it is an error to call this method.
For implementations of TP_TYPE_MUTABLE_CONTACT_LIST
, this is a virtual
method which must be implemented, using
TpMutableContactListInterface.unsubscribe_async.
The implementation should call tp_base_contact_list_contacts_changed()
for any contacts it has changed, before calling callback
.
self |
a contact list manager |
|
contacts |
the contacts whose presence will no longer be received |
|
callback |
a callback to call when the operation succeeds or fails |
|
user_data |
optional data to pass to |
Since 0.13.0
gboolean tp_base_contact_list_unsubscribe_finish (TpBaseContactList *self
,GAsyncResult *result
,GError **error
);
Interpret the result of an asynchronous call to
tp_base_contact_list_unsubscribe_async()
.
If the TpBaseContactList subclass does not implement
TP_TYPE_MUTABLE_CONTACT_LIST
, it is an error to call this method.
For implementations of TP_TYPE_MUTABLE_CONTACT_LIST
, this is a virtual
method which may be implemented using
TpMutableContactListInterface.unsubscribe_finish. If the result
will be a GSimpleAsyncResult, the default implementation may be used.
self |
a contact list manager |
|
result |
the result passed to |
|
error |
used to raise an error if |
Since 0.13.0
void tp_base_contact_list_unpublish_async (TpBaseContactList *self
,TpHandleSet *contacts
,GAsyncReadyCallback callback
,gpointer user_data
);
Reject a pending subscription request from contacts
, or attempt to stop
sending presence to them.
If the TpBaseContactList subclass does not implement
TP_TYPE_MUTABLE_CONTACT_LIST
, it is an error to call this method.
For implementations of TP_TYPE_MUTABLE_CONTACT_LIST
, this is a virtual
method which must be implemented, using
TpMutableContactListInterface.unpublish_async.
The implementation should call tp_base_contact_list_contacts_changed()
for any contacts it has changed, before calling callback
.
self |
a contact list manager |
|
contacts |
the contacts to whom presence will no longer be published |
|
callback |
a callback to call when the operation succeeds or fails |
|
user_data |
optional data to pass to |
Since 0.13.0
gboolean tp_base_contact_list_unpublish_finish (TpBaseContactList *self
,GAsyncResult *result
,GError **error
);
Interpret the result of an asynchronous call to
tp_base_contact_list_unpublish_async()
.
If the TpBaseContactList subclass does not implement
TP_TYPE_MUTABLE_CONTACT_LIST
, it is an error to call this method.
For implementations of TP_TYPE_MUTABLE_CONTACT_LIST
, this is a virtual
method which may be implemented using
TpMutableContactListInterface.unpublish_finish. If the result
will be a GSimpleAsyncResult, the default implementation may be used.
self |
a contact list manager |
|
result |
the result passed to |
|
error |
used to raise an error if |
Since 0.13.0
gchar * (*TpBaseContactListNormalizeFunc) (TpBaseContactList *self
,const gchar *s
);
Signature of a virtual method to normalize strings in a contact list manager.
Since 0.13.0
gchar * tp_base_contact_list_normalize_group (TpBaseContactList *self
,const gchar *s
);
Return a normalized form of the group name s
, or NULL
if a group of a
sufficiently similar name cannot be created.
If the TpBaseContactList subclass does not implement
TP_TYPE_CONTACT_GROUP_LIST
, this method is meaningless, and always
returns NULL
.
For implementations of TP_TYPE_CONTACT_GROUP_LIST
, this is a virtual
method, implemented using TpContactGroupListInterface.normalize_group.
If unimplemented, the default behaviour is to use the group's name as-is.
Protocols where this default is not suitable (for instance, if group names cannot be the empty string, or can only contain XML character data, or can only contain a particular Unicode normal form like NFKC) should reimplement this virtual method.
Since 0.13.0
GStrv (*TpBaseContactListDupContactGroupsFunc) (TpBaseContactList *self
,TpHandle contact
);
Signature of a virtual method that lists the groups to which contact
belongs.
If contact
is not on the contact list, this method must return either
NULL
or an empty array, without error.
Since 0.13.0
GStrv tp_base_contact_list_dup_contact_groups (TpBaseContactList *self
,TpHandle contact
);
Return a list of groups of which contact
is a member. It is incorrect to
call this method before tp_base_contact_list_set_list_received()
has been
called, after the connection has disconnected, or on a TpBaseContactList
that does not implement TP_TYPE_CONTACT_GROUP_LIST
.
If contact
is not on the contact list, this method must return either
NULL
or an empty array.
For implementations of TP_TYPE_CONTACT_GROUP_LIST
, this is a virtual
method, implemented using TpContactGroupListInterface.dup_contact_groups.
It must always be implemented.
Since 0.13.0
GStrv
(*TpBaseContactListDupGroupsFunc) (TpBaseContactList *self
);
Signature of a virtual method that lists every group that exists on a connection.
Since 0.13.0
GStrv
tp_base_contact_list_dup_groups (TpBaseContactList *self
);
Return a list of all groups on this connection. It is incorrect to call
this method before tp_base_contact_list_set_list_received()
has been
called, after the connection has disconnected, or on a TpBaseContactList
that does not implement TP_TYPE_CONTACT_GROUP_LIST
.
For implementations of TP_TYPE_CONTACT_GROUP_LIST
, this is a virtual
method, implemented using TpContactGroupListInterface.dup_groups.
It must always be implemented.
Since 0.13.0
TpHandleSet * (*TpBaseContactListDupGroupMembersFunc) (TpBaseContactList *self
,const gchar *group
);
Signature of a virtual method that lists the members of a group.
Since 0.13.0
TpHandleSet * tp_base_contact_list_dup_group_members (TpBaseContactList *self
,const gchar *group
);
Return the set of members of group
. It is incorrect to
call this method before tp_base_contact_list_set_list_received()
has been
called, after the connection has disconnected, or on a TpBaseContactList
that does not implement TP_TYPE_CONTACT_GROUP_LIST
.
If group
does not exist, this method must return either NULL
or an empty
set, without error.
For implementations of TP_TYPE_CONTACT_GROUP_LIST
, this is a virtual
method, implemented using TpContactGroupListInterface.dup_group_members.
It must always be implemented.
Since 0.13.0
void tp_base_contact_list_group_renamed (TpBaseContactList *self
,const gchar *old_name
,const gchar *new_name
);
Called by subclasses when a group has been renamed.
Calling tp_base_contact_list_dup_group_members()
for old_name
during this
method should return the group's old members. If this is done correctly by
a subclass, then tp_base_contact_list_groups_changed()
will automatically
be emitted for the members, and the subclass does not need to do so.
It is an error to call this method on a contact list that
does not implement TP_TYPE_CONTACT_GROUP_LIST
.
Since 0.13.0
void tp_base_contact_list_groups_changed (TpBaseContactList *self
,TpHandleSet *contacts
,const gchar * const *added
,gssize n_added
,const gchar * const *removed
,gssize n_removed
);
Called by subclasses when groups' membership has been changed.
If any of the groups in added
are not already known to exist,
this method also signals that they were created, as if
tp_base_contact_list_groups_created()
had been called first.
It is an error to call this method on a contact list that
does not implement TP_TYPE_CONTACT_GROUP_LIST
.
self |
a contact list manager |
|
contacts |
a set containing one or more contacts |
|
added |
zero or
more groups to which the |
[array length=n_added][element-type utf8][allow-none] |
n_added |
the number of groups added, or -1 if |
|
removed |
zero
or more groups from which the |
[array zero-terminated=1][element-type utf8][allow-none] |
n_removed |
the number of groups removed, or -1 if |
Since 0.13.0
void tp_base_contact_list_one_contact_groups_changed (TpBaseContactList *self
,TpHandle contact
,const gchar * const *added
,gssize n_added
,const gchar * const *removed
,gssize n_removed
);
Convenience wrapper around tp_base_contact_list_groups_changed()
for a
single handle in the 'contacts' set.
(There is no equivalent function for added
and removed
having trivial
contents, because you can already use NULL, 0
for an empty
list or &group_name, 1
for a single group.)
self |
the contact list manager |
|
contact |
a contact handle |
|
added |
zero or
more groups to which |
[array length=n_added][element-type utf8][allow-none] |
n_added |
the number of groups added, or -1 if |
|
removed |
zero
or more groups from which the |
[array zero-terminated=1][element-type utf8][allow-none] |
n_removed |
the number of groups removed, or -1 if |
Since 0.13.0
void tp_base_contact_list_groups_created (TpBaseContactList *self
,const gchar * const *created
,gssize n_created
);
Called by subclasses when new groups have been created. This will typically
be followed by a call to tp_base_contact_list_groups_changed()
to add
some members to those groups.
It is an error to call this method on a contact list that
does not implement TP_TYPE_CONTACT_GROUP_LIST
.
self |
a contact list manager |
|
created |
zero or more groups that were created. |
[array length=n_created][element-type utf8][allow-none] |
n_created |
the number of groups created, or -1 if |
Since 0.13.0
void tp_base_contact_list_groups_removed (TpBaseContactList *self
,const gchar * const *removed
,gssize n_removed
);
Called by subclasses when groups have been removed.
Calling tp_base_contact_list_dup_group_members()
during this method should
return the groups' old members. If this is done correctly by a subclass,
then tp_base_contact_list_groups_changed()
will automatically be emitted
for the old members, and the subclass does not need to do so.
It is an error to call this method on a contact list that
does not implement TP_TYPE_CONTACT_GROUP_LIST
.
self |
a contact list manager |
|
removed |
zero or more groups that were removed. |
[array length=n_removed][element-type utf8][allow-none] |
n_removed |
the number of groups removed, or -1 if |
Since 0.13.0
gboolean
tp_base_contact_list_has_disjoint_groups
(TpBaseContactList *self
);
Return whether groups in this protocol are disjoint
(i.e. each contact can be in at most one group).
This is merely informational: subclasses are responsible for making
appropriate calls to tp_base_contact_list_groups_changed()
, etc.
If the TpBaseContactList subclass does not implement
TP_TYPE_CONTACT_GROUP_LIST
, this method is meaningless, and always
returns FALSE
.
For implementations of TP_TYPE_CONTACT_GROUP_LIST
, this is a virtual
method, implemented using TpContactGroupListInterface.has_disjoint_groups.
The default implementation is tp_base_contact_list_false_func()
;
subclasses where groups are disjoint should use
tp_base_contact_list_true_func()
instead.
In the unlikely event that a protocol can have disjoint groups, or not,
determined at runtime, it can use a custom implementation.
Since 0.13.0
void (*TpBaseContactListSetContactGroupsFunc) (TpBaseContactList *self
,TpHandle contact
,const gchar * const *normalized_names
,gsize n_names
,GAsyncReadyCallback callback
,gpointer user_data
);
Signature of an implementation of
tp_base_contact_list_set_contact_groups_async()
.
self |
a contact list manager |
|
contact |
a contact handle |
|
normalized_names |
the normalized names of some groups. |
[array length=n_names] |
n_names |
the number of groups |
|
callback |
a callback to call on success, failure or disconnection |
|
user_data |
user data for the callback |
Since 0.13.0
void tp_base_contact_list_set_contact_groups_async (TpBaseContactList *self
,TpHandle contact
,const gchar * const *normalized_names
,gsize n_names
,GAsyncReadyCallback callback
,gpointer user_data
);
Add contact
to each group in normalized_names
, creating them if necessary,
and remove contact
from any other groups of which they are a member.
If the TpBaseContactList subclass does not implement
TP_TYPE_MUTABLE_CONTACT_GROUP_LIST
, it is an error to call this method.
For implementations of TP_TYPE_MUTABLE_CONTACT_GROUP_LIST
, this is a
virtual method which must be implemented, using
TpMutableContactGroupListInterface.set_contact_groups_async.
The implementation should call tp_base_contact_list_groups_changed()
for any changes it successfully made, before returning.
self |
a contact list manager |
|
contact |
a contact handle |
|
normalized_names |
the normalized names of some groups. |
[array length=n_names] |
n_names |
the number of groups |
|
callback |
a callback to call on success, failure or disconnection |
|
user_data |
user data for the callback |
Since 0.13.0
gboolean tp_base_contact_list_set_contact_groups_finish (TpBaseContactList *self
,GAsyncResult *result
,GError **error
);
Interpret the result of an asynchronous call to
tp_base_contact_list_set_contact_groups_async()
.
If the TpBaseContactList subclass does not implement
TP_TYPE_MUTABLE_CONTACT_GROUP_LIST
, it is an error to call this method.
For implementations of TP_TYPE_MUTABLE_CONTACT_GROUP_LIST
, this is a
virtual method which may be implemented using
TpMutableContactGroupListInterface.set_contact_groups_finish. If the
result
will be a GSimpleAsyncResult, the default implementation may be
used.
self |
a contact list manager |
|
result |
the result passed to |
|
error |
used to raise an error if |
Since 0.13.0
void (*TpBaseContactListGroupContactsFunc) (TpBaseContactList *self
,const gchar *group
,TpHandleSet *contacts
,GAsyncReadyCallback callback
,gpointer user_data
);
Signature of a virtual method that alters a group's members.
self |
a contact list manager |
|
group |
a group |
|
contacts |
a set of contact handles |
|
callback |
a callback to call on success, failure or disconnection |
|
user_data |
user data for the callback |
Since 0.13.0
void tp_base_contact_list_add_to_group_async (TpBaseContactList *self
,const gchar *group
,TpHandleSet *contacts
,GAsyncReadyCallback callback
,gpointer user_data
);
Add contacts
to group
, creating it if necessary.
If group
does not exist, the implementation should create it, even if
contacts
is empty.
If the TpBaseContactList subclass does not implement
TP_TYPE_MUTABLE_CONTACT_GROUP_LIST
, it is an error to call this method.
For implementations of TP_TYPE_MUTABLE_CONTACT_GROUP_LIST
, this is a
virtual method which must be implemented, using
TpMutableContactGroupListInterface.add_to_group_async.
The implementation should call tp_base_contact_list_groups_changed()
for any changes it successfully made, before calling callback
.
self |
a contact list manager |
|
group |
the normalized name of a group |
|
contacts |
some contacts (may be an empty set) |
|
callback |
a callback to call on success, failure or disconnection |
|
user_data |
user data for the callback |
Since 0.13.0
gboolean tp_base_contact_list_add_to_group_finish (TpBaseContactList *self
,GAsyncResult *result
,GError **error
);
Interpret the result of an asynchronous call to
tp_base_contact_list_add_to_group_async()
.
If the TpBaseContactList subclass does not implement
TP_TYPE_MUTABLE_CONTACT_GROUP_LIST
, it is an error to call this method.
For implementations of TP_TYPE_MUTABLE_CONTACT_GROUP_LIST
, this is a
virtual method which may be implemented using
TpMutableContactGroupListInterface.add_to_group_finish. If the result
will be a GSimpleAsyncResult, the default implementation may be used.
self |
a contact list manager |
|
result |
the result passed to |
|
error |
used to raise an error if |
Since 0.13.0
void tp_base_contact_list_remove_from_group_async (TpBaseContactList *self
,const gchar *group
,TpHandleSet *contacts
,GAsyncReadyCallback callback
,gpointer user_data
);
Remove contacts
from group
.
If the TpBaseContactList subclass does not implement
TP_TYPE_MUTABLE_CONTACT_GROUP_LIST
, it is an error to call this method.
For implementations of TP_TYPE_MUTABLE_CONTACT_GROUP_LIST
, this is a
virtual method which must be implemented, using
TpMutableContactGroupListInterface.remove_from_group_async.
The implementation should call tp_base_contact_list_groups_changed()
for any changes it successfully made, before calling callback
.
self |
a contact list manager |
|
group |
the normalized name of a group |
|
contacts |
some contacts |
|
callback |
a callback to call on success, failure or disconnection |
|
user_data |
user data for the callback |
Since 0.13.0
gboolean tp_base_contact_list_remove_from_group_finish (TpBaseContactList *self
,GAsyncResult *result
,GError **error
);
Interpret the result of an asynchronous call to
tp_base_contact_list_remove_from_group_async()
.
If the TpBaseContactList subclass does not implement
TP_TYPE_MUTABLE_CONTACT_GROUP_LIST
, it is an error to call this method.
For implementations of TP_TYPE_MUTABLE_CONTACT_GROUP_LIST
, this is a
virtual method which may be implemented using
TpMutableContactGroupListInterface.remove_from_group_finish. If the result
will be a GSimpleAsyncResult, the default implementation may be used.
self |
a contact list manager |
|
result |
the result passed to |
|
error |
used to raise an error if |
Since 0.13.0
void tp_base_contact_list_set_group_members_async (TpBaseContactList *self
,const gchar *normalized_group
,TpHandleSet *contacts
,GAsyncReadyCallback callback
,gpointer user_data
);
Set the members of normalized_group
to be exactly contacts
(i.e.
add contacts
, and simultaneously remove all members not in contacts
).
If normalized_group
does not exist, the implementation should create it,
even if contacts
is empty.
If the TpBaseContactList subclass does not implement
TP_TYPE_MUTABLE_CONTACT_GROUP_LIST
, it is an error to call this method.
For implementations of TP_TYPE_MUTABLE_CONTACT_GROUP_LIST
, this is a
virtual method which must be implemented, using
TpMutableContactGroupListInterface.set_group_members_async.
The implementation should call tp_base_contact_list_groups_changed()
for any changes it successfully made, before calling callback
.
self |
a contact list manager |
|
normalized_group |
the normalized name of a group |
|
contacts |
the contacts who should be in the group |
|
callback |
a callback to call on success, failure or disconnection |
|
user_data |
user data for the callback |
Since 0.13.0
gboolean tp_base_contact_list_set_group_members_finish (TpBaseContactList *self
,GAsyncResult *result
,GError **error
);
Interpret the result of an asynchronous call to
tp_base_contact_list_set_group_members_async()
.
If the TpBaseContactList subclass does not implement
TP_TYPE_MUTABLE_CONTACT_GROUP_LIST
, it is an error to call this method.
For implementations of TP_TYPE_MUTABLE_CONTACT_GROUP_LIST
, this is a virtual
method which may be implemented using
TpMutableContactGroupListInterface.set_group_members_finish. If the result
will be a GSimpleAsyncResult, the default implementation may be used.
self |
a contact list manager |
|
result |
the result passed to |
|
error |
used to raise an error if |
Since 0.13.0
void (*TpBaseContactListRemoveGroupFunc) (TpBaseContactList *self
,const gchar *group
,GAsyncReadyCallback callback
,gpointer user_data
);
Signature of a method that deletes groups.
self |
a contact list manager |
|
group |
the normalized name of a group |
|
callback |
a callback to call on success, failure or disconnection |
|
user_data |
user data for the callback |
Since 0.13.0
void tp_base_contact_list_remove_group_async (TpBaseContactList *self
,const gchar *group
,GAsyncReadyCallback callback
,gpointer user_data
);
Remove a group entirely, removing any members in the process.
If the TpBaseContactList subclass does not implement
TP_TYPE_MUTABLE_CONTACT_GROUP_LIST
, it is an error to call this method.
For implementations of TP_TYPE_MUTABLE_CONTACT_GROUP_LIST
, this is a
virtual method which must be implemented, using
TpMutableContactGroupListInterface.remove_group_async.
The implementation should call tp_base_contact_list_groups_removed()
for any groups it successfully removed, before calling callback
.
self |
a contact list manager |
|
group |
the normalized name of a group |
|
callback |
a callback to call on success, failure or disconnection |
|
user_data |
user data for the callback |
Since 0.13.0
gboolean tp_base_contact_list_remove_group_finish (TpBaseContactList *self
,GAsyncResult *result
,GError **error
);
Interpret the result of an asynchronous call to
tp_base_contact_list_remove_group_async()
.
If the TpBaseContactList subclass does not implement
TP_TYPE_MUTABLE_CONTACT_GROUP_LIST
, it is an error to call this method.
For implementations of TP_TYPE_MUTABLE_CONTACT_GROUP_LIST
, this is a
virtual method which may be implemented using
TpMutableContactGroupListInterface.remove_group_finish. If the result
will be a GSimpleAsyncResult, the default implementation may be used.
self |
a contact list manager |
|
result |
the result passed to |
|
error |
used to raise an error if |
Since 0.13.0
void (*TpBaseContactListRenameGroupFunc) (TpBaseContactList *self
,const gchar *old_name
,const gchar *new_name
,GAsyncReadyCallback callback
,gpointer user_data
);
Signature of a method that renames groups.
self |
a contact list manager |
|
old_name |
a group |
|
new_name |
a new name for the group |
|
callback |
a callback to call on success, failure or disconnection |
|
user_data |
user data for the callback |
Since 0.13.0
void tp_base_contact_list_rename_group_async (TpBaseContactList *self
,const gchar *old_name
,const gchar *new_name
,GAsyncReadyCallback callback
,gpointer user_data
);
Rename a group; if possible, do so as an atomic operation. If this protocol can't do that, emulate renaming in terms of other operations.
If the TpBaseContactList subclass does not implement
TP_TYPE_MUTABLE_CONTACT_GROUP_LIST
, it is an error to call this method.
For implementations of TP_TYPE_MUTABLE_CONTACT_GROUP_LIST
, this is a
virtual method which may be implemented, using
TpMutableContactGroupListInterface.rename_group_async.
If this virtual method is not implemented, the default is to implement renaming a group as creating the new group, adding all the old group's members to it, and removing the old group: this is appropriate for protocols like XMPP, in which groups behave more like tags.
The implementation should call tp_base_contact_list_group_renamed()
before
calling callback
.
self |
a contact list manager |
|
old_name |
the normalized name of a group, which must exist |
|
new_name |
a new normalized name for the group name |
|
callback |
a callback to call on success, failure or disconnection |
|
user_data |
user data for the callback |
Since 0.13.0
gboolean tp_base_contact_list_rename_group_finish (TpBaseContactList *self
,GAsyncResult *result
,GError **error
);
Interpret the result of an asynchronous call to
tp_base_contact_list_rename_group_async()
.
If the TpBaseContactList subclass does not implement
TP_TYPE_MUTABLE_CONTACT_GROUP_LIST
, it is an error to call this method.
For implementations of TP_TYPE_MUTABLE_CONTACT_GROUP_LIST
, this is a
virtual method which may be implemented using
TpMutableContactGroupListInterface.rename_group_finish. If the result
will be a GSimpleAsyncResult, the default implementation may be used.
self |
a contact list manager |
|
result |
the result passed to |
|
error |
used to raise an error if |
Since 0.13.0
TpContactMetadataStorageType
tp_base_contact_list_get_group_storage
(TpBaseContactList *self
);
Return the extent to which user-defined groups can be set in this protocol.
If this is TP_CONTACT_METADATA_STORAGE_TYPE_NONE
, methods that would alter
the group list will not be called.
If the TpBaseContactList subclass does not implement
TP_TYPE_MUTABLE_CONTACT_GROUP_LIST
, this method is meaningless, and always
returns TP_CONTACT_METADATA_STORAGE_TYPE_NONE
.
For implementations of TP_TYPE_MUTABLE_CONTACT_GROUP_LIST
, this is a
virtual method, implemented using
TpMutableContactGroupListInterface.get_group_storage.
The default implementation is NULL
, which is treated as equivalent to an
implementation that always returns TP_CONTACT_METADATA_STORAGE_TYPE_ANYONE
.
A custom implementation can also be used.
Since 0.13.0
void (*TpBaseContactListBlockContactsWithAbuseFunc) (TpBaseContactList *self
,TpHandleSet *contacts
,gboolean report_abusive
,GAsyncReadyCallback callback
,gpointer user_data
);
Signature of a virtual method that blocks a set of contacts, optionally reporting them to the server operator as abusive.
self |
the contact list manager |
|
contacts |
the contacts to block |
|
report_abusive |
whether to report the contacts as abusive to the server operator |
|
callback |
a callback to call on success, failure or disconnection |
|
user_data |
user data for the callback |
Since 0.15.1
gboolean
tp_base_contact_list_can_block (TpBaseContactList *self
);
Return whether this contact list has a list of blocked contacts. If it does, that list is assumed to be modifiable.
If the TpBaseContactList subclass does not implement
TP_TYPE_BLOCKABLE_CONTACT_LIST
, this method always returns FALSE
.
For implementations of TP_TYPE_BLOCKABLE_CONTACT_LIST
, this is a virtual
method, implemented using TpBlockableContactListInterface.can_block.
The default implementation always returns TRUE
.
In the case of a protocol where blocking may or may not work
and this is detected while connecting, the subclass can implement another
TpBaseContactListBooleanFunc (whose result must remain constant
after the TpBaseConnection has moved to state
TP_CONNECTION_STATUS_CONNECTED
), and use that as the implementation.
(For instance, this could be useful for XMPP, where support for contact blocking is server-dependent: telepathy-gabble 0.8.x implements it for connections to Google Talk servers, but not for any other server.)
Since 0.13.0
gboolean tp_base_contact_list_is_blocked (TpBaseContactList *self
,TpHandle contact
);
Return whether contact
is blocked. It is incorrect to call this method
before tp_base_contact_list_set_list_received()
has been called, after
the connection has disconnected, or on a TpBaseContactList that does
not implement TP_TYPE_BLOCKABLE_CONTACT_LIST
.
For implementations of TP_TYPE_BLOCKABLE_CONTACT_LIST
, this is a virtual
method, implemented using
TpBlockableContactListInterface.dup_blocked_contacts.
It must always be implemented.
The result of this method must always be consistent with the result
of tp_base_contact_list_dup_blocked_contacts()
. It can usually
use a more efficient implementation that does not require copying
a handle-set.
Since 0.99.6
TpHandleSet *
tp_base_contact_list_dup_blocked_contacts
(TpBaseContactList *self
);
Return the list of blocked contacts. It is incorrect to call this method
before tp_base_contact_list_set_list_received()
has been called, after
the connection has disconnected, or on a TpBaseContactList that does
not implement TP_TYPE_BLOCKABLE_CONTACT_LIST
.
For implementations of TP_TYPE_BLOCKABLE_CONTACT_LIST
, this is a virtual
method, implemented using
TpBlockableContactListInterface.dup_blocked_contacts.
It must always be implemented.
Since 0.13.0
void tp_base_contact_list_block_contacts_async (TpBaseContactList *self
,TpHandleSet *contacts
,GAsyncReadyCallback callback
,gpointer user_data
);
Request that the given contacts are prevented from communicating with the
user, and that presence is not sent to them even if they have a valid
presence subscription, if possible. This is equivalent to calling
tp_base_contact_list_block_contacts_with_abuse_async()
, passing FALSE as
the report_abusive argument.
If the TpBaseContactList subclass does not implement
TP_TYPE_BLOCKABLE_CONTACT_LIST
, it is an error to call this method.
For implementations of TP_TYPE_BLOCKABLE_CONTACT_LIST
, this is a virtual
method which must be implemented, using
TpBlockableContactListInterface.block_contacts_async or
TpBlockableContactListInterface.block_contacts_with_abuse_async.
The implementation should call
tp_base_contact_list_contact_blocking_changed()
for any contacts it has changed, before calling callback
.
self |
a contact list manager |
|
contacts |
contacts whose communications should be blocked |
|
callback |
a callback to call when the operation succeeds or fails |
|
user_data |
optional data to pass to |
Since 0.13.0
gboolean tp_base_contact_list_block_contacts_finish (TpBaseContactList *self
,GAsyncResult *result
,GError **error
);
Interpret the result of an asynchronous call to
tp_base_contact_list_block_contacts_async()
.
If the TpBaseContactList subclass does not implement
TP_TYPE_BLOCKABLE_CONTACT_LIST
, it is an error to call this method.
For implementations of TP_TYPE_BLOCKABLE_CONTACT_LIST
, this is a virtual
method which may be implemented using
TpBlockableContactListInterface.block_contacts_finish. If the result
will be a GSimpleAsyncResult, the default implementation may be used.
self |
a contact list manager |
|
result |
the result passed to |
|
error |
used to raise an error if |
Since 0.13.0
void tp_base_contact_list_block_contacts_with_abuse_async (TpBaseContactList *self
,TpHandleSet *contacts
,gboolean report_abusive
,GAsyncReadyCallback callback
,gpointer user_data
);
Request that the given contacts are prevented from communicating with the
user, and that presence is not sent to them even if they have a valid
presence subscription, if possible. If the TpBaseContactList subclass
implements TpBlockableContactListInterface.block_contacts_with_abuse_async
and report_abusive
is TRUE, also report the given contacts as abusive to
the server operator.
If the TpBaseContactList subclass does not implement
TP_TYPE_BLOCKABLE_CONTACT_LIST
, it is an error to call this method.
For implementations of TP_TYPE_BLOCKABLE_CONTACT_LIST
, this is a virtual
method which must be implemented, using
TpBlockableContactListInterface.block_contacts_async or
TpBlockableContactListInterface.block_contacts_with_abuse_async.
The implementation should call
tp_base_contact_list_contact_blocking_changed()
for any contacts it has changed, before calling callback
.
self |
a contact list manager |
|
contacts |
contacts whose communications should be blocked |
|
report_abusive |
whether to report the contacts as abusive to the server operator |
|
callback |
a callback to call when the operation succeeds or fails |
|
user_data |
optional data to pass to |
Since 0.15.1
gboolean tp_base_contact_list_block_contacts_with_abuse_finish (TpBaseContactList *self
,GAsyncResult *result
,GError **error
);
Interpret the result of an asynchronous call to
tp_base_contact_list_block_contacts_with_abuse_async()
.
If the TpBaseContactList subclass does not implement
TP_TYPE_BLOCKABLE_CONTACT_LIST
, it is an error to call this method.
For implementations of TP_TYPE_BLOCKABLE_CONTACT_LIST
, this is a virtual
method which may be implemented using
TpBlockableContactListInterface.block_contacts_finish. If the result
will be a GSimpleAsyncResult, the default implementation may be used.
self |
a contact list manager |
|
result |
the result passed to |
|
error |
used to raise an error if |
Since 0.15.1
void tp_base_contact_list_unblock_contacts_async (TpBaseContactList *self
,TpHandleSet *contacts
,GAsyncReadyCallback callback
,gpointer user_data
);
Reverse the effects of tp_base_contact_list_block_contacts_async()
.
If the TpBaseContactList subclass does not implement
TP_TYPE_BLOCKABLE_CONTACT_LIST
, this method does nothing.
For implementations of TP_TYPE_BLOCKABLE_CONTACT_LIST
, this is a virtual
method which must be implemented, using
TpBlockableContactListInterface.unblock_contacts_async.
The implementation should call
tp_base_contact_list_contact_blocking_changed()
for any contacts it has changed, before calling callback
.
self |
a contact list manager |
|
contacts |
contacts whose communications should no longer be blocked |
|
callback |
a callback to call when the operation succeeds or fails |
|
user_data |
optional data to pass to |
Since 0.13.0
gboolean tp_base_contact_list_unblock_contacts_finish (TpBaseContactList *self
,GAsyncResult *result
,GError **error
);
Interpret the result of an asynchronous call to
tp_base_contact_list_unblock_contacts_async()
.
If the TpBaseContactList subclass does not implement
TP_TYPE_BLOCKABLE_CONTACT_LIST
, it is an error to call this method.
For implementations of TP_TYPE_BLOCKABLE_CONTACT_LIST
, this is a virtual
method which may be implemented using
TpBlockableContactListInterface.unblock_contacts_finish. If the result
will be a GSimpleAsyncResult, the default implementation may be used.
self |
a contact list manager |
|
result |
the result passed to |
|
error |
used to raise an error if |
Since 0.13.0
void tp_base_contact_list_contact_blocking_changed (TpBaseContactList *self
,TpHandleSet *changed
);
Emit signals for a change to the blocked contacts list.
tp_base_contact_list_dup_blocked_contacts() must already reflect the contacts' new statuses when entering this method (in practice, this means that implementations must update their own cache of contacts before calling this method).
It is an error to call this method if tp_base_contact_list_can_block()
would return FALSE
.
Since 0.13.0
struct TpBaseContactList;
A connection's contact list (roster, buddy list) inside a connection manager. Each TpBaseConnection may have at most one TpBaseContactList.
This abstract base class provides the Telepathy "view" of the contact list: subclasses must provide access to the "model" by implementing its virtual methods in terms of the protocol's real contact list (e.g. the XMPP roster object in Wocky).
The implementation must call tp_base_contact_list_set_list_received()
exactly once, when the initial set of contacts has been received (or
immediately, if that condition is not meaningful for the protocol).
Since 0.13.0
struct TpBaseContactListClass { GObjectClass parent_class; TpBaseContactListDupContactsFunc dup_contacts; TpBaseContactListDupStatesFunc dup_states; TpBaseContactListBooleanFunc get_contact_list_persists; TpBaseContactListAsyncFunc download_async; TpBaseContactListAsyncFinishFunc download_finish; };
The class of a TpBaseContactList.
Additional functionality can be added by implementing GInterfaces.
Most subclasses should implement TP_TYPE_MUTABLE_CONTACT_LIST
, which allows
the contact list to be altered.
Subclasses may implement TP_TYPE_BLOCKABLE_CONTACT_LIST
if contacts can
be blocked from communicating with the user.
GObjectClass |
the parent class |
|
TpBaseContactListDupContactsFunc |
the implementation of |
|
TpBaseContactListDupStatesFunc |
the implementation of
|
|
TpBaseContactListBooleanFunc |
the implementation of
|
|
TpBaseContactListAsyncFunc |
the implementation of
|
|
TpBaseContactListAsyncFinishFunc |
the implementation of
|
Since 0.13.0
#define TP_TYPE_MUTABLE_CONTACT_LIST
Interface representing a TpBaseContactList on which the contact list can potentially be changed.
Since 0.13.0
struct TpMutableContactListInterface { GTypeInterface parent; /* _async mandatory-to-implement, _finish has a default implementation * suitable for a GSimpleAsyncResult */ TpBaseContactListRequestSubscriptionFunc request_subscription_async; TpBaseContactListAsyncFinishFunc request_subscription_finish; TpBaseContactListActOnContactsFunc authorize_publication_async; TpBaseContactListAsyncFinishFunc authorize_publication_finish; TpBaseContactListActOnContactsFunc remove_contacts_async; TpBaseContactListAsyncFinishFunc remove_contacts_finish; TpBaseContactListActOnContactsFunc unsubscribe_async; TpBaseContactListAsyncFinishFunc unsubscribe_finish; TpBaseContactListActOnContactsFunc unpublish_async; TpBaseContactListAsyncFinishFunc unpublish_finish; /* optional-to-implement */ TpBaseContactListActOnContactsFunc store_contacts_async; TpBaseContactListAsyncFinishFunc store_contacts_finish; TpBaseContactListBooleanFunc can_change_contact_list; TpBaseContactListBooleanFunc get_request_uses_message; };
The interface vtable for a TP_TYPE_MUTABLE_CONTACT_LIST
.
GTypeInterface |
the parent interface |
|
TpBaseContactListRequestSubscriptionFunc |
the implementation of
|
|
TpBaseContactListAsyncFinishFunc |
the implementation of
|
|
TpBaseContactListActOnContactsFunc |
the implementation of
|
|
TpBaseContactListAsyncFinishFunc |
the implementation of
|
|
TpBaseContactListActOnContactsFunc |
the implementation of
|
|
TpBaseContactListAsyncFinishFunc |
the implementation of
|
|
TpBaseContactListActOnContactsFunc |
the implementation of
|
|
TpBaseContactListAsyncFinishFunc |
the implementation of
|
|
TpBaseContactListActOnContactsFunc |
the implementation of
|
|
TpBaseContactListAsyncFinishFunc |
the implementation of
|
|
TpBaseContactListActOnContactsFunc |
the implementation of
|
|
TpBaseContactListAsyncFinishFunc |
the implementation of
|
|
TpBaseContactListBooleanFunc |
the implementation of
|
|
TpBaseContactListBooleanFunc |
the implementation of
|
Since 0.13.0
#define TP_TYPE_CONTACT_GROUP_LIST
Interface representing a TpBaseContactList on which contacts can
be in user-defined groups, which cannot necessarily be edited
(TP_TYPE_MUTABLE_CONTACT_GROUP_LIST
represents a list where these
groups exist and can also be edited).
Since 0.13.0
struct TpContactGroupListInterface { GTypeInterface parent; /* mandatory to implement */ TpBaseContactListDupGroupsFunc dup_groups; TpBaseContactListDupGroupMembersFunc dup_group_members; TpBaseContactListDupContactGroupsFunc dup_contact_groups; /* optional to implement */ TpBaseContactListBooleanFunc has_disjoint_groups; TpBaseContactListNormalizeFunc normalize_group; };
The interface vtable for a TP_TYPE_CONTACT_GROUP_LIST
.
GTypeInterface |
the parent interface |
|
TpBaseContactListDupGroupsFunc |
the implementation of
|
|
TpBaseContactListDupGroupMembersFunc |
the implementation of
|
|
TpBaseContactListDupContactGroupsFunc |
the implementation of
|
|
TpBaseContactListBooleanFunc |
the implementation of
|
|
TpBaseContactListNormalizeFunc |
the implementation of
|
Since 0.13.0
#define TP_TYPE_MUTABLE_CONTACT_GROUP_LIST
Interface representing a TpBaseContactList on which user-defined contact
groups can potentially be changed. TP_TYPE_CONTACT_GROUP_LIST
is a
prerequisite for this interface.
Since 0.13.0
struct TpMutableContactGroupListInterface { GTypeInterface parent; /* _async mandatory-to-implement, _finish has a default implementation * suitable for a GSimpleAsyncResult */ TpBaseContactListSetContactGroupsFunc set_contact_groups_async; TpBaseContactListAsyncFinishFunc set_contact_groups_finish; TpBaseContactListGroupContactsFunc set_group_members_async; TpBaseContactListAsyncFinishFunc set_group_members_finish; TpBaseContactListGroupContactsFunc add_to_group_async; TpBaseContactListAsyncFinishFunc add_to_group_finish; TpBaseContactListGroupContactsFunc remove_from_group_async; TpBaseContactListAsyncFinishFunc remove_from_group_finish; TpBaseContactListRemoveGroupFunc remove_group_async; TpBaseContactListAsyncFinishFunc remove_group_finish; /* optional to implement */ TpBaseContactListRenameGroupFunc rename_group_async; TpBaseContactListAsyncFinishFunc rename_group_finish; TpBaseContactListUIntFunc get_group_storage; };
The interface vtable for a TP_TYPE_MUTABLE_CONTACT_GROUP_LIST
.
GTypeInterface |
the parent interface |
|
TpBaseContactListSetContactGroupsFunc |
the implementation of
|
|
TpBaseContactListAsyncFinishFunc |
the implementation of
|
|
TpBaseContactListGroupContactsFunc |
the implementation of
|
|
TpBaseContactListAsyncFinishFunc |
the implementation of
|
|
TpBaseContactListGroupContactsFunc |
the implementation of
|
|
TpBaseContactListAsyncFinishFunc |
the implementation of
|
|
TpBaseContactListGroupContactsFunc |
the implementation of
|
|
TpBaseContactListAsyncFinishFunc |
the implementation of
|
|
TpBaseContactListRemoveGroupFunc |
the implementation of
|
|
TpBaseContactListAsyncFinishFunc |
the implementation of
|
|
TpBaseContactListRenameGroupFunc |
the implementation of
|
|
TpBaseContactListAsyncFinishFunc |
the implementation of
|
|
TpBaseContactListUIntFunc |
the implementation of
|
Since 0.13.0
#define TP_TYPE_BLOCKABLE_CONTACT_LIST
Interface representing a TpBaseContactList on which contacts can be blocked from communicating with the user.
Since 0.13.0
struct TpBlockableContactListInterface { GTypeInterface parent; /* mandatory to implement */ gboolean (*is_blocked) (TpBaseContactList *self, TpHandle contact); TpBaseContactListDupContactsFunc dup_blocked_contacts; /* unblock_contacts_async is mandatory to implement; either * block_contacts_async or block_contacts_with_abuse_async (but not both!) * must also be implemented. _finish have default implementations * suitable for a GSimpleAsyncResult */ TpBaseContactListActOnContactsFunc block_contacts_async; TpBaseContactListAsyncFinishFunc block_contacts_finish; TpBaseContactListActOnContactsFunc unblock_contacts_async; TpBaseContactListAsyncFinishFunc unblock_contacts_finish; /* optional to implement */ TpBaseContactListBooleanFunc can_block; /* see above. block_contacts_finish is the corresponding _finish function. */ TpBaseContactListBlockContactsWithAbuseFunc block_contacts_with_abuse_async; };
The interface vtable for a TP_TYPE_BLOCKABLE_CONTACT_LIST
.
GTypeInterface |
the parent interface |
|
the implementation of
|
||
TpBaseContactListDupContactsFunc |
the implementation of
|
|
TpBaseContactListActOnContactsFunc |
the implementation of
|
|
TpBaseContactListAsyncFinishFunc |
the implementation of
|
|
TpBaseContactListActOnContactsFunc |
the implementation of
|
|
TpBaseContactListAsyncFinishFunc |
the implementation of
|
|
TpBaseContactListBooleanFunc |
the implementation of
|
|
TpBaseContactListBlockContactsWithAbuseFunc |
the implementation of
|
Since 0.13.0
“connection”
property“connection” TpBaseConnection *
The connection that owns this contact list. Read-only except during construction.
Flags: Read / Write / Construct Only
Since 0.13.0
“download-at-connection”
property“download-at-connection” gboolean
Whether the roster should be automatically downloaded at connection.
This property doesn't change anything in TpBaseContactsList's behaviour. Implementations should check this property when they become connected and in their Download method, and behave accordingly.
Flags: Read / Write / Construct
Default value: TRUE
Since 0.18.0