WockyBareContact

WockyBareContact — Wrapper around a roster item.

Functions

Properties

GStrv groups Read / Write / Construct
gchar * jid Read / Write / Construct Only
gchar * name Read / Write / Construct
guint subscription Read / Write / Construct

Types and Values

Object Hierarchy

    GObject
    ╰── WockyContact
        ╰── WockyBareContact

Includes

#include <wocky/wocky-bare-contact.h>

Description

Stores information regarding a roster item and provides a higher level API for altering its details.

Functions

wocky_bare_contact_new ()

WockyBareContact *
wocky_bare_contact_new (const gchar *jid);

Creates a new WockyBareContact for a given JID.

Parameters

jid

the JID of the contact to create

 

Returns

a newly constructed WockyBareContact


wocky_bare_contact_get_jid ()

const gchar *
wocky_bare_contact_get_jid (WockyBareContact *contact);

Returns the JID of the contact wrapped by contact .

Parameters

contact

a WockyBareContact instance

 

Returns

contact 's JID.


wocky_bare_contact_get_name ()

const gchar *
wocky_bare_contact_get_name (WockyBareContact *contact);

Returns the name of the contact wrapped by contact .

Parameters

contact

WockyBareContact instance

 

Returns

contact 's name


wocky_bare_contact_set_name ()

void
wocky_bare_contact_set_name (WockyBareContact *contact,
                             const gchar *name);

Sets contact 's name to name .

Parameters

contact

a WockyBareContact instance

 

name

the name to set contact

 

wocky_bare_contact_get_subscription ()

WockyRosterSubscriptionFlags
wocky_bare_contact_get_subscription (WockyBareContact *contact);

Gets the subscription type contact has.

Parameters

contact

a WockyBareContact instance

 

Returns

contact 's subscription.


wocky_bare_contact_set_subscription ()

void
wocky_bare_contact_set_subscription (WockyBareContact *contact,
                                     WockyRosterSubscriptionFlags subscription);

Sets the subscription of contact .

Parameters

contact

a WockyBareContact instance

 

subscription

the new subscription type

 

wocky_bare_contact_get_groups ()

const gchar * const *
wocky_bare_contact_get_groups (WockyBareContact *contact);

Returns the list of the groups of contact .

Parameters

contact

a WockyBareContact instance

 

Returns

a list of contact 's groups


wocky_bare_contact_set_groups ()

void
wocky_bare_contact_set_groups (WockyBareContact *contact,
                               gchar **groups);

Sets contact 's groups.

Parameters

contact

a WockyBareContact instance

 

groups

a list of groups

 

wocky_bare_contact_equal ()

gboolean
wocky_bare_contact_equal (WockyBareContact *a,
                          WockyBareContact *b);

Compares whether two WockyBareContact instances refer to the same roster item.

Parameters

a

a WockyBareContact instance

 

b

a WockyBareContact instance to compare with a

 

Returns

TRUE if the two contacts match.


wocky_bare_contact_add_group ()

void
wocky_bare_contact_add_group (WockyBareContact *contact,
                              const gchar *group);

Adds group to contact's groups.

Parameters

contact

a WockyBareContact instance

 

group

a group

 

wocky_bare_contact_in_group ()

gboolean
wocky_bare_contact_in_group (WockyBareContact *contact,
                             const gchar *group);

Determines whether the given contact is in group .

Parameters

contact

a WockyBareContact instance

 

group

a group

 

Returns

TRUE if the contact is in the given group.


wocky_bare_contact_remove_group ()

void
wocky_bare_contact_remove_group (WockyBareContact *contact,
                                 const gchar *group);

Removes group from the contact's groups.

Parameters

contact

a WockyBareContact instance

 

group

a group

 

wocky_bare_contact_copy ()

WockyBareContact *
wocky_bare_contact_copy (WockyBareContact *contact);

Convenience function to obtain a copy of the given WockyBareContact.

Parameters

contact

a WockyBareContact instance

 

Returns

a newly created WockyBareContact which is a copy of the given one.


wocky_bare_contact_debug_print ()

void
wocky_bare_contact_debug_print (WockyBareContact *contact);

Prints debug information for the given WockyBareContact.

Parameters

contact

a WockyBareContact instance

 

wocky_bare_contact_add_resource ()

void
wocky_bare_contact_add_resource (WockyBareContact *contact,
                                 WockyResourceContact *resource);

Adds resource to the contact's resources. The WockyBareContact instance doesn't assume a reference to resource .

Parameters

contact

a WockyBareContact instance

 

resource

a WockyResourceContact instance

 

wocky_bare_contact_get_resources ()

GSList *
wocky_bare_contact_get_resources (WockyBareContact *contact);

Gets a GSList of all the contact's resources. You should call g_slist_free on the list when done with it.

Parameters

contact

a WockyBareContact instance

 

Returns

a GSList of WockyResourceContact objects.

Types and Values

struct WockyBareContactClass

struct WockyBareContactClass {
};

The class of a WockyBareContact.

Property Details

The “groups” property

  “groups”                   GStrv

A list of the contact's groups, according to the roster.

Flags: Read / Write / Construct


The “jid” property

  “jid”                      gchar *

The contact's bare JID, according to the roster.

Flags: Read / Write / Construct Only

Default value: ""


The “name” property

  “name”                     gchar *

The contact's name, according to the roster.

Flags: Read / Write / Construct

Default value: ""


The “subscription” property

  “subscription”             guint

The subscription type of the contact, according to the roster.

Flags: Read / Write / Construct

Allowed values: <= 3

Default value: 0