Mon, 12 May 2025 20:25:16 -0500
Handle formatting in server messages
Testing Done:
Used the default motd on my local ergo server to verify that formatting was working.
Reviewed at https://reviews.imfreedom.org/r/3991/
|
42922
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
1 | /* |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
2 | * Purple - Internet Messaging Library |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
3 | * Copyright (C) Pidgin Developers <devel@pidgin.im> |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
4 | * |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
5 | * Purple is the legal property of its developers, whose names are too numerous |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
6 | * to list here. Please refer to the COPYRIGHT file distributed with this |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
7 | * source distribution. |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
8 | * |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
9 | * This library is free software; you can redistribute it and/or modify it |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
10 | * under the terms of the GNU General Public License as published by the Free |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
11 | * Software Foundation; either version 2 of the License, or (at your option) |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
12 | * any later version. |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
13 | * |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
14 | * This library is distributed in the hope that it will be useful, but WITHOUT |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
15 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
16 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
17 | * more details. |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
18 | * |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
19 | * You should have received a copy of the GNU General Public License along with |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
20 | * this library; if not, see <https://www.gnu.org/licenses/>. |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
21 | */ |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
22 | |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
23 | #if !defined(PURPLE_GLOBAL_HEADER_INSIDE) && !defined(PURPLE_COMPILATION) |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
24 | # error "only <purple.h> may be included directly" |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
25 | #endif |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
26 | |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
27 | #ifndef PURPLE_NOTIFICATION_ADD_CONTACT_H |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
28 | #define PURPLE_NOTIFICATION_ADD_CONTACT_H |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
29 | |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
30 | #include <glib.h> |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
31 | #include <glib-object.h> |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
32 | |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
33 | #include "purpleaddcontactrequest.h" |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
34 | #include "purplenotification.h" |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
35 | #include "purpleversion.h" |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
36 | |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
37 | G_BEGIN_DECLS |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
38 | |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
39 | /** |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
40 | * PurpleNotificationAddContact: |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
41 | * |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
42 | * A [class@Notification] for [class@AddContactRequest]s. |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
43 | * |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
44 | * Since: 3.0 |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
45 | */ |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
46 | |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
47 | #define PURPLE_TYPE_NOTIFICATION_ADD_CONTACT (purple_notification_add_contact_get_type()) |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
48 | |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
49 | PURPLE_AVAILABLE_IN_3_0 |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
50 | G_DECLARE_FINAL_TYPE(PurpleNotificationAddContact, |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
51 | purple_notification_add_contact, |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
52 | PURPLE, NOTIFICATION_ADD_CONTACT, |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
53 | PurpleNotification) |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
54 | |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
55 | /** |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
56 | * purple_notification_add_contact_new: |
|
42928
2f12cdef0048
Update Purple.NotificationAddContact to take an id parameter
Gary Kramlich <grim@reaperworld.com>
parents:
42922
diff
changeset
|
57 | * @id: (nullable): An identifier for this notification. |
|
42922
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
58 | * @request: The add contact request. |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
59 | * |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
60 | * Creates a new [class@Notification] for @request. |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
61 | * |
|
42928
2f12cdef0048
Update Purple.NotificationAddContact to take an id parameter
Gary Kramlich <grim@reaperworld.com>
parents:
42922
diff
changeset
|
62 | * Since @request has a [class@Contact] which has a [class@Account], |
|
2f12cdef0048
Update Purple.NotificationAddContact to take an id parameter
Gary Kramlich <grim@reaperworld.com>
parents:
42922
diff
changeset
|
63 | * [property@Notification:account] will automatically be set to that. |
|
2f12cdef0048
Update Purple.NotificationAddContact to take an id parameter
Gary Kramlich <grim@reaperworld.com>
parents:
42922
diff
changeset
|
64 | * |
|
43176
04f562dc0ff2
Annotate libpurple constructors that return base types
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42928
diff
changeset
|
65 | * Returns: (transfer full) (type PurpleNotificationAddContact): The new |
|
04f562dc0ff2
Annotate libpurple constructors that return base types
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42928
diff
changeset
|
66 | * notification. |
|
42922
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
67 | * |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
68 | * Since: 3.0 |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
69 | */ |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
70 | PURPLE_AVAILABLE_IN_3_0 |
|
42928
2f12cdef0048
Update Purple.NotificationAddContact to take an id parameter
Gary Kramlich <grim@reaperworld.com>
parents:
42922
diff
changeset
|
71 | PurpleNotification *purple_notification_add_contact_new(const char *id, PurpleAddContactRequest *request); |
|
42922
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
72 | |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
73 | /** |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
74 | * purple_notification_add_contact_get_request: |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
75 | * @notification: The instance. |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
76 | * |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
77 | * Gets the [class@AddContactRequest] for @notification. |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
78 | * |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
79 | * Returns: (transfer none): The add contact request. |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
80 | * |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
81 | * Since: 3.0 |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
82 | */ |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
83 | PURPLE_AVAILABLE_IN_3_0 |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
84 | PurpleAddContactRequest *purple_notification_add_contact_get_request(PurpleNotificationAddContact *notification); |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
85 | |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
86 | G_END_DECLS |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
87 | |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
88 | #endif /* PURPLE_NOTIFICATION_ADD_CONTACT_H */ |