libpurple/purplenotificationauthorizationrequest.c

Tue, 15 Oct 2024 00:47:42 -0500

author
Elliott Sales de Andrade <quantum.analyst@gmail.com>
date
Tue, 15 Oct 2024 00:47:42 -0500
changeset 43011
ce3144e2bc33
parent 42959
f1b48841d33e
child 43071
071588186662
permissions
-rw-r--r--

Port prefs to AdwSwitchRow

Now that we depend on Adwaita 1.4, we can flip the switch on using these (pun intended).

This also simplifies some extra tracking we needed to do for activations and focus, since the Adwaita widgets do that for us.

Testing Done:
Opened prefs, confirmed all the switches were there, and toggled them all without any warnings.

Also used the mnemonics to toggle the switches from the keyboard.

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

42651
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
1 /*
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
2 * Purple - Internet Messaging Library
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
3 * Copyright (C) Pidgin Developers <devel@pidgin.im>
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
4 *
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
5 * Purple is the legal property of its developers, whose names are too numerous
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
6 * to list here. Please refer to the COPYRIGHT file distributed with this
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
7 * source distribution.
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
8 *
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
9 * This library is free software; you can redistribute it and/or modify it
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
10 * under the terms of the GNU General Public License as published by the Free
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
11 * Software Foundation; either version 2 of the License, or (at your option)
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
12 * any later version.
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
13 *
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
14 * This library is distributed in the hope that it will be useful, but WITHOUT
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
16 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
17 * more details.
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
18 *
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
19 * You should have received a copy of the GNU General Public License along with
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
20 * this library; if not, see <https://www.gnu.org/licenses/>.
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
21 */
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
22
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
23 #include <glib/gi18n-lib.h>
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
24
42835
3144fbeba349 Rename AuthorizationRequestNotification to NotificationAuthorizationRequest
Gary Kramlich <grim@reaperworld.com>
parents: 42805
diff changeset
25 #include "purplenotificationauthorizationrequest.h"
42651
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
26
42725
ceb13f1de2d2 Remove PurpleBuddy
Gary Kramlich <grim@reaperworld.com>
parents: 42651
diff changeset
27 #include "util.h"
ceb13f1de2d2 Remove PurpleBuddy
Gary Kramlich <grim@reaperworld.com>
parents: 42651
diff changeset
28
42651
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
29 enum {
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
30 PROP_0,
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
31 PROP_AUTHORIZATION_REQUEST,
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
32 N_PROPERTIES,
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
33 };
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
34 static GParamSpec *properties[N_PROPERTIES] = {NULL, 0};
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
35
42835
3144fbeba349 Rename AuthorizationRequestNotification to NotificationAuthorizationRequest
Gary Kramlich <grim@reaperworld.com>
parents: 42805
diff changeset
36 struct _PurpleNotificationAuthorizationRequest {
42651
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
37 PurpleNotification parent;
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
38
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
39 PurpleAuthorizationRequest *authorization_request;
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
40 };
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
41
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
42 static void
42941
d39faa3581eb Update Purple.AuthorizationRequest to use Purple.Contact
Gary Kramlich <grim@reaperworld.com>
parents: 42929
diff changeset
43 purple_notification_authorization_request_notify_cb(GObject *obj,
d39faa3581eb Update Purple.AuthorizationRequest to use Purple.Contact
Gary Kramlich <grim@reaperworld.com>
parents: 42929
diff changeset
44 GParamSpec *pspec,
d39faa3581eb Update Purple.AuthorizationRequest to use Purple.Contact
Gary Kramlich <grim@reaperworld.com>
parents: 42929
diff changeset
45 gpointer data);
42651
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
46
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
47 /******************************************************************************
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
48 * Helpers
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
49 *****************************************************************************/
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
50 static void
42835
3144fbeba349 Rename AuthorizationRequestNotification to NotificationAuthorizationRequest
Gary Kramlich <grim@reaperworld.com>
parents: 42805
diff changeset
51 purple_notification_authorization_request_update(PurpleNotificationAuthorizationRequest *auth_notification)
42651
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
52 {
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
53 PurpleAccount *account = NULL;
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
54 PurpleAuthorizationRequest *request = NULL;
42941
d39faa3581eb Update Purple.AuthorizationRequest to use Purple.Contact
Gary Kramlich <grim@reaperworld.com>
parents: 42929
diff changeset
55 PurpleContact *contact = NULL;
d39faa3581eb Update Purple.AuthorizationRequest to use Purple.Contact
Gary Kramlich <grim@reaperworld.com>
parents: 42929
diff changeset
56 PurpleContactInfo *account_info = NULL;
d39faa3581eb Update Purple.AuthorizationRequest to use Purple.Contact
Gary Kramlich <grim@reaperworld.com>
parents: 42929
diff changeset
57 PurpleContactInfo *contact_info = NULL;
42651
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
58 PurpleNotification *notification = PURPLE_NOTIFICATION(auth_notification);
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
59 char *title = NULL;
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
60
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
61 request = auth_notification->authorization_request;
42941
d39faa3581eb Update Purple.AuthorizationRequest to use Purple.Contact
Gary Kramlich <grim@reaperworld.com>
parents: 42929
diff changeset
62 contact = purple_authorization_request_get_contact(request);
d39faa3581eb Update Purple.AuthorizationRequest to use Purple.Contact
Gary Kramlich <grim@reaperworld.com>
parents: 42929
diff changeset
63 contact_info = PURPLE_CONTACT_INFO(contact);
42651
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
64
42941
d39faa3581eb Update Purple.AuthorizationRequest to use Purple.Contact
Gary Kramlich <grim@reaperworld.com>
parents: 42929
diff changeset
65 account = purple_contact_get_account(contact);
d39faa3581eb Update Purple.AuthorizationRequest to use Purple.Contact
Gary Kramlich <grim@reaperworld.com>
parents: 42929
diff changeset
66 account_info = purple_account_get_contact_info(account);
42651
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
67
42941
d39faa3581eb Update Purple.AuthorizationRequest to use Purple.Contact
Gary Kramlich <grim@reaperworld.com>
parents: 42929
diff changeset
68 title = g_strdup_printf(_("%s would like to add %s to their contact list"),
d39faa3581eb Update Purple.AuthorizationRequest to use Purple.Contact
Gary Kramlich <grim@reaperworld.com>
parents: 42929
diff changeset
69 purple_contact_info_get_name_for_display(contact_info),
d39faa3581eb Update Purple.AuthorizationRequest to use Purple.Contact
Gary Kramlich <grim@reaperworld.com>
parents: 42929
diff changeset
70 purple_contact_info_get_name_for_display(account_info));
42651
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
71 purple_notification_set_title(notification, title);
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
72 g_free(title);
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
73 }
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
74
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
75 static void
42835
3144fbeba349 Rename AuthorizationRequestNotification to NotificationAuthorizationRequest
Gary Kramlich <grim@reaperworld.com>
parents: 42805
diff changeset
76 purple_notification_authorization_request_set_request(PurpleNotificationAuthorizationRequest *notification,
42651
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
77 PurpleAuthorizationRequest *request)
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
78 {
42835
3144fbeba349 Rename AuthorizationRequestNotification to NotificationAuthorizationRequest
Gary Kramlich <grim@reaperworld.com>
parents: 42805
diff changeset
79 g_return_if_fail(PURPLE_IS_NOTIFICATION_AUTHORIZATION_REQUEST(notification));
42651
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
80
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
81 if(g_set_object(&notification->authorization_request, request)) {
42929
e9cc6fc1f717 Update Purple.NotificationAuthorizationRequest to take an id and auto populate account
Gary Kramlich <grim@reaperworld.com>
parents: 42835
diff changeset
82 PurpleAccount *account = NULL;
e9cc6fc1f717 Update Purple.NotificationAuthorizationRequest to take an id and auto populate account
Gary Kramlich <grim@reaperworld.com>
parents: 42835
diff changeset
83 GObject *obj = G_OBJECT(notification);
e9cc6fc1f717 Update Purple.NotificationAuthorizationRequest to take an id and auto populate account
Gary Kramlich <grim@reaperworld.com>
parents: 42835
diff changeset
84
e9cc6fc1f717 Update Purple.NotificationAuthorizationRequest to take an id and auto populate account
Gary Kramlich <grim@reaperworld.com>
parents: 42835
diff changeset
85 g_object_freeze_notify(obj);
e9cc6fc1f717 Update Purple.NotificationAuthorizationRequest to take an id and auto populate account
Gary Kramlich <grim@reaperworld.com>
parents: 42835
diff changeset
86
42651
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
87 if(PURPLE_IS_AUTHORIZATION_REQUEST(request)) {
42941
d39faa3581eb Update Purple.AuthorizationRequest to use Purple.Contact
Gary Kramlich <grim@reaperworld.com>
parents: 42929
diff changeset
88 PurpleContact *contact = NULL;
d39faa3581eb Update Purple.AuthorizationRequest to use Purple.Contact
Gary Kramlich <grim@reaperworld.com>
parents: 42929
diff changeset
89
d39faa3581eb Update Purple.AuthorizationRequest to use Purple.Contact
Gary Kramlich <grim@reaperworld.com>
parents: 42929
diff changeset
90 contact = purple_authorization_request_get_contact(request);
d39faa3581eb Update Purple.AuthorizationRequest to use Purple.Contact
Gary Kramlich <grim@reaperworld.com>
parents: 42929
diff changeset
91 account = purple_contact_get_account(contact);
42929
e9cc6fc1f717 Update Purple.NotificationAuthorizationRequest to take an id and auto populate account
Gary Kramlich <grim@reaperworld.com>
parents: 42835
diff changeset
92
42651
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
93 g_signal_connect_object(request, "notify",
42941
d39faa3581eb Update Purple.AuthorizationRequest to use Purple.Contact
Gary Kramlich <grim@reaperworld.com>
parents: 42929
diff changeset
94 G_CALLBACK(purple_notification_authorization_request_notify_cb),
d39faa3581eb Update Purple.AuthorizationRequest to use Purple.Contact
Gary Kramlich <grim@reaperworld.com>
parents: 42929
diff changeset
95 notification, G_CONNECT_DEFAULT);
42651
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
96
42941
d39faa3581eb Update Purple.AuthorizationRequest to use Purple.Contact
Gary Kramlich <grim@reaperworld.com>
parents: 42929
diff changeset
97 g_signal_connect_object(contact, "notify::name-for-display",
d39faa3581eb Update Purple.AuthorizationRequest to use Purple.Contact
Gary Kramlich <grim@reaperworld.com>
parents: 42929
diff changeset
98 G_CALLBACK(purple_notification_authorization_request_notify_cb),
d39faa3581eb Update Purple.AuthorizationRequest to use Purple.Contact
Gary Kramlich <grim@reaperworld.com>
parents: 42929
diff changeset
99 notification, G_CONNECT_DEFAULT);
42959
f1b48841d33e Add an account action to the Demo protocol plugin to create authorization requests
Gary Kramlich <grim@reaperworld.com>
parents: 42941
diff changeset
100
f1b48841d33e Add an account action to the Demo protocol plugin to create authorization requests
Gary Kramlich <grim@reaperworld.com>
parents: 42941
diff changeset
101 g_object_bind_property(request, "message",
f1b48841d33e Add an account action to the Demo protocol plugin to create authorization requests
Gary Kramlich <grim@reaperworld.com>
parents: 42941
diff changeset
102 notification, "subtitle",
f1b48841d33e Add an account action to the Demo protocol plugin to create authorization requests
Gary Kramlich <grim@reaperworld.com>
parents: 42941
diff changeset
103 G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
42651
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
104 }
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
105
42929
e9cc6fc1f717 Update Purple.NotificationAuthorizationRequest to take an id and auto populate account
Gary Kramlich <grim@reaperworld.com>
parents: 42835
diff changeset
106 purple_notification_set_account(PURPLE_NOTIFICATION(notification),
e9cc6fc1f717 Update Purple.NotificationAuthorizationRequest to take an id and auto populate account
Gary Kramlich <grim@reaperworld.com>
parents: 42835
diff changeset
107 account);
e9cc6fc1f717 Update Purple.NotificationAuthorizationRequest to take an id and auto populate account
Gary Kramlich <grim@reaperworld.com>
parents: 42835
diff changeset
108
e9cc6fc1f717 Update Purple.NotificationAuthorizationRequest to take an id and auto populate account
Gary Kramlich <grim@reaperworld.com>
parents: 42835
diff changeset
109 g_object_notify_by_pspec(obj, properties[PROP_AUTHORIZATION_REQUEST]);
e9cc6fc1f717 Update Purple.NotificationAuthorizationRequest to take an id and auto populate account
Gary Kramlich <grim@reaperworld.com>
parents: 42835
diff changeset
110 g_object_thaw_notify(obj);
e9cc6fc1f717 Update Purple.NotificationAuthorizationRequest to take an id and auto populate account
Gary Kramlich <grim@reaperworld.com>
parents: 42835
diff changeset
111
e9cc6fc1f717 Update Purple.NotificationAuthorizationRequest to take an id and auto populate account
Gary Kramlich <grim@reaperworld.com>
parents: 42835
diff changeset
112 purple_notification_authorization_request_update(notification);
42651
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
113 }
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
114 }
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
115
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
116 /******************************************************************************
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
117 * Callbacks
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
118 *****************************************************************************/
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
119 static void
42941
d39faa3581eb Update Purple.AuthorizationRequest to use Purple.Contact
Gary Kramlich <grim@reaperworld.com>
parents: 42929
diff changeset
120 purple_notification_authorization_request_notify_cb(G_GNUC_UNUSED GObject *obj,
d39faa3581eb Update Purple.AuthorizationRequest to use Purple.Contact
Gary Kramlich <grim@reaperworld.com>
parents: 42929
diff changeset
121 G_GNUC_UNUSED GParamSpec *pspec,
d39faa3581eb Update Purple.AuthorizationRequest to use Purple.Contact
Gary Kramlich <grim@reaperworld.com>
parents: 42929
diff changeset
122 gpointer data)
42651
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
123 {
42835
3144fbeba349 Rename AuthorizationRequestNotification to NotificationAuthorizationRequest
Gary Kramlich <grim@reaperworld.com>
parents: 42805
diff changeset
124 purple_notification_authorization_request_update(data);
42651
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
125 }
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
126
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
127 /******************************************************************************
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
128 * GObject Implementation
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
129 *****************************************************************************/
42835
3144fbeba349 Rename AuthorizationRequestNotification to NotificationAuthorizationRequest
Gary Kramlich <grim@reaperworld.com>
parents: 42805
diff changeset
130 G_DEFINE_FINAL_TYPE(PurpleNotificationAuthorizationRequest,
3144fbeba349 Rename AuthorizationRequestNotification to NotificationAuthorizationRequest
Gary Kramlich <grim@reaperworld.com>
parents: 42805
diff changeset
131 purple_notification_authorization_request,
42651
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
132 PURPLE_TYPE_NOTIFICATION)
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
133
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
134 static void
42929
e9cc6fc1f717 Update Purple.NotificationAuthorizationRequest to take an id and auto populate account
Gary Kramlich <grim@reaperworld.com>
parents: 42835
diff changeset
135 purple_notification_authorization_request_constructed(GObject *obj) {
e9cc6fc1f717 Update Purple.NotificationAuthorizationRequest to take an id and auto populate account
Gary Kramlich <grim@reaperworld.com>
parents: 42835
diff changeset
136 PurpleAccount *account = NULL;
e9cc6fc1f717 Update Purple.NotificationAuthorizationRequest to take an id and auto populate account
Gary Kramlich <grim@reaperworld.com>
parents: 42835
diff changeset
137 PurpleNotification *notification = PURPLE_NOTIFICATION(obj);
e9cc6fc1f717 Update Purple.NotificationAuthorizationRequest to take an id and auto populate account
Gary Kramlich <grim@reaperworld.com>
parents: 42835
diff changeset
138
e9cc6fc1f717 Update Purple.NotificationAuthorizationRequest to take an id and auto populate account
Gary Kramlich <grim@reaperworld.com>
parents: 42835
diff changeset
139 G_OBJECT_CLASS(purple_notification_authorization_request_parent_class)->constructed(obj);
e9cc6fc1f717 Update Purple.NotificationAuthorizationRequest to take an id and auto populate account
Gary Kramlich <grim@reaperworld.com>
parents: 42835
diff changeset
140
e9cc6fc1f717 Update Purple.NotificationAuthorizationRequest to take an id and auto populate account
Gary Kramlich <grim@reaperworld.com>
parents: 42835
diff changeset
141 account = purple_notification_get_account(notification);
e9cc6fc1f717 Update Purple.NotificationAuthorizationRequest to take an id and auto populate account
Gary Kramlich <grim@reaperworld.com>
parents: 42835
diff changeset
142 if(!PURPLE_IS_ACCOUNT(account)) {
42941
d39faa3581eb Update Purple.AuthorizationRequest to use Purple.Contact
Gary Kramlich <grim@reaperworld.com>
parents: 42929
diff changeset
143 PurpleContact *contact = NULL;
42929
e9cc6fc1f717 Update Purple.NotificationAuthorizationRequest to take an id and auto populate account
Gary Kramlich <grim@reaperworld.com>
parents: 42835
diff changeset
144 PurpleNotificationAuthorizationRequest *auth_notification = NULL;
e9cc6fc1f717 Update Purple.NotificationAuthorizationRequest to take an id and auto populate account
Gary Kramlich <grim@reaperworld.com>
parents: 42835
diff changeset
145
e9cc6fc1f717 Update Purple.NotificationAuthorizationRequest to take an id and auto populate account
Gary Kramlich <grim@reaperworld.com>
parents: 42835
diff changeset
146 auth_notification = PURPLE_NOTIFICATION_AUTHORIZATION_REQUEST(obj);
42941
d39faa3581eb Update Purple.AuthorizationRequest to use Purple.Contact
Gary Kramlich <grim@reaperworld.com>
parents: 42929
diff changeset
147 contact = purple_authorization_request_get_contact(auth_notification->authorization_request);
d39faa3581eb Update Purple.AuthorizationRequest to use Purple.Contact
Gary Kramlich <grim@reaperworld.com>
parents: 42929
diff changeset
148 account = purple_contact_get_account(contact);
42929
e9cc6fc1f717 Update Purple.NotificationAuthorizationRequest to take an id and auto populate account
Gary Kramlich <grim@reaperworld.com>
parents: 42835
diff changeset
149
e9cc6fc1f717 Update Purple.NotificationAuthorizationRequest to take an id and auto populate account
Gary Kramlich <grim@reaperworld.com>
parents: 42835
diff changeset
150 purple_notification_set_account(notification, account);
e9cc6fc1f717 Update Purple.NotificationAuthorizationRequest to take an id and auto populate account
Gary Kramlich <grim@reaperworld.com>
parents: 42835
diff changeset
151 }
e9cc6fc1f717 Update Purple.NotificationAuthorizationRequest to take an id and auto populate account
Gary Kramlich <grim@reaperworld.com>
parents: 42835
diff changeset
152
e9cc6fc1f717 Update Purple.NotificationAuthorizationRequest to take an id and auto populate account
Gary Kramlich <grim@reaperworld.com>
parents: 42835
diff changeset
153 purple_notification_set_icon_name(notification,
e9cc6fc1f717 Update Purple.NotificationAuthorizationRequest to take an id and auto populate account
Gary Kramlich <grim@reaperworld.com>
parents: 42835
diff changeset
154 "address-book-new-symbolic");
e9cc6fc1f717 Update Purple.NotificationAuthorizationRequest to take an id and auto populate account
Gary Kramlich <grim@reaperworld.com>
parents: 42835
diff changeset
155 }
e9cc6fc1f717 Update Purple.NotificationAuthorizationRequest to take an id and auto populate account
Gary Kramlich <grim@reaperworld.com>
parents: 42835
diff changeset
156
e9cc6fc1f717 Update Purple.NotificationAuthorizationRequest to take an id and auto populate account
Gary Kramlich <grim@reaperworld.com>
parents: 42835
diff changeset
157 static void
42835
3144fbeba349 Rename AuthorizationRequestNotification to NotificationAuthorizationRequest
Gary Kramlich <grim@reaperworld.com>
parents: 42805
diff changeset
158 purple_notification_authorization_request_finalize(GObject *object) {
3144fbeba349 Rename AuthorizationRequestNotification to NotificationAuthorizationRequest
Gary Kramlich <grim@reaperworld.com>
parents: 42805
diff changeset
159 PurpleNotificationAuthorizationRequest *notification = NULL;
42651
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
160
42835
3144fbeba349 Rename AuthorizationRequestNotification to NotificationAuthorizationRequest
Gary Kramlich <grim@reaperworld.com>
parents: 42805
diff changeset
161 notification = PURPLE_NOTIFICATION_AUTHORIZATION_REQUEST(object);
42651
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
162
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
163 g_clear_object(&notification->authorization_request);
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
164
42835
3144fbeba349 Rename AuthorizationRequestNotification to NotificationAuthorizationRequest
Gary Kramlich <grim@reaperworld.com>
parents: 42805
diff changeset
165 G_OBJECT_CLASS(purple_notification_authorization_request_parent_class)->finalize(object);
42651
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
166 }
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
167
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
168 static void
42835
3144fbeba349 Rename AuthorizationRequestNotification to NotificationAuthorizationRequest
Gary Kramlich <grim@reaperworld.com>
parents: 42805
diff changeset
169 purple_notification_authorization_request_get_property(GObject *obj,
42651
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
170 guint param_id,
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
171 GValue *value,
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
172 GParamSpec *pspec)
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
173 {
42835
3144fbeba349 Rename AuthorizationRequestNotification to NotificationAuthorizationRequest
Gary Kramlich <grim@reaperworld.com>
parents: 42805
diff changeset
174 PurpleNotificationAuthorizationRequest *notification = NULL;
42651
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
175
42835
3144fbeba349 Rename AuthorizationRequestNotification to NotificationAuthorizationRequest
Gary Kramlich <grim@reaperworld.com>
parents: 42805
diff changeset
176 notification = PURPLE_NOTIFICATION_AUTHORIZATION_REQUEST(obj);
42651
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
177
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
178 switch(param_id) {
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
179 case PROP_AUTHORIZATION_REQUEST:
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
180 g_value_set_object(value,
42835
3144fbeba349 Rename AuthorizationRequestNotification to NotificationAuthorizationRequest
Gary Kramlich <grim@reaperworld.com>
parents: 42805
diff changeset
181 purple_notification_authorization_request_get_request(notification));
42651
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
182 break;
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
183 default:
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
184 G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec);
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
185 break;
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
186 }
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
187 }
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
188
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
189 static void
42835
3144fbeba349 Rename AuthorizationRequestNotification to NotificationAuthorizationRequest
Gary Kramlich <grim@reaperworld.com>
parents: 42805
diff changeset
190 purple_notification_authorization_request_set_property(GObject *obj,
42651
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
191 guint param_id,
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
192 const GValue *value,
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
193 GParamSpec *pspec)
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
194 {
42835
3144fbeba349 Rename AuthorizationRequestNotification to NotificationAuthorizationRequest
Gary Kramlich <grim@reaperworld.com>
parents: 42805
diff changeset
195 PurpleNotificationAuthorizationRequest *notification = NULL;
42651
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
196
42835
3144fbeba349 Rename AuthorizationRequestNotification to NotificationAuthorizationRequest
Gary Kramlich <grim@reaperworld.com>
parents: 42805
diff changeset
197 notification = PURPLE_NOTIFICATION_AUTHORIZATION_REQUEST(obj);
42651
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
198
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
199 switch(param_id) {
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
200 case PROP_AUTHORIZATION_REQUEST:
42835
3144fbeba349 Rename AuthorizationRequestNotification to NotificationAuthorizationRequest
Gary Kramlich <grim@reaperworld.com>
parents: 42805
diff changeset
201 purple_notification_authorization_request_set_request(notification,
42651
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
202 g_value_get_object(value));
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
203 break;
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
204 default:
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
205 G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec);
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
206 break;
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
207 }
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
208 }
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
209
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
210 static void
42835
3144fbeba349 Rename AuthorizationRequestNotification to NotificationAuthorizationRequest
Gary Kramlich <grim@reaperworld.com>
parents: 42805
diff changeset
211 purple_notification_authorization_request_init(G_GNUC_UNUSED PurpleNotificationAuthorizationRequest *notification)
42651
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
212 {
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
213 }
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
214
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
215 static void
42835
3144fbeba349 Rename AuthorizationRequestNotification to NotificationAuthorizationRequest
Gary Kramlich <grim@reaperworld.com>
parents: 42805
diff changeset
216 purple_notification_authorization_request_class_init(PurpleNotificationAuthorizationRequestClass *klass)
42651
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
217 {
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
218 GObjectClass *obj_class = G_OBJECT_CLASS(klass);
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
219
42929
e9cc6fc1f717 Update Purple.NotificationAuthorizationRequest to take an id and auto populate account
Gary Kramlich <grim@reaperworld.com>
parents: 42835
diff changeset
220 obj_class->constructed = purple_notification_authorization_request_constructed;
42835
3144fbeba349 Rename AuthorizationRequestNotification to NotificationAuthorizationRequest
Gary Kramlich <grim@reaperworld.com>
parents: 42805
diff changeset
221 obj_class->finalize = purple_notification_authorization_request_finalize;
3144fbeba349 Rename AuthorizationRequestNotification to NotificationAuthorizationRequest
Gary Kramlich <grim@reaperworld.com>
parents: 42805
diff changeset
222 obj_class->get_property = purple_notification_authorization_request_get_property;
3144fbeba349 Rename AuthorizationRequestNotification to NotificationAuthorizationRequest
Gary Kramlich <grim@reaperworld.com>
parents: 42805
diff changeset
223 obj_class->set_property = purple_notification_authorization_request_set_property;
42651
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
224
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
225 /**
42835
3144fbeba349 Rename AuthorizationRequestNotification to NotificationAuthorizationRequest
Gary Kramlich <grim@reaperworld.com>
parents: 42805
diff changeset
226 * PurpleNotificationAuthorizationRequest:authorization-request:
42651
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
227 *
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
228 * The [class@AuthorizationRequest] that this notification was created for.
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
229 *
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
230 * Since: 3.0
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
231 */
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
232 properties[PROP_AUTHORIZATION_REQUEST] = g_param_spec_object(
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
233 "authorization-request", "authorization-request",
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
234 "The authorization request this notification is for.",
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
235 PURPLE_TYPE_AUTHORIZATION_REQUEST,
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
236 G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
237
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
238 g_object_class_install_properties(obj_class, N_PROPERTIES, properties);
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
239 }
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
240
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
241 /******************************************************************************
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
242 * Public API
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
243 *****************************************************************************/
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
244 PurpleNotification *
42929
e9cc6fc1f717 Update Purple.NotificationAuthorizationRequest to take an id and auto populate account
Gary Kramlich <grim@reaperworld.com>
parents: 42835
diff changeset
245 purple_notification_authorization_request_new(const char *id,
e9cc6fc1f717 Update Purple.NotificationAuthorizationRequest to take an id and auto populate account
Gary Kramlich <grim@reaperworld.com>
parents: 42835
diff changeset
246 PurpleAuthorizationRequest *request)
42651
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
247 {
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
248 g_return_val_if_fail(PURPLE_IS_AUTHORIZATION_REQUEST(request), NULL);
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
249
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
250 return g_object_new(
42835
3144fbeba349 Rename AuthorizationRequestNotification to NotificationAuthorizationRequest
Gary Kramlich <grim@reaperworld.com>
parents: 42805
diff changeset
251 PURPLE_TYPE_NOTIFICATION_AUTHORIZATION_REQUEST,
42651
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
252 "authorization-request", request,
42929
e9cc6fc1f717 Update Purple.NotificationAuthorizationRequest to take an id and auto populate account
Gary Kramlich <grim@reaperworld.com>
parents: 42835
diff changeset
253 "id", id,
42651
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
254 NULL);
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
255 }
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
256
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
257 PurpleAuthorizationRequest *
42835
3144fbeba349 Rename AuthorizationRequestNotification to NotificationAuthorizationRequest
Gary Kramlich <grim@reaperworld.com>
parents: 42805
diff changeset
258 purple_notification_authorization_request_get_request(PurpleNotificationAuthorizationRequest *notification)
42651
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
259 {
42835
3144fbeba349 Rename AuthorizationRequestNotification to NotificationAuthorizationRequest
Gary Kramlich <grim@reaperworld.com>
parents: 42805
diff changeset
260 g_return_val_if_fail(PURPLE_IS_NOTIFICATION_AUTHORIZATION_REQUEST(notification),
42651
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
261 NULL);
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
262
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
263 return notification->authorization_request;
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
264 }

mercurial