| 48 #define INTERNALKEYRING_VERSION "0.8b" |
48 #define INTERNALKEYRING_VERSION "0.8b" |
| 49 #define INTERNALKEYRING_DESCRIPTION N_("This plugin provides the default password storage behaviour for libpurple. Password will be stored unencrypted.") |
49 #define INTERNALKEYRING_DESCRIPTION N_("This plugin provides the default password storage behaviour for libpurple. Password will be stored unencrypted.") |
| 50 #define INTERNALKEYRING_AUTHOR "Scrouaf (scrouaf[at]soc.pidgin.im)" |
50 #define INTERNALKEYRING_AUTHOR "Scrouaf (scrouaf[at]soc.pidgin.im)" |
| 51 #define INTERNALKEYRING_ID PURPLE_DEFAULT_KEYRING |
51 #define INTERNALKEYRING_ID PURPLE_DEFAULT_KEYRING |
| 52 |
52 |
| 53 #define ACTIVATE()\ |
53 #define ACTIVATE() \ |
| 54 if (internal_keyring_is_active == FALSE)\ |
54 if (internal_keyring_passwords == NULL) \ |
| 55 internal_keyring_open(); |
55 internal_keyring_open(); |
| 56 |
56 |
| 57 static GHashTable *internal_keyring_passwords = NULL; |
57 static GHashTable *internal_keyring_passwords = NULL; |
| 58 static PurpleKeyring *keyring_handler = NULL; |
58 static PurpleKeyring *keyring_handler = NULL; |
| 59 static gboolean internal_keyring_is_active = FALSE; |
|
| 60 |
59 |
| 61 /***********************************************/ |
60 /***********************************************/ |
| 62 /* Keyring interface */ |
61 /* Keyring interface */ |
| 63 /***********************************************/ |
62 /***********************************************/ |
| 64 static void |
63 static void |
| 65 internal_keyring_open(void) |
64 internal_keyring_open(void) |
| 66 { |
65 { |
| 67 internal_keyring_passwords = g_hash_table_new_full(g_direct_hash, |
66 internal_keyring_passwords = g_hash_table_new_full(g_direct_hash, |
| 68 g_direct_equal, NULL, g_free); |
67 g_direct_equal, NULL, g_free); |
| 69 internal_keyring_is_active = TRUE; |
|
| 70 } |
68 } |
| 71 |
69 |
| 72 static void |
70 static void |
| 73 internal_keyring_read(PurpleAccount *account, |
71 internal_keyring_read(PurpleAccount *account, |
| 74 PurpleKeyringReadCallback cb, |
72 PurpleKeyringReadCallback cb, |