libpurple/purplecontact.h

Sat, 01 Oct 2022 01:50:52 -0500

author
Gary Kramlich <grim@reaperworld.com>
date
Sat, 01 Oct 2022 01:50:52 -0500
changeset 41771
c5877e2c93f2
parent 41759
1ecc0512e714
child 41917
b3eda1d781c6
permissions
-rw-r--r--

Create and add PurpleContacts to the manager when purple_buddy_new is called

This required some additional changes to PurpleContact. Namely that the contact always has a presence and it is no longer writeable.

Testing Done:
Ran the unit tests and verified nothing funky happens when running.

We can't test that all of the properties are properly bound because we would have to start up a lot more of libpurple than I'm willing to do for something that's temporary.

Bugs closed: PIDGIN-17685

Reviewed at https://reviews.imfreedom.org/r/1873/

41739
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
1 /*
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
2 * Purple - Internet Messaging Library
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
3 * Copyright (C) Pidgin Developers <devel@pidgin.im>
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
4 *
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
5 * This program is free software; you can redistribute it and/or modify
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
6 * it under the terms of the GNU General Public License as published by
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
7 * the Free Software Foundation; either version 2 of the License, or
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
8 * (at your option) any later version.
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
9 *
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
10 * This program is distributed in the hope that it will be useful,
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
13 * GNU General Public License for more details.
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
14 *
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
16 * along with this program; if not, see <https://www.gnu.org/licenses/>.
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
17 */
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
18
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
19 #if !defined(PURPLE_GLOBAL_HEADER_INSIDE) && !defined(PURPLE_COMPILATION)
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
20 # error "only <pidgin.h> may be included directly"
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
21 #endif
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
22
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
23 #ifndef PURPLE_CONTACT_H
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
24 #define PURPLE_CONTACT_H
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
25
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
26 #include <glib.h>
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
27 #include <glib-object.h>
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
28
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
29 #include <gdk-pixbuf/gdk-pixbuf.h>
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
30
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
31 #include <libpurple/account.h>
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
32 #include <libpurple/purpletags.h>
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
33
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
34 G_BEGIN_DECLS
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
35
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
36 #define PURPLE_TYPE_CONTACT (purple_contact_get_type())
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
37 G_DECLARE_FINAL_TYPE(PurpleContact, purple_contact, PURPLE, CONTACT, GObject)
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
38
41755
b7e6166e5300 Add a person property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents: 41753
diff changeset
39 #include <libpurple/purpleperson.h>
b7e6166e5300 Add a person property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents: 41753
diff changeset
40
41739
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
41 /**
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
42 * PurpleContact:
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
43 *
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
44 * A representation of a user. Contacts are used everywhere you need to refer to
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
45 * a user. Be it a chat, an direct message, a file transfer, etc.
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
46 */
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
47
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
48 /**
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
49 * purple_contact_new:
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
50 * @account: The [class@Purple.Account] this contact is from.
41759
1ecc0512e714 Make purple_contact_new take the id instead of the username.
Gary Kramlich <grim@reaperworld.com>
parents: 41755
diff changeset
51 * @id: (nullable): The id of the contact.
41739
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
52 *
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
53 * Creates a new [class@Purple.Contact].
41759
1ecc0512e714 Make purple_contact_new take the id instead of the username.
Gary Kramlich <grim@reaperworld.com>
parents: 41755
diff changeset
54 *
1ecc0512e714 Make purple_contact_new take the id instead of the username.
Gary Kramlich <grim@reaperworld.com>
parents: 41755
diff changeset
55 * If @id is %NULL, an ID will be randomly generated.
1ecc0512e714 Make purple_contact_new take the id instead of the username.
Gary Kramlich <grim@reaperworld.com>
parents: 41755
diff changeset
56 *
1ecc0512e714 Make purple_contact_new take the id instead of the username.
Gary Kramlich <grim@reaperworld.com>
parents: 41755
diff changeset
57 * Returns: (transfer full): The new instance.
1ecc0512e714 Make purple_contact_new take the id instead of the username.
Gary Kramlich <grim@reaperworld.com>
parents: 41755
diff changeset
58 *
1ecc0512e714 Make purple_contact_new take the id instead of the username.
Gary Kramlich <grim@reaperworld.com>
parents: 41755
diff changeset
59 * Since: 3.0.0
41739
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
60 */
41759
1ecc0512e714 Make purple_contact_new take the id instead of the username.
Gary Kramlich <grim@reaperworld.com>
parents: 41755
diff changeset
61 PurpleContact *purple_contact_new(PurpleAccount *account, const gchar *id);
41739
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
62
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
63 /**
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
64 * purple_contact_get_account:
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
65 * @contact: The instance.
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
66 *
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
67 * Gets the [class@Purple.Account] that @contact belongs to.
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
68 *
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
69 * Returns: (transfer none): The [class@Purple.Account] that @contact belongs
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
70 * to.
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
71 *
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
72 * Since: 3.0.0
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
73 */
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
74 PurpleAccount *purple_contact_get_account(PurpleContact *contact);
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
75
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
76 /**
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
77 * purple_contact_get_id:
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
78 * @contact: The instance.
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
79 *
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
80 * Gets the id of @contact.
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
81 *
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
82 * If a protocol would like to set this, it should call
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
83 * [ctor@GObject.Object.new] and pass in the id attribute manually.
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
84 *
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
85 * Returns: The id of the contact.
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
86 *
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
87 * Since: 3.0.0
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
88 */
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
89 const gchar *purple_contact_get_id(PurpleContact *contact);
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
90
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
91 /**
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
92 * purple_contact_get_username:
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
93 * @contact: The instance.
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
94 *
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
95 * Gets the username of @contact.
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
96 *
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
97 * Returns: The username of @contact.
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
98 *
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
99 * Since: 3.0.0
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
100 */
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
101 const gchar *purple_contact_get_username(PurpleContact *contact);
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
102
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
103 /**
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
104 * purple_contact_set_username:
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
105 * @contact: The instance.
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
106 * @username: The new username.
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
107 *
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
108 * Sets the username of @contact to @username.
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
109 *
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
110 * This is primarily used by protocol plugins like IRC when a user changes
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
111 * their "nick" which is their username.
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
112 *
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
113 * Since: 3.0.0
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
114 */
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
115 void purple_contact_set_username(PurpleContact *contact, const gchar *username);
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
116
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
117 /**
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
118 * purple_contact_get_display_name:
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
119 * @contact: The instance.
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
120 *
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
121 * Gets the display name for @contact. The display name is typically set by the
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
122 * contact and is handled by the protocol plugin.
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
123 *
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
124 * Returns: (nullable): The display name of @contact if one is set, otherwise
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
125 * %NULL will be returned.
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
126 *
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
127 * Since: 3.0.0
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
128 */
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
129 const gchar *purple_contact_get_display_name(PurpleContact *contact);
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
130
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
131 /**
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
132 * purple_contact_set_display_name:
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
133 * @contact: The instance.
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
134 * @display_name: (nullable): The new displayname.
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
135 *
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
136 * Sets the display name of @contact to @display_name.
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
137 *
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
138 * This should primarily only be used by protocol plugins and everyone else
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
139 * should be using [method@Purple.Contact.set_alias].
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
140 *
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
141 * Since: 3.0.0
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
142 */
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
143 void purple_contact_set_display_name(PurpleContact *contact, const gchar *display_name);
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
144
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
145 /**
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
146 * purple_contact_get_alias:
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
147 * @contact: The instance.
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
148 *
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
149 * Gets the alias for @contact.
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
150 *
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
151 * Returns: (nullable): The alias of @contact if one is set, otherwise %NULL.
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
152 *
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
153 * Since: 3.0.0
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
154 */
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
155 const gchar *purple_contact_get_alias(PurpleContact *contact);
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
156
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
157 /**
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
158 * purple_contact_set_alias:
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
159 * @contact: The instance.
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
160 * @alias: (nullable): The new alias.
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
161 *
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
162 * Sets the alias of @contact to @alias.
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
163 *
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
164 * Protocol plugins may use this value to synchronize across instances.
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
165 *
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
166 * Since: 3.0.0
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
167 */
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
168 void purple_contact_set_alias(PurpleContact *contact, const gchar *alias);
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
169
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
170 /**
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
171 * purple_contact_get_avatar:
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
172 * @contact: The instance.
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
173 *
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
174 * Gets the avatar for @contact if one is set.
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
175 *
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
176 * Returns: (transfer none): The avatar if set, otherwise %NULL.
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
177 *
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
178 * Since: 3.0.0
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
179 */
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
180 GdkPixbuf *purple_contact_get_avatar(PurpleContact *contact);
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
181
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
182 /**
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
183 * purple_contact_set_avatar:
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
184 * @contact: The instance.
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
185 * @avatar: (nullable): The new avatar to set.
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
186 *
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
187 * Sets the avatar for @contact to @avatar. If @avatar is %NULL an existing
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
188 * avatar will be removed.
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
189 *
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
190 * Typically this should only called by the protocol plugin.
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
191 *
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
192 * Since: 3.0.0
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
193 */
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
194 void purple_contact_set_avatar(PurpleContact *contact, GdkPixbuf *avatar);
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
195
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
196 /**
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
197 * purple_contact_get_presence:
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
198 * @contact: The instance.
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
199 *
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
200 * Gets the [class@Purple.Presence] for @contact.
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
201 *
41753
316c1207f787 Fix various small documentation errors
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41739
diff changeset
202 * Returns: (transfer none) (nullable): The presence for @contact if one is
316c1207f787 Fix various small documentation errors
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41739
diff changeset
203 * set, otherwise %NULL.
41739
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
204 *
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
205 * Since: 3.0.0
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
206 */
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
207 PurplePresence *purple_contact_get_presence(PurpleContact *contact);
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
208
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
209 /**
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
210 * purple_contact_get_tags:
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
211 * @contact: The instance.
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
212 *
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
213 * Gets the [class@Purple.Tags] instance for @contact.
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
214 *
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
215 * Returns: (transfer none): The tags for @contact.
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
216 *
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
217 * Since: 3.0.0
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
218 */
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
219 PurpleTags *purple_contact_get_tags(PurpleContact *contact);
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
220
41755
b7e6166e5300 Add a person property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents: 41753
diff changeset
221 /**
b7e6166e5300 Add a person property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents: 41753
diff changeset
222 * purple_contact_set_person:
b7e6166e5300 Add a person property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents: 41753
diff changeset
223 * @contact: The instance.
b7e6166e5300 Add a person property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents: 41753
diff changeset
224 * @person: (nullable): The new [class@Purple.Person] or %NULL.
b7e6166e5300 Add a person property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents: 41753
diff changeset
225 *
b7e6166e5300 Add a person property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents: 41753
diff changeset
226 * Sets the person that @contact belongs to to @person.
b7e6166e5300 Add a person property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents: 41753
diff changeset
227 *
b7e6166e5300 Add a person property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents: 41753
diff changeset
228 * Since: 3.0.0
b7e6166e5300 Add a person property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents: 41753
diff changeset
229 */
b7e6166e5300 Add a person property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents: 41753
diff changeset
230 void purple_contact_set_person(PurpleContact *contact, PurplePerson *person);
b7e6166e5300 Add a person property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents: 41753
diff changeset
231
b7e6166e5300 Add a person property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents: 41753
diff changeset
232 /**
b7e6166e5300 Add a person property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents: 41753
diff changeset
233 * purple_contact_get_person:
b7e6166e5300 Add a person property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents: 41753
diff changeset
234 * @contact: The instance.
b7e6166e5300 Add a person property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents: 41753
diff changeset
235 *
b7e6166e5300 Add a person property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents: 41753
diff changeset
236 * Gets the [class@Purple.Person] that @contact belongs to.
b7e6166e5300 Add a person property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents: 41753
diff changeset
237 *
b7e6166e5300 Add a person property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents: 41753
diff changeset
238 * Returns: (transfer none) (nullable): The [class@Purple.Person] that @contact
b7e6166e5300 Add a person property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents: 41753
diff changeset
239 * belongs to, or %NULL.
b7e6166e5300 Add a person property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents: 41753
diff changeset
240 *
b7e6166e5300 Add a person property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents: 41753
diff changeset
241 * Since: 3.0.0
b7e6166e5300 Add a person property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents: 41753
diff changeset
242 */
b7e6166e5300 Add a person property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents: 41753
diff changeset
243 PurplePerson *purple_contact_get_person(PurpleContact *contact);
b7e6166e5300 Add a person property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents: 41753
diff changeset
244
41739
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
245 G_END_DECLS
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
246
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
247 #endif /* PURPLE_CONTACT_H */

mercurial