libpurple/plugins/keyrings/gnomekeyring.c

Tue, 04 Feb 2014 01:11:42 +0100

author
Tomasz Wasilczyk <twasilczyk@pidgin.im>
date
Tue, 04 Feb 2014 01:11:42 +0100
changeset 35362
a6223370667b
parent 35190
5986ee34c476
child 35910
327db5f3a5c5
child 37065
3546d731987e
permissions
-rw-r--r--

Style: fix braces for http, keyring

33984
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
1 /**
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
2 * @file gnomekeyring.c Gnome keyring password storage
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
3 * @ingroup plugins
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
4 */
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
5
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
6 /* purple
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
7 *
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
8 * Purple is the legal property of its developers, whose names are too numerous
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
9 * to list here. Please refer to the COPYRIGHT file distributed with this
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
10 * source distribution.
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
11 *
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
12 * This program is free software; you can redistribute it and/or modify
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
13 * it under the terms of the GNU General Public License as published by
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
14 * the Free Software Foundation; either version 2 of the License, or
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
15 * (at your option) any later version.
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
16 *
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
17 * This program is distributed in the hope that it will be useful,
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
20 * GNU General Public License for more details.
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
21 *
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
22 * You should have received a copy of the GNU General Public License
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
23 * along with this program ; if not, write to the Free Software
34135
528b3084b3b3 Initial version of re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34129
diff changeset
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
33984
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
25 */
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
26
34076
64e389ae5cc3 Clean up headers and stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34050
diff changeset
27 #include "internal.h"
64e389ae5cc3 Clean up headers and stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34050
diff changeset
28 #include "account.h"
64e389ae5cc3 Clean up headers and stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34050
diff changeset
29 #include "debug.h"
35190
5986ee34c476 libpurple: Fix build and warnings with glib 2.24
Ankit Vani <a@nevitus.org>
parents: 34456
diff changeset
30 #include "glibcompat.h"
34076
64e389ae5cc3 Clean up headers and stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34050
diff changeset
31 #include "keyring.h"
64e389ae5cc3 Clean up headers and stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34050
diff changeset
32 #include "plugin.h"
64e389ae5cc3 Clean up headers and stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34050
diff changeset
33 #include "version.h"
33984
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
34
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
35 #include <gnome-keyring.h>
34136
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
36 #include <gnome-keyring-memory.h>
33984
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
37
34135
528b3084b3b3 Initial version of re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34129
diff changeset
38 #define GNOMEKEYRING_NAME N_("GNOME Keyring")
34136
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
39 #define GNOMEKEYRING_DESCRIPTION N_("This plugin will store passwords in " \
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
40 "GNOME Keyring.")
34135
528b3084b3b3 Initial version of re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34129
diff changeset
41 #define GNOMEKEYRING_AUTHOR "Tomek Wasilczyk (tomkiewicz@cpw.pidgin.im)"
34093
c8197603fa20 Use better keyring IDs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34081
diff changeset
42 #define GNOMEKEYRING_ID "keyring-gnomekeyring"
33984
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
43
34034
f508fa47f2ac Reformat many things.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34033
diff changeset
44 static PurpleKeyring *keyring_handler = NULL;
34136
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
45 static GList *request_queue = NULL;
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
46 static gpointer current_request = NULL;
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
47
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
48 typedef struct
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
49 {
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
50 enum
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
51 {
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
52 GNOMEKEYRING_REQUEST_READ,
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
53 GNOMEKEYRING_REQUEST_SAVE
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
54 } type;
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
55 PurpleAccount *account;
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
56 gchar *password;
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
57 union
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
58 {
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
59 PurpleKeyringReadCallback read;
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
60 PurpleKeyringSaveCallback save;
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
61 } cb;
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
62 gpointer cb_data;
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
63 gboolean handled;
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
64 } gnomekeyring_request;
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
65
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
66 static void gnomekeyring_cancel_queue(void);
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
67 static void gnomekeyring_process_queue(void);
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
68
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
69 static void gnomekeyring_request_free(gnomekeyring_request *req)
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
70 {
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
71 if (req->password != NULL) {
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
72 memset(req->password, 0, strlen(req->password));
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
73 gnome_keyring_memory_free(req->password);
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
74 }
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
75 g_free(req);
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
76 }
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
77
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
78 static void
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
79 gnomekeyring_enqueue(gnomekeyring_request *req)
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
80 {
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
81 request_queue = g_list_append(request_queue, req);
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
82 gnomekeyring_process_queue();
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
83 }
33984
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
84
34034
f508fa47f2ac Reformat many things.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34033
diff changeset
85 static void
34136
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
86 gnomekeyring_read_cb(GnomeKeyringResult result, const char *password,
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
87 gpointer _req)
33984
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
88 {
34136
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
89 gnomekeyring_request *req = _req;
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
90 PurpleAccount *account;
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
91 GError *error = NULL;
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
92
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
93 g_return_if_fail(req != NULL);
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
94
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
95 current_request = NULL;
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
96 account = req->account;
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
97
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
98 if (result == GNOME_KEYRING_RESULT_OK) {
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
99 error = NULL;
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
100 } else if (result == GNOME_KEYRING_RESULT_NO_MATCH) {
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
101 error = g_error_new(PURPLE_KEYRING_ERROR,
34154
857c361d3791 Refine keyring error coded
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34141
diff changeset
102 PURPLE_KEYRING_ERROR_NOPASSWORD,
34199
73d122f25f2b Localize strings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34170
diff changeset
103 _("No password found for account."));
34136
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
104 } else if (result == GNOME_KEYRING_RESULT_DENIED ||
35362
a6223370667b Style: fix braces for http, keyring
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35190
diff changeset
105 result == GNOME_KEYRING_RESULT_CANCELLED)
a6223370667b Style: fix braces for http, keyring
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35190
diff changeset
106 {
34136
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
107 error = g_error_new(PURPLE_KEYRING_ERROR,
34154
857c361d3791 Refine keyring error coded
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34141
diff changeset
108 PURPLE_KEYRING_ERROR_ACCESSDENIED,
34199
73d122f25f2b Localize strings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34170
diff changeset
109 _("Access denied."));
34136
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
110 gnomekeyring_cancel_queue();
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
111 } else if (result == GNOME_KEYRING_RESULT_NO_KEYRING_DAEMON ||
35362
a6223370667b Style: fix braces for http, keyring
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35190
diff changeset
112 result == GNOME_KEYRING_RESULT_IO_ERROR)
a6223370667b Style: fix braces for http, keyring
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35190
diff changeset
113 {
34136
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
114 error = g_error_new(PURPLE_KEYRING_ERROR,
34154
857c361d3791 Refine keyring error coded
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34141
diff changeset
115 PURPLE_KEYRING_ERROR_BACKENDFAIL,
34199
73d122f25f2b Localize strings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34170
diff changeset
116 _("Communication with GNOME Keyring failed."));
34136
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
117 } else {
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
118 error = g_error_new(PURPLE_KEYRING_ERROR,
34154
857c361d3791 Refine keyring error coded
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34141
diff changeset
119 PURPLE_KEYRING_ERROR_BACKENDFAIL,
34199
73d122f25f2b Localize strings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34170
diff changeset
120 _("Unknown error (code: %d)."), result);
34136
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
121 }
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
122
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
123 if (error == NULL && password == NULL) {
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
124 error = g_error_new(PURPLE_KEYRING_ERROR,
34154
857c361d3791 Refine keyring error coded
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34141
diff changeset
125 PURPLE_KEYRING_ERROR_BACKENDFAIL,
34199
73d122f25f2b Localize strings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34170
diff changeset
126 _("Unknown error (password empty)."));
34136
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
127 }
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
128
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
129 if (error == NULL) {
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
130 purple_debug_misc("keyring-gnome",
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
131 "Got password for account %s (%s).\n",
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
132 purple_account_get_username(account),
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
133 purple_account_get_protocol_id(account));
34141
9d90967f2485 Don't close a keyring before dropping all passwords
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34139
diff changeset
134 } else if (result == GNOME_KEYRING_RESULT_NO_MATCH) {
9d90967f2485 Don't close a keyring before dropping all passwords
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34139
diff changeset
135 if (purple_debug_is_verbose()) {
9d90967f2485 Don't close a keyring before dropping all passwords
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34139
diff changeset
136 purple_debug_info("keyring-gnome",
9d90967f2485 Don't close a keyring before dropping all passwords
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34139
diff changeset
137 "Password for account %s (%s) isn't stored.\n",
9d90967f2485 Don't close a keyring before dropping all passwords
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34139
diff changeset
138 purple_account_get_username(account),
9d90967f2485 Don't close a keyring before dropping all passwords
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34139
diff changeset
139 purple_account_get_protocol_id(account));
9d90967f2485 Don't close a keyring before dropping all passwords
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34139
diff changeset
140 }
34136
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
141 } else {
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
142 password = NULL;
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
143 purple_debug_warning("keyring-gnome", "Failed to read "
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
144 "password for account %s (%s), code: %d.\n",
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
145 purple_account_get_username(account),
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
146 purple_account_get_protocol_id(account),
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
147 result);
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
148 }
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
149
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
150 if (req->cb.read != NULL)
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
151 req->cb.read(account, password, error, req->cb_data);
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
152 req->handled = TRUE;
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
153
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
154 if (error)
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
155 g_error_free(error);
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
156
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
157 gnomekeyring_process_queue();
33984
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
158 }
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
159
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
160 static void
34136
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
161 gnomekeyring_save_cb(GnomeKeyringResult result, gpointer _req)
33984
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
162 {
34136
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
163 gnomekeyring_request *req = _req;
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
164 PurpleAccount *account;
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
165 GError *error = NULL;
34141
9d90967f2485 Don't close a keyring before dropping all passwords
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34139
diff changeset
166 gboolean already_removed = FALSE;
34136
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
167
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
168 g_return_if_fail(req != NULL);
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
169
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
170 current_request = NULL;
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
171 account = req->account;
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
172
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
173 if (result == GNOME_KEYRING_RESULT_OK) {
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
174 error = NULL;
34141
9d90967f2485 Don't close a keyring before dropping all passwords
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34139
diff changeset
175 } else if (result == GNOME_KEYRING_RESULT_NO_MATCH &&
35362
a6223370667b Style: fix braces for http, keyring
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35190
diff changeset
176 req->password == NULL)
a6223370667b Style: fix braces for http, keyring
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35190
diff changeset
177 {
34141
9d90967f2485 Don't close a keyring before dropping all passwords
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34139
diff changeset
178 error = NULL;
9d90967f2485 Don't close a keyring before dropping all passwords
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34139
diff changeset
179 already_removed = TRUE;
34136
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
180 } else if (result == GNOME_KEYRING_RESULT_DENIED ||
35362
a6223370667b Style: fix braces for http, keyring
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35190
diff changeset
181 result == GNOME_KEYRING_RESULT_CANCELLED)
a6223370667b Style: fix braces for http, keyring
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35190
diff changeset
182 {
34136
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
183 error = g_error_new(PURPLE_KEYRING_ERROR,
34154
857c361d3791 Refine keyring error coded
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34141
diff changeset
184 PURPLE_KEYRING_ERROR_ACCESSDENIED,
34199
73d122f25f2b Localize strings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34170
diff changeset
185 _("Access denied."));
34136
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
186 gnomekeyring_cancel_queue();
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
187 } else if (result == GNOME_KEYRING_RESULT_NO_KEYRING_DAEMON ||
35362
a6223370667b Style: fix braces for http, keyring
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35190
diff changeset
188 result == GNOME_KEYRING_RESULT_IO_ERROR)
a6223370667b Style: fix braces for http, keyring
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35190
diff changeset
189 {
34136
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
190 error = g_error_new(PURPLE_KEYRING_ERROR,
34154
857c361d3791 Refine keyring error coded
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34141
diff changeset
191 PURPLE_KEYRING_ERROR_BACKENDFAIL,
34199
73d122f25f2b Localize strings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34170
diff changeset
192 _("Communication with GNOME Keyring failed."));
34136
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
193 } else {
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
194 error = g_error_new(PURPLE_KEYRING_ERROR,
34154
857c361d3791 Refine keyring error coded
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34141
diff changeset
195 PURPLE_KEYRING_ERROR_BACKENDFAIL,
34199
73d122f25f2b Localize strings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34170
diff changeset
196 _("Unknown error (code: %d)."), result);
34136
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
197 }
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
198
34141
9d90967f2485 Don't close a keyring before dropping all passwords
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34139
diff changeset
199 if (already_removed) {
9d90967f2485 Don't close a keyring before dropping all passwords
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34139
diff changeset
200 /* no operation */
9d90967f2485 Don't close a keyring before dropping all passwords
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34139
diff changeset
201 } else if (error == NULL) {
34136
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
202 purple_debug_misc("keyring-gnome",
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
203 "Password %s for account %s (%s).\n",
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
204 req->password ? "saved" : "removed",
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
205 purple_account_get_username(account),
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
206 purple_account_get_protocol_id(account));
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
207 } else {
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
208 purple_debug_warning("keyring-gnome", "Failed updating "
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
209 "password for account %s (%s), code: %d.\n",
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
210 purple_account_get_username(account),
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
211 purple_account_get_protocol_id(account),
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
212 result);
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
213 }
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
214
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
215 if (req->cb.save != NULL)
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
216 req->cb.save(account, error, req->cb_data);
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
217 req->handled = TRUE;
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
218
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
219 if (error)
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
220 g_error_free(error);
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
221
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
222 gnomekeyring_process_queue();
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
223 }
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
224
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
225 static void
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
226 gnomekeyring_request_cancel(gpointer _req)
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
227 {
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
228 gnomekeyring_request *req = _req;
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
229 PurpleAccount *account;
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
230 GError *error;
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
231
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
232 g_return_if_fail(req != NULL);
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
233
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
234 if (req->handled) {
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
235 gnomekeyring_request_free(req);
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
236 return;
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
237 }
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
238
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
239 purple_debug_warning("keyring-gnome",
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
240 "operation cancelled (%d %s:%s)\n", req->type,
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
241 purple_account_get_protocol_id(req->account),
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
242 purple_account_get_username(req->account));
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
243
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
244 account = req->account;
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
245 error = g_error_new(PURPLE_KEYRING_ERROR,
34154
857c361d3791 Refine keyring error coded
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34141
diff changeset
246 PURPLE_KEYRING_ERROR_CANCELLED,
34199
73d122f25f2b Localize strings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34170
diff changeset
247 _("Operation cancelled."));
34136
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
248 if (req->type == GNOMEKEYRING_REQUEST_READ && req->cb.read)
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
249 req->cb.read(account, NULL, error, req->cb_data);
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
250 if (req->type == GNOMEKEYRING_REQUEST_SAVE && req->cb.save)
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
251 req->cb.save(account, error, req->cb_data);
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
252 g_error_free(error);
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
253
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
254 gnomekeyring_request_free(req);
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
255 gnomekeyring_process_queue();
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
256 }
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
257
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
258 static void
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
259 gnomekeyring_cancel_queue(void)
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
260 {
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
261 GList *cancel_list = request_queue;
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
262
34139
37d7d0e22484 Revert existing password migration at exit, allow cancelling kwallet requests
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34138
diff changeset
263 if (request_queue == NULL)
37d7d0e22484 Revert existing password migration at exit, allow cancelling kwallet requests
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34138
diff changeset
264 return;
37d7d0e22484 Revert existing password migration at exit, allow cancelling kwallet requests
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34138
diff changeset
265
34136
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
266 purple_debug_info("gnome-keyring", "cancelling all pending requests\n");
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
267 request_queue = NULL;
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
268
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
269 g_list_free_full(cancel_list, gnomekeyring_request_cancel);
33984
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
270 }
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
271
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
272 static void
34136
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
273 gnomekeyring_process_queue(void)
33984
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
274 {
34136
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
275 gnomekeyring_request *req;
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
276 PurpleAccount *account;
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
277 GList *first;
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
278
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
279 if (request_queue == NULL)
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
280 return;
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
281
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
282 if (current_request) {
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
283 if (purple_debug_is_verbose())
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
284 purple_debug_misc("keyring-gnome", "busy...\n");
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
285 return;
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
286 }
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
287
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
288 first = g_list_first(request_queue);
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
289 req = first->data;
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
290 request_queue = g_list_delete_link(request_queue, first);
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
291 account = req->account;
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
292
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
293 if (purple_debug_is_verbose()) {
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
294 purple_debug_misc("keyring-gnome",
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
295 "%s password for account %s (%s)\n",
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
296 req->type == GNOMEKEYRING_REQUEST_READ ? "reading" :
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
297 (req->password == NULL ? "removing" : "updating"),
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
298 purple_account_get_username(account),
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
299 purple_account_get_protocol_id(account));
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
300 }
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
301
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
302 if (req->type == GNOMEKEYRING_REQUEST_READ) {
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
303 current_request = gnome_keyring_find_password(
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
304 GNOME_KEYRING_NETWORK_PASSWORD, gnomekeyring_read_cb,
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
305 req, gnomekeyring_request_cancel,
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
306 "user", purple_account_get_username(account),
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
307 "protocol", purple_account_get_protocol_id(account),
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
308 NULL);
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
309 } else if (req->type == GNOMEKEYRING_REQUEST_SAVE &&
35362
a6223370667b Style: fix braces for http, keyring
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35190
diff changeset
310 req->password != NULL)
a6223370667b Style: fix braces for http, keyring
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35190
diff changeset
311 {
34170
94102637e7c7 Coding style and entry description for GNOME Keyring
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34155
diff changeset
312 gchar *display_name = g_strdup_printf(
94102637e7c7 Coding style and entry description for GNOME Keyring
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34155
diff changeset
313 _("Pidgin IM password for account %s"),
94102637e7c7 Coding style and entry description for GNOME Keyring
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34155
diff changeset
314 purple_account_get_username(account));
34136
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
315 current_request = gnome_keyring_store_password(
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
316 GNOME_KEYRING_NETWORK_PASSWORD, GNOME_KEYRING_DEFAULT,
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
317 display_name, req->password, gnomekeyring_save_cb, req,
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
318 gnomekeyring_request_cancel,
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
319 "user", purple_account_get_username(account),
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
320 "protocol", purple_account_get_protocol_id(account),
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
321 NULL);
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
322 g_free(display_name);
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
323 } else if (req->type == GNOMEKEYRING_REQUEST_SAVE &&
35362
a6223370667b Style: fix braces for http, keyring
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35190
diff changeset
324 req->password == NULL)
a6223370667b Style: fix braces for http, keyring
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35190
diff changeset
325 {
34136
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
326 current_request = gnome_keyring_delete_password(
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
327 GNOME_KEYRING_NETWORK_PASSWORD, gnomekeyring_save_cb,
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
328 req, gnomekeyring_request_cancel,
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
329 "user", purple_account_get_username(account),
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
330 "protocol", purple_account_get_protocol_id(account),
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
331 NULL);
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
332 } else {
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
333 g_return_if_reached();
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
334 }
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
335 }
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
336
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
337 static void
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
338 gnomekeyring_read(PurpleAccount *account, PurpleKeyringReadCallback cb,
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
339 gpointer data)
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
340 {
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
341 gnomekeyring_request *req;
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
342
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
343 g_return_if_fail(account != NULL);
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
344
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
345 req = g_new0(gnomekeyring_request, 1);
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
346 req->type = GNOMEKEYRING_REQUEST_READ;
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
347 req->account = account;
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
348 req->cb.read = cb;
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
349 req->cb_data = data;
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
350
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
351 gnomekeyring_enqueue(req);
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
352 }
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
353
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
354 static void
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
355 gnomekeyring_save(PurpleAccount *account, const gchar *password,
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
356 PurpleKeyringSaveCallback cb, gpointer data)
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
357 {
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
358 gnomekeyring_request *req;
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
359
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
360 g_return_if_fail(account != NULL);
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
361
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
362 req = g_new0(gnomekeyring_request, 1);
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
363 req->type = GNOMEKEYRING_REQUEST_SAVE;
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
364 req->account = account;
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
365 req->password = gnome_keyring_memory_strdup(password);
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
366 req->cb.save = cb;
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
367 req->cb_data = data;
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
368
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
369 gnomekeyring_enqueue(req);
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
370 }
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
371
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
372 static void
34139
37d7d0e22484 Revert existing password migration at exit, allow cancelling kwallet requests
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34138
diff changeset
373 gnomekeyring_cancel(void)
34138
2bda8642afa3 Early cancelling password requests before quitting
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34136
diff changeset
374 {
2bda8642afa3 Early cancelling password requests before quitting
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34136
diff changeset
375 gnomekeyring_cancel_queue();
2bda8642afa3 Early cancelling password requests before quitting
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34136
diff changeset
376 if (current_request) {
2bda8642afa3 Early cancelling password requests before quitting
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34136
diff changeset
377 gnome_keyring_cancel_request(current_request);
2bda8642afa3 Early cancelling password requests before quitting
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34136
diff changeset
378 while (g_main_iteration(FALSE));
2bda8642afa3 Early cancelling password requests before quitting
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34136
diff changeset
379 }
2bda8642afa3 Early cancelling password requests before quitting
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34136
diff changeset
380 }
2bda8642afa3 Early cancelling password requests before quitting
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34136
diff changeset
381
2bda8642afa3 Early cancelling password requests before quitting
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34136
diff changeset
382 static void
34155
567c48f9658c Refactor the keyring API
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34154
diff changeset
383 gnomekeyring_close(void)
34136
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
384 {
34138
2bda8642afa3 Early cancelling password requests before quitting
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34136
diff changeset
385 gnomekeyring_cancel();
33984
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
386 }
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
387
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
388 static gboolean
34136
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
389 gnomekeyring_load(PurplePlugin *plugin)
33984
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
390 {
34294
f07214b611a4 Fix a crash in case of Ctrl+C while booting (libgnomekeyring bug)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34281
diff changeset
391 GModule *gkr_module;
f07214b611a4 Fix a crash in case of Ctrl+C while booting (libgnomekeyring bug)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34281
diff changeset
392
f07214b611a4 Fix a crash in case of Ctrl+C while booting (libgnomekeyring bug)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34281
diff changeset
393 /* libgnome-keyring may crash, if was unloaded before glib main loop
f07214b611a4 Fix a crash in case of Ctrl+C while booting (libgnomekeyring bug)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34281
diff changeset
394 * termination.
f07214b611a4 Fix a crash in case of Ctrl+C while booting (libgnomekeyring bug)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34281
diff changeset
395 */
f07214b611a4 Fix a crash in case of Ctrl+C while booting (libgnomekeyring bug)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34281
diff changeset
396 gkr_module = g_module_open("libgnome-keyring", 0);
f07214b611a4 Fix a crash in case of Ctrl+C while booting (libgnomekeyring bug)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34281
diff changeset
397 if (gkr_module == NULL) {
f07214b611a4 Fix a crash in case of Ctrl+C while booting (libgnomekeyring bug)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34281
diff changeset
398 purple_debug_info("keyring-gnome", "GNOME Keyring module not "
f07214b611a4 Fix a crash in case of Ctrl+C while booting (libgnomekeyring bug)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34281
diff changeset
399 "found\n");
f07214b611a4 Fix a crash in case of Ctrl+C while booting (libgnomekeyring bug)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34281
diff changeset
400 return FALSE;
f07214b611a4 Fix a crash in case of Ctrl+C while booting (libgnomekeyring bug)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34281
diff changeset
401 }
f07214b611a4 Fix a crash in case of Ctrl+C while booting (libgnomekeyring bug)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34281
diff changeset
402 g_module_make_resident(gkr_module);
f07214b611a4 Fix a crash in case of Ctrl+C while booting (libgnomekeyring bug)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34281
diff changeset
403
34135
528b3084b3b3 Initial version of re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34129
diff changeset
404 if (!gnome_keyring_is_available()) {
528b3084b3b3 Initial version of re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34129
diff changeset
405 purple_debug_info("keyring-gnome", "GNOME Keyring service is "
528b3084b3b3 Initial version of re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34129
diff changeset
406 "disabled\n");
528b3084b3b3 Initial version of re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34129
diff changeset
407 return FALSE;
528b3084b3b3 Initial version of re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34129
diff changeset
408 }
33984
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
409
34135
528b3084b3b3 Initial version of re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34129
diff changeset
410 keyring_handler = purple_keyring_new();
528b3084b3b3 Initial version of re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34129
diff changeset
411
34281
ad957d0a467a Keyring (and some GTK): fix translation callbacks
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34199
diff changeset
412 purple_keyring_set_name(keyring_handler, _(GNOMEKEYRING_NAME));
34135
528b3084b3b3 Initial version of re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34129
diff changeset
413 purple_keyring_set_id(keyring_handler, GNOMEKEYRING_ID);
34136
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
414 purple_keyring_set_read_password(keyring_handler, gnomekeyring_read);
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
415 purple_keyring_set_save_password(keyring_handler, gnomekeyring_save);
34170
94102637e7c7 Coding style and entry description for GNOME Keyring
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34155
diff changeset
416 purple_keyring_set_cancel_requests(keyring_handler,
94102637e7c7 Coding style and entry description for GNOME Keyring
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34155
diff changeset
417 gnomekeyring_cancel);
34136
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
418 purple_keyring_set_close_keyring(keyring_handler, gnomekeyring_close);
34135
528b3084b3b3 Initial version of re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34129
diff changeset
419
528b3084b3b3 Initial version of re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34129
diff changeset
420 purple_keyring_register(keyring_handler);
33984
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
421
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
422 return TRUE;
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
423 }
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
424
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
425 static gboolean
34136
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
426 gnomekeyring_unload(PurplePlugin *plugin)
33984
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
427 {
34135
528b3084b3b3 Initial version of re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34129
diff changeset
428 if (purple_keyring_get_inuse() == keyring_handler) {
528b3084b3b3 Initial version of re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34129
diff changeset
429 purple_debug_warning("keyring-gnome",
528b3084b3b3 Initial version of re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34129
diff changeset
430 "keyring in use, cannot unload\n");
33984
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
431 return FALSE;
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
432 }
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
433
34155
567c48f9658c Refactor the keyring API
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34154
diff changeset
434 gnomekeyring_close();
34135
528b3084b3b3 Initial version of re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34129
diff changeset
435
33987
9beebdbf44d6 Fixed many bugs and crashes in the keyring subsystem.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33984
diff changeset
436 purple_keyring_unregister(keyring_handler);
33984
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
437 purple_keyring_free(keyring_handler);
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
438 keyring_handler = NULL;
34096
3d28c3311ad0 Don't allow unloading a plugin if its keyring is active.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34095
diff changeset
439
33984
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
440 return TRUE;
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
441 }
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
442
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
443 PurplePluginInfo plugininfo =
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
444 {
34034
f508fa47f2ac Reformat many things.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34033
diff changeset
445 PURPLE_PLUGIN_MAGIC, /* magic */
f508fa47f2ac Reformat many things.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34033
diff changeset
446 PURPLE_MAJOR_VERSION, /* major_version */
f508fa47f2ac Reformat many things.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34033
diff changeset
447 PURPLE_MINOR_VERSION, /* minor_version */
f508fa47f2ac Reformat many things.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34033
diff changeset
448 PURPLE_PLUGIN_STANDARD, /* type */
34135
528b3084b3b3 Initial version of re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34129
diff changeset
449 NULL, /* ui_requirement */
34116
825c98f8c7f6 Get rid of PURPLE_PLUGIN_FLAG_AUTOLOAD
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34098
diff changeset
450 PURPLE_PLUGIN_FLAG_INVISIBLE, /* flags */
34135
528b3084b3b3 Initial version of re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34129
diff changeset
451 NULL, /* dependencies */
34034
f508fa47f2ac Reformat many things.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34033
diff changeset
452 PURPLE_PRIORITY_DEFAULT, /* priority */
34135
528b3084b3b3 Initial version of re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34129
diff changeset
453 GNOMEKEYRING_ID, /* id */
528b3084b3b3 Initial version of re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34129
diff changeset
454 GNOMEKEYRING_NAME, /* name */
528b3084b3b3 Initial version of re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34129
diff changeset
455 DISPLAY_VERSION, /* version */
34048
2d14a219c886 Make stuff consistent.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34047
diff changeset
456 "GNOME Keyring Plugin", /* summary */
34034
f508fa47f2ac Reformat many things.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34033
diff changeset
457 GNOMEKEYRING_DESCRIPTION, /* description */
f508fa47f2ac Reformat many things.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34033
diff changeset
458 GNOMEKEYRING_AUTHOR, /* author */
34135
528b3084b3b3 Initial version of re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34129
diff changeset
459 PURPLE_WEBSITE, /* homepage */
34136
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
460 gnomekeyring_load, /* load */
e9722a935271 Re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34135
diff changeset
461 gnomekeyring_unload, /* unload */
34135
528b3084b3b3 Initial version of re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34129
diff changeset
462 NULL, /* destroy */
528b3084b3b3 Initial version of re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34129
diff changeset
463 NULL, /* ui_info */
528b3084b3b3 Initial version of re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34129
diff changeset
464 NULL, /* extra_info */
528b3084b3b3 Initial version of re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34129
diff changeset
465 NULL, /* prefs_info */
528b3084b3b3 Initial version of re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34129
diff changeset
466 NULL, /* actions */
528b3084b3b3 Initial version of re-implemented GNOME Keyring plugin
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34129
diff changeset
467 NULL, NULL, NULL, NULL /* padding */
33984
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
468 };
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
469
34033
910f2ed3988b Remove trailing whitespace.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34032
diff changeset
470 static void
33984
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
471 init_plugin(PurplePlugin *plugin)
34033
910f2ed3988b Remove trailing whitespace.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34032
diff changeset
472 {
33984
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
473 }
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
474
34005
592e6e8213a9 Cleanup in gnomekeyring.c
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33998
diff changeset
475 PURPLE_INIT_PLUGIN(gnome_keyring, init_plugin, plugininfo)

mercurial