libpurple/plugins/keyrings/internalkeyring.c

Sun, 06 Nov 2011 05:08:21 +0000

author
Elliott Sales de Andrade <qulogic@pidgin.im>
date
Sun, 06 Nov 2011 05:08:21 +0000
branch
soc.2008.masterpassword
changeset 34051
07742e8210e2
parent 34048
2d14a219c886
child 34052
709b8f5143fa
permissions
-rw-r--r--

These macros just mask what's going on here.

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 internalkeyring.c internal keyring
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 *
34033
910f2ed3988b Remove trailing whitespace.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34032
diff changeset
5 * @todo
33984
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
6 * cleanup error handling and reporting
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
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
9 /* purple
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
10 *
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
11 * 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
12 * 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
13 * source distribution.
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
14 *
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
15 * 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
16 * 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
17 * 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
18 * (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
19 *
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
20 * 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
21 * 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
22 * 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
23 * 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
24 *
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
25 * 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
26 * along with this program ; if not, write to the Free Software
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
28 */
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
29
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
30 #ifdef HAVE_CONFIG_H
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
31 # include <config.h>
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
32 #endif
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
33
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
34 #ifndef PURPLE_PLUGINS
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
35 # define PURPLE_PLUGINS
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
36 #endif
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
37
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
38 #include <glib.h>
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
39
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
40 #include "account.h"
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
41 #include "version.h"
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
42 #include "keyring.h"
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
43 #include "debug.h"
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
44 #include "plugin.h"
33998
5fcfc69be362 Added support for master password in pidgin's pref interface.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33997
diff changeset
45 #include "internal.h"
33984
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
46
34034
f508fa47f2ac Reformat many things.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34033
diff changeset
47 #define INTERNALKEYRING_NAME N_("Internal keyring")
f508fa47f2ac Reformat many things.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34033
diff changeset
48 #define INTERNALKEYRING_VERSION "0.8b"
f508fa47f2ac Reformat many things.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34033
diff changeset
49 #define INTERNALKEYRING_DESCRIPTION N_("This plugin provides the default password storage behaviour for libpurple. Password will be stored unencrypted.")
f508fa47f2ac Reformat many things.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34033
diff changeset
50 #define INTERNALKEYRING_AUTHOR "Scrouaf (scrouaf[at]soc.pidgin.im)"
34036
bf17ffca901d Give this a better name.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34035
diff changeset
51 #define INTERNALKEYRING_ID PURPLE_DEFAULT_KEYRING
33984
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
52
33987
9beebdbf44d6 Fixed many bugs and crashes in the keyring subsystem.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33984
diff changeset
53 #define ACTIVATE()\
9beebdbf44d6 Fixed many bugs and crashes in the keyring subsystem.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33984
diff changeset
54 if (internal_keyring_is_active == FALSE)\
34033
910f2ed3988b Remove trailing whitespace.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34032
diff changeset
55 internal_keyring_open();
910f2ed3988b Remove trailing whitespace.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34032
diff changeset
56
34034
f508fa47f2ac Reformat many things.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34033
diff changeset
57 static GHashTable *internal_keyring_passwords = NULL;
f508fa47f2ac Reformat many things.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34033
diff changeset
58 static PurpleKeyring *keyring_handler = NULL;
33987
9beebdbf44d6 Fixed many bugs and crashes in the keyring subsystem.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33984
diff changeset
59 static gboolean internal_keyring_is_active = FALSE;
33984
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
60
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
61 /***********************************************/
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
62 /* Keyring interface */
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
63 /***********************************************/
34032
2eeafc43c7f2 Rearrange code so we can drop the prototypes. Most of it was already
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34031
diff changeset
64 static void
34034
f508fa47f2ac Reformat many things.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34033
diff changeset
65 internal_keyring_open(void)
34032
2eeafc43c7f2 Rearrange code so we can drop the prototypes. Most of it was already
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34031
diff changeset
66 {
2eeafc43c7f2 Rearrange code so we can drop the prototypes. Most of it was already
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34031
diff changeset
67 internal_keyring_passwords = g_hash_table_new_full(g_direct_hash,
2eeafc43c7f2 Rearrange code so we can drop the prototypes. Most of it was already
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34031
diff changeset
68 g_direct_equal, NULL, g_free);
2eeafc43c7f2 Rearrange code so we can drop the prototypes. Most of it was already
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34031
diff changeset
69 internal_keyring_is_active = TRUE;
2eeafc43c7f2 Rearrange code so we can drop the prototypes. Most of it was already
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34031
diff changeset
70 }
2eeafc43c7f2 Rearrange code so we can drop the prototypes. Most of it was already
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34031
diff changeset
71
34033
910f2ed3988b Remove trailing whitespace.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34032
diff changeset
72 static void
34034
f508fa47f2ac Reformat many things.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34033
diff changeset
73 internal_keyring_read(PurpleAccount *account,
f508fa47f2ac Reformat many things.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34033
diff changeset
74 PurpleKeyringReadCallback cb,
f508fa47f2ac Reformat many things.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34033
diff changeset
75 gpointer data)
33984
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
76 {
34041
75204e58b8ca Fix const-ness of strings, and silly strdups.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34036
diff changeset
77 const char *password;
34034
f508fa47f2ac Reformat many things.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34033
diff changeset
78 GError *error;
33984
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
79
33987
9beebdbf44d6 Fixed many bugs and crashes in the keyring subsystem.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33984
diff changeset
80 ACTIVATE();
9beebdbf44d6 Fixed many bugs and crashes in the keyring subsystem.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33984
diff changeset
81
34048
2d14a219c886 Make stuff consistent.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34047
diff changeset
82 purple_debug_info("keyring-internal",
33987
9beebdbf44d6 Fixed many bugs and crashes in the keyring subsystem.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33984
diff changeset
83 "Reading password for account %s (%s).\n",
9beebdbf44d6 Fixed many bugs and crashes in the keyring subsystem.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33984
diff changeset
84 purple_account_get_username(account),
9beebdbf44d6 Fixed many bugs and crashes in the keyring subsystem.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33984
diff changeset
85 purple_account_get_protocol_id(account));
9beebdbf44d6 Fixed many bugs and crashes in the keyring subsystem.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33984
diff changeset
86
34051
07742e8210e2 These macros just mask what's going on here.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34048
diff changeset
87 password = g_hash_table_lookup(internal_keyring_passwords, account);
33984
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
88
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
89 if (password != NULL) {
34034
f508fa47f2ac Reformat many things.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34033
diff changeset
90 if (cb != NULL)
33987
9beebdbf44d6 Fixed many bugs and crashes in the keyring subsystem.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33984
diff changeset
91 cb(account, password, NULL, data);
33984
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
92 } else {
34047
c2e68ddbf27c Correctly namespace these keyring errors.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34041
diff changeset
93 error = g_error_new(PURPLE_KEYRING_ERROR,
34048
2d14a219c886 Make stuff consistent.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34047
diff changeset
94 PURPLE_KEYRING_ERROR_NOPASSWD, "Password not found.");
34034
f508fa47f2ac Reformat many things.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34033
diff changeset
95 if (cb != NULL)
33987
9beebdbf44d6 Fixed many bugs and crashes in the keyring subsystem.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33984
diff changeset
96 cb(account, NULL, error, data);
33984
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
97 g_error_free(error);
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
98 }
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
99 }
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
100
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
101 static void
34034
f508fa47f2ac Reformat many things.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34033
diff changeset
102 internal_keyring_save(PurpleAccount *account,
f508fa47f2ac Reformat many things.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34033
diff changeset
103 const gchar *password,
f508fa47f2ac Reformat many things.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34033
diff changeset
104 PurpleKeyringSaveCallback cb,
f508fa47f2ac Reformat many things.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34033
diff changeset
105 gpointer data)
33984
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
106 {
33987
9beebdbf44d6 Fixed many bugs and crashes in the keyring subsystem.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33984
diff changeset
107 ACTIVATE();
9beebdbf44d6 Fixed many bugs and crashes in the keyring subsystem.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33984
diff changeset
108
33995
53b3189d7c84 Broke something. Again. Commiting so i get back here if need be.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33994
diff changeset
109 if (password == NULL || *password == '\0') {
33984
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
110 g_hash_table_remove(internal_keyring_passwords, account);
34048
2d14a219c886 Make stuff consistent.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34047
diff changeset
111 purple_debug_info("keyring-internal",
33987
9beebdbf44d6 Fixed many bugs and crashes in the keyring subsystem.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33984
diff changeset
112 "Deleted password for account %s (%s).\n",
9beebdbf44d6 Fixed many bugs and crashes in the keyring subsystem.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33984
diff changeset
113 purple_account_get_username(account),
9beebdbf44d6 Fixed many bugs and crashes in the keyring subsystem.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33984
diff changeset
114 purple_account_get_protocol_id(account));
33984
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
115 } else {
34051
07742e8210e2 These macros just mask what's going on here.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34048
diff changeset
116 g_hash_table_replace(internal_keyring_passwords, account, g_strdup(password));
34048
2d14a219c886 Make stuff consistent.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34047
diff changeset
117 purple_debug_info("keyring-internal",
33987
9beebdbf44d6 Fixed many bugs and crashes in the keyring subsystem.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33984
diff changeset
118 "Updated password for account %s (%s).\n",
9beebdbf44d6 Fixed many bugs and crashes in the keyring subsystem.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33984
diff changeset
119 purple_account_get_username(account),
9beebdbf44d6 Fixed many bugs and crashes in the keyring subsystem.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33984
diff changeset
120 purple_account_get_protocol_id(account));
9beebdbf44d6 Fixed many bugs and crashes in the keyring subsystem.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33984
diff changeset
121
33984
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
122 }
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
123
33987
9beebdbf44d6 Fixed many bugs and crashes in the keyring subsystem.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33984
diff changeset
124 if (cb != NULL)
9beebdbf44d6 Fixed many bugs and crashes in the keyring subsystem.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33984
diff changeset
125 cb(account, NULL, data);
33984
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
126 }
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
127
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
128
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
129 static void
34034
f508fa47f2ac Reformat many things.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34033
diff changeset
130 internal_keyring_close(GError **error)
33984
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
131 {
33987
9beebdbf44d6 Fixed many bugs and crashes in the keyring subsystem.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33984
diff changeset
132 internal_keyring_is_active = FALSE;
9beebdbf44d6 Fixed many bugs and crashes in the keyring subsystem.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33984
diff changeset
133
9beebdbf44d6 Fixed many bugs and crashes in the keyring subsystem.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33984
diff changeset
134 g_hash_table_destroy(internal_keyring_passwords);
9beebdbf44d6 Fixed many bugs and crashes in the keyring subsystem.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33984
diff changeset
135 internal_keyring_passwords = NULL;
9beebdbf44d6 Fixed many bugs and crashes in the keyring subsystem.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33984
diff changeset
136 }
9beebdbf44d6 Fixed many bugs and crashes in the keyring subsystem.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33984
diff changeset
137
33984
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
138 static gboolean
34034
f508fa47f2ac Reformat many things.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34033
diff changeset
139 internal_keyring_import_password(PurpleAccount *account,
f508fa47f2ac Reformat many things.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34033
diff changeset
140 const char *mode,
f508fa47f2ac Reformat many things.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34033
diff changeset
141 const char *data,
f508fa47f2ac Reformat many things.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34033
diff changeset
142 GError **error)
33984
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
143 {
33987
9beebdbf44d6 Fixed many bugs and crashes in the keyring subsystem.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33984
diff changeset
144 ACTIVATE();
9beebdbf44d6 Fixed many bugs and crashes in the keyring subsystem.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33984
diff changeset
145
34048
2d14a219c886 Make stuff consistent.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34047
diff changeset
146 purple_debug_info("keyring-internal", "Importing password.\n");
33987
9beebdbf44d6 Fixed many bugs and crashes in the keyring subsystem.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33984
diff changeset
147
34033
910f2ed3988b Remove trailing whitespace.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34032
diff changeset
148 if (account != NULL &&
33984
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
149 data != NULL &&
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
150 (mode == NULL || g_strcmp0(mode, "cleartext") == 0)) {
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
151
34051
07742e8210e2 These macros just mask what's going on here.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34048
diff changeset
152 g_hash_table_replace(internal_keyring_passwords, account, g_strdup(data));
33984
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
153 return TRUE;
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
154
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
155 } else {
34048
2d14a219c886 Make stuff consistent.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34047
diff changeset
156 *error = g_error_new(PURPLE_KEYRING_ERROR, PURPLE_KEYRING_ERROR_NOPASSWD, "No password for account.");
33984
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
157 return FALSE;
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 }
33987
9beebdbf44d6 Fixed many bugs and crashes in the keyring subsystem.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33984
diff changeset
160
9beebdbf44d6 Fixed many bugs and crashes in the keyring subsystem.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33984
diff changeset
161 return TRUE;
33984
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
162 }
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
163
34033
910f2ed3988b Remove trailing whitespace.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34032
diff changeset
164 static gboolean
34034
f508fa47f2ac Reformat many things.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34033
diff changeset
165 internal_keyring_export_password(PurpleAccount *account,
f508fa47f2ac Reformat many things.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34033
diff changeset
166 const char **mode,
f508fa47f2ac Reformat many things.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34033
diff changeset
167 char **data,
f508fa47f2ac Reformat many things.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34033
diff changeset
168 GError **error,
f508fa47f2ac Reformat many things.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34033
diff changeset
169 GDestroyNotify *destroy)
33984
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
170 {
34034
f508fa47f2ac Reformat many things.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34033
diff changeset
171 gchar *password;
33984
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
172
33987
9beebdbf44d6 Fixed many bugs and crashes in the keyring subsystem.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33984
diff changeset
173 ACTIVATE();
9beebdbf44d6 Fixed many bugs and crashes in the keyring subsystem.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33984
diff changeset
174
34048
2d14a219c886 Make stuff consistent.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34047
diff changeset
175 purple_debug_info("keyring-internal", "Exporting password.\n");
33987
9beebdbf44d6 Fixed many bugs and crashes in the keyring subsystem.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33984
diff changeset
176
34051
07742e8210e2 These macros just mask what's going on here.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34048
diff changeset
177 password = g_hash_table_lookup(internal_keyring_passwords, account);
33984
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
178
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
179 if (password == NULL) {
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
180 return FALSE;
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
181 } else {
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
182 *mode = "cleartext";
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
183 *data = g_strdup(password);
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
184 *destroy = g_free;
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
185 return TRUE;
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
186 }
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
187 }
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
188
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
189 static void
34034
f508fa47f2ac Reformat many things.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34033
diff changeset
190 internal_keyring_init(void)
33984
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
191 {
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
192 keyring_handler = purple_keyring_new();
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
193
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
194 purple_keyring_set_name(keyring_handler, INTERNALKEYRING_NAME);
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
195 purple_keyring_set_id(keyring_handler, INTERNALKEYRING_ID);
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
196 purple_keyring_set_read_password(keyring_handler, internal_keyring_read);
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
197 purple_keyring_set_save_password(keyring_handler, internal_keyring_save);
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
198 purple_keyring_set_close_keyring(keyring_handler, internal_keyring_close);
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
199 purple_keyring_set_change_master(keyring_handler, NULL);
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
200 purple_keyring_set_import_password(keyring_handler, internal_keyring_import_password);
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
201 purple_keyring_set_export_password(keyring_handler, internal_keyring_export_password);
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
202
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
203 purple_keyring_register(keyring_handler);
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
204 }
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
205
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
206 static void
34034
f508fa47f2ac Reformat many things.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34033
diff changeset
207 internal_keyring_uninit(void)
33984
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
208 {
33987
9beebdbf44d6 Fixed many bugs and crashes in the keyring subsystem.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33984
diff changeset
209 internal_keyring_close(NULL);
9beebdbf44d6 Fixed many bugs and crashes in the keyring subsystem.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33984
diff changeset
210 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
211
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
212 }
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
213
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
214 /***********************************************/
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
215 /* Plugin interface */
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
216 /***********************************************/
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
217
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
218 static gboolean
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
219 internal_keyring_load(PurplePlugin *plugin)
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
220 {
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
221 internal_keyring_init();
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
222 return TRUE;
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
223 }
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
224
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
225 static gboolean
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
226 internal_keyring_unload(PurplePlugin *plugin)
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
227 {
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
228 internal_keyring_uninit();
33987
9beebdbf44d6 Fixed many bugs and crashes in the keyring subsystem.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33984
diff changeset
229
9beebdbf44d6 Fixed many bugs and crashes in the keyring subsystem.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33984
diff changeset
230 purple_keyring_free(keyring_handler);
9beebdbf44d6 Fixed many bugs and crashes in the keyring subsystem.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33984
diff changeset
231 keyring_handler = NULL;
9beebdbf44d6 Fixed many bugs and crashes in the keyring subsystem.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33984
diff changeset
232
33984
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
233 return TRUE;
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
234 }
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
235
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
236 static void
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
237 internal_keyring_destroy(PurplePlugin *plugin)
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
238 {
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
239 internal_keyring_uninit();
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
240 }
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
241
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
242 PurplePluginInfo plugininfo =
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
243 {
34034
f508fa47f2ac Reformat many things.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34033
diff changeset
244 PURPLE_PLUGIN_MAGIC, /* magic */
f508fa47f2ac Reformat many things.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34033
diff changeset
245 PURPLE_MAJOR_VERSION, /* major_version */
f508fa47f2ac Reformat many things.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34033
diff changeset
246 PURPLE_MINOR_VERSION, /* minor_version */
f508fa47f2ac Reformat many things.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34033
diff changeset
247 PURPLE_PLUGIN_STANDARD, /* type */
33984
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
248 NULL, /* ui_requirement */
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
249 PURPLE_PLUGIN_FLAG_INVISIBLE|PURPLE_PLUGIN_FLAG_AUTOLOAD, /* flags */
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
250 NULL, /* dependencies */
34034
f508fa47f2ac Reformat many things.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34033
diff changeset
251 PURPLE_PRIORITY_DEFAULT, /* priority */
f508fa47f2ac Reformat many things.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34033
diff changeset
252 INTERNALKEYRING_ID, /* id */
f508fa47f2ac Reformat many things.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34033
diff changeset
253 INTERNALKEYRING_NAME, /* name */
f508fa47f2ac Reformat many things.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34033
diff changeset
254 INTERNALKEYRING_VERSION, /* version */
f508fa47f2ac Reformat many things.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34033
diff changeset
255 "Internal Keyring Plugin", /* summary */
f508fa47f2ac Reformat many things.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34033
diff changeset
256 INTERNALKEYRING_DESCRIPTION, /* description */
f508fa47f2ac Reformat many things.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34033
diff changeset
257 INTERNALKEYRING_AUTHOR, /* author */
33984
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
258 "N/A", /* homepage */
34034
f508fa47f2ac Reformat many things.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34033
diff changeset
259 internal_keyring_load, /* load */
f508fa47f2ac Reformat many things.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34033
diff changeset
260 internal_keyring_unload, /* unload */
f508fa47f2ac Reformat many things.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34033
diff changeset
261 internal_keyring_destroy, /* destroy */
33984
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
262 NULL, /* ui_info */
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
263 NULL, /* extra_info */
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
264 NULL, /* prefs_info */
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
265 NULL, /* actions */
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
266 NULL, /* padding... */
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
267 NULL,
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
268 NULL,
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
269 NULL,
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
34033
910f2ed3988b Remove trailing whitespace.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34032
diff changeset
272 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
273 init_plugin(PurplePlugin *plugin)
34033
910f2ed3988b Remove trailing whitespace.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34032
diff changeset
274 {
34048
2d14a219c886 Make stuff consistent.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34047
diff changeset
275 purple_debug_info("keyring-internal", "Init plugin called.\n");
33984
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
276 }
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
277
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
278 PURPLE_INIT_PLUGIN(internal_keyring, init_plugin, plugininfo)
7459475b1495 Added the gnome keyring plugin, and finally got makefiles to work.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
279

mercurial