Tue, 20 Feb 2024 01:23:04 -0600
Create a test for verifying license headers and correct the ones that were wrong
We might want to move check_license_header.py script out to somewhere else,
but this is fine for now as we're just getting things going.
Testing Done:
Compiled with the Turtles.
Reviewed at https://reviews.imfreedom.org/r/2940/
|
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 | * |
|
42594
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42532
diff
changeset
|
5 | * Purple is the legal property of its developers, whose names are too numerous |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42532
diff
changeset
|
6 | * to list here. Please refer to the COPYRIGHT file distributed with this |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42532
diff
changeset
|
7 | * source distribution. |
|
41739
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
8 | * |
|
42594
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42532
diff
changeset
|
9 | * This library is free software; you can redistribute it and/or modify it |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42532
diff
changeset
|
10 | * under the terms of the GNU General Public License as published by the Free |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42532
diff
changeset
|
11 | * Software Foundation; either version 2 of the License, or (at your option) |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42532
diff
changeset
|
12 | * any later version. |
|
41739
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
13 | * |
|
42594
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42532
diff
changeset
|
14 | * This library is distributed in the hope that it will be useful, but WITHOUT |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42532
diff
changeset
|
15 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42532
diff
changeset
|
16 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42532
diff
changeset
|
17 | * more details. |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42532
diff
changeset
|
18 | * |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42532
diff
changeset
|
19 | * You should have received a copy of the GNU General Public License along with |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42532
diff
changeset
|
20 | * this library; if not, see <https://www.gnu.org/licenses/>. |
|
41739
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
21 | */ |
|
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 | #if !defined(PURPLE_GLOBAL_HEADER_INSIDE) && !defined(PURPLE_COMPILATION) |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
24 | # error "only <pidgin.h> may be included directly" |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
25 | #endif |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
26 | |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
27 | #ifndef PURPLE_CONTACT_H |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
28 | #define PURPLE_CONTACT_H |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
29 | |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
30 | #include <glib.h> |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
31 | #include <glib-object.h> |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
32 | |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
33 | #include <gdk-pixbuf/gdk-pixbuf.h> |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
34 | |
|
42338
2548eb61acc9
Make sure all internal includes use double quotes
Gary Kramlich <grim@reaperworld.com>
parents:
41948
diff
changeset
|
35 | #include "purplecontactinfo.h" |
|
42387
d9350cda1556
Export symbols added for 3.0.0
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42344
diff
changeset
|
36 | #include "purpleversion.h" |
|
41739
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
37 | |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
38 | G_BEGIN_DECLS |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
39 | |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
40 | #define PURPLE_TYPE_CONTACT (purple_contact_get_type()) |
|
42387
d9350cda1556
Export symbols added for 3.0.0
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42344
diff
changeset
|
41 | |
|
d9350cda1556
Export symbols added for 3.0.0
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42344
diff
changeset
|
42 | PURPLE_AVAILABLE_IN_3_0 |
|
41948
6d844d2faff1
Split PurpleContactInfo out of PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41933
diff
changeset
|
43 | G_DECLARE_FINAL_TYPE(PurpleContact, purple_contact, PURPLE, CONTACT, |
|
6d844d2faff1
Split PurpleContactInfo out of PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41933
diff
changeset
|
44 | PurpleContactInfo) |
|
41918
106ae46b290b
Add a permission property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41917
diff
changeset
|
45 | |
|
42344
c51d37734155
Rename account.[ch] to purpleaccount.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
42338
diff
changeset
|
46 | #include "purpleaccount.h" |
|
42532
eca0c08ed2a3
Add purple_contact_find_dm
Gary Kramlich <grim@reaperworld.com>
parents:
42387
diff
changeset
|
47 | #include "purpleconversation.h" |
|
41933
8ccd6fdc7ceb
Make PurpleContact derivable
Gary Kramlich <grim@reaperworld.com>
parents:
41930
diff
changeset
|
48 | |
|
8ccd6fdc7ceb
Make PurpleContact derivable
Gary Kramlich <grim@reaperworld.com>
parents:
41930
diff
changeset
|
49 | /** |
|
41739
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
50 | * PurpleContact: |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
51 | * |
|
41948
6d844d2faff1
Split PurpleContactInfo out of PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41933
diff
changeset
|
52 | * A contact is a concrete representation of a user in that it contains all of |
|
6d844d2faff1
Split PurpleContactInfo out of PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41933
diff
changeset
|
53 | * the contact information as well as a [class@Purple.Account] to use that |
|
6d844d2faff1
Split PurpleContactInfo out of PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41933
diff
changeset
|
54 | * contact information with. |
|
41739
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
55 | */ |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
56 | |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
57 | /** |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
58 | * purple_contact_new: |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
59 | * @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
|
60 | * @id: (nullable): The id of the contact. |
|
41739
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
61 | * |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
62 | * 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
|
63 | * |
|
1ecc0512e714
Make purple_contact_new take the id instead of the username.
Gary Kramlich <grim@reaperworld.com>
parents:
41755
diff
changeset
|
64 | * 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
|
65 | * |
|
1ecc0512e714
Make purple_contact_new take the id instead of the username.
Gary Kramlich <grim@reaperworld.com>
parents:
41755
diff
changeset
|
66 | * 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
|
67 | * |
|
1ecc0512e714
Make purple_contact_new take the id instead of the username.
Gary Kramlich <grim@reaperworld.com>
parents:
41755
diff
changeset
|
68 | * Since: 3.0.0 |
|
41739
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
69 | */ |
|
42387
d9350cda1556
Export symbols added for 3.0.0
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42344
diff
changeset
|
70 | PURPLE_AVAILABLE_IN_3_0 |
|
41759
1ecc0512e714
Make purple_contact_new take the id instead of the username.
Gary Kramlich <grim@reaperworld.com>
parents:
41755
diff
changeset
|
71 | PurpleContact *purple_contact_new(PurpleAccount *account, const gchar *id); |
|
41739
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
72 | |
|
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 | * purple_contact_get_account: |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
75 | * @contact: The instance. |
|
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 | * Gets the [class@Purple.Account] that @contact belongs to. |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
78 | * |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
79 | * Returns: (transfer none): The [class@Purple.Account] that @contact belongs |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
80 | * to. |
|
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 | * Since: 3.0.0 |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
83 | */ |
|
42387
d9350cda1556
Export symbols added for 3.0.0
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42344
diff
changeset
|
84 | PURPLE_AVAILABLE_IN_3_0 |
|
41739
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
85 | PurpleAccount *purple_contact_get_account(PurpleContact *contact); |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
86 | |
|
42532
eca0c08ed2a3
Add purple_contact_find_dm
Gary Kramlich <grim@reaperworld.com>
parents:
42387
diff
changeset
|
87 | /** |
|
eca0c08ed2a3
Add purple_contact_find_dm
Gary Kramlich <grim@reaperworld.com>
parents:
42387
diff
changeset
|
88 | * purple_contact_find_dm: |
|
eca0c08ed2a3
Add purple_contact_find_dm
Gary Kramlich <grim@reaperworld.com>
parents:
42387
diff
changeset
|
89 | * @contact: The instance. |
|
eca0c08ed2a3
Add purple_contact_find_dm
Gary Kramlich <grim@reaperworld.com>
parents:
42387
diff
changeset
|
90 | * @create: Whether or not to create a new DM if one can't be found. |
|
eca0c08ed2a3
Add purple_contact_find_dm
Gary Kramlich <grim@reaperworld.com>
parents:
42387
diff
changeset
|
91 | * |
|
eca0c08ed2a3
Add purple_contact_find_dm
Gary Kramlich <grim@reaperworld.com>
parents:
42387
diff
changeset
|
92 | * Attempts to find a conversation for @contact in the default |
|
eca0c08ed2a3
Add purple_contact_find_dm
Gary Kramlich <grim@reaperworld.com>
parents:
42387
diff
changeset
|
93 | * [class@ContactManager] by using @contact's username. |
|
eca0c08ed2a3
Add purple_contact_find_dm
Gary Kramlich <grim@reaperworld.com>
parents:
42387
diff
changeset
|
94 | * |
|
eca0c08ed2a3
Add purple_contact_find_dm
Gary Kramlich <grim@reaperworld.com>
parents:
42387
diff
changeset
|
95 | * If no existing direct messages exists for @contact and @create is %TRUE, |
|
eca0c08ed2a3
Add purple_contact_find_dm
Gary Kramlich <grim@reaperworld.com>
parents:
42387
diff
changeset
|
96 | * then a new direct message will be created and registered in the default |
|
eca0c08ed2a3
Add purple_contact_find_dm
Gary Kramlich <grim@reaperworld.com>
parents:
42387
diff
changeset
|
97 | * [class@ConversationManager]. |
|
eca0c08ed2a3
Add purple_contact_find_dm
Gary Kramlich <grim@reaperworld.com>
parents:
42387
diff
changeset
|
98 | * |
|
eca0c08ed2a3
Add purple_contact_find_dm
Gary Kramlich <grim@reaperworld.com>
parents:
42387
diff
changeset
|
99 | * Returns: (transfer none) (nullable): The conversation or %NULL. |
|
eca0c08ed2a3
Add purple_contact_find_dm
Gary Kramlich <grim@reaperworld.com>
parents:
42387
diff
changeset
|
100 | * |
|
eca0c08ed2a3
Add purple_contact_find_dm
Gary Kramlich <grim@reaperworld.com>
parents:
42387
diff
changeset
|
101 | * Since: 3.0.0 |
|
eca0c08ed2a3
Add purple_contact_find_dm
Gary Kramlich <grim@reaperworld.com>
parents:
42387
diff
changeset
|
102 | */ |
|
eca0c08ed2a3
Add purple_contact_find_dm
Gary Kramlich <grim@reaperworld.com>
parents:
42387
diff
changeset
|
103 | PURPLE_AVAILABLE_IN_3_0 |
|
eca0c08ed2a3
Add purple_contact_find_dm
Gary Kramlich <grim@reaperworld.com>
parents:
42387
diff
changeset
|
104 | PurpleConversation *purple_contact_find_dm(PurpleContact *contact, gboolean create); |
|
eca0c08ed2a3
Add purple_contact_find_dm
Gary Kramlich <grim@reaperworld.com>
parents:
42387
diff
changeset
|
105 | |
|
41739
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
106 | G_END_DECLS |
|
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 | #endif /* PURPLE_CONTACT_H */ |