patches/pidgin-01-gnome-keyring.diff
author rickju
Fri, 07 Dec 2007 05:29:45 +0000
changeset 11300 3060d2518108
parent 11157 a01e32482ce3
child 12337 75eef8aa34d6
permissions -rw-r--r--
2007-12-06 Rick Ju <[email protected]> * SUNWgnome-im-client.spec: * base-specs/pidgin.spec: * patches/pidgin-01-gnome-keyring.diff: * patches/pidgin-04-jabber-msg.diff: Bump to pidgin 2.3.0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9968
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
     1
--- 2.0b4-my/libpurple/Makefile.am	2006-10-19 01:38:16.000000000 +0800
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
     2
+++ 2.0b4-my2/libpurple/Makefile.am	2006-11-13 18:28:51.383417000 +0800
10257
9c69d6953f62 2007-08-02 Rick Ju <[email protected]>
rickju
parents: 10139
diff changeset
     3
@@ -230,6 +230,7 @@
9c69d6953f62 2007-08-02 Rick Ju <[email protected]>
rickju
parents: 10139
diff changeset
     4
 	$(GLIB_LIBS) \
9968
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
     5
 	$(LIBXML_LIBS) \
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
     6
 	$(LIBNM_LIBS) \
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
     7
+	$(GAIM_KEYRING_LIBS) \
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
     8
 	$(INTLLIBS) \
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
     9
 	-lm
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    10
 
10257
9c69d6953f62 2007-08-02 Rick Ju <[email protected]>
rickju
parents: 10139
diff changeset
    11
@@ -242,5 +243,6 @@
9968
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    12
 	$(GLIB_CFLAGS) \
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    13
 	$(DEBUG_CFLAGS) \
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    14
 	$(DBUS_CFLAGS) \
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    15
+	$(GAIM_KEYRING_CFLAGS) \
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    16
 	$(LIBXML_CFLAGS) \
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    17
 	$(LIBNM_CFLAGS)
11300
3060d2518108 2007-12-06 Rick Ju <[email protected]>
rickju
parents: 11157
diff changeset
    18
--- pidgin-2.3.0/libpurple/account.c	2007-11-25 03:05:51.000000000 +0800
3060d2518108 2007-12-06 Rick Ju <[email protected]>
rickju
parents: 11157
diff changeset
    19
+++ pidgin-2.3.0-my/libpurple/account.c	2007-12-06 11:35:30.201708000 +0800
3060d2518108 2007-12-06 Rick Ju <[email protected]>
rickju
parents: 11157
diff changeset
    20
@@ -49,6 +49,13 @@
3060d2518108 2007-12-06 Rick Ju <[email protected]>
rickju
parents: 11157
diff changeset
    21
 #define PURPLE_ACCOUNT_GET_PRIVATE(account) \
3060d2518108 2007-12-06 Rick Ju <[email protected]>
rickju
parents: 11157
diff changeset
    22
 	((PurpleAccountPrivate *) (account->priv))
9968
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    23
 
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    24
+#ifdef GAIM_ENABLE_KEYRING
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    25
+#include <gnome-keyring.h>
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    26
+
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    27
+static char * gaim_account_get_password_from_keyring (const char *_prpl, const char *_user);
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    28
+static gboolean gaim_account_set_password_in_keyring (const char *_prpl, const char *_user, const char *password);
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    29
+#endif
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    30
+
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    31
 /* TODO: Should use PurpleValue instead of this?  What about "ui"? */
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    32
 typedef struct
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    33
 {
11300
3060d2518108 2007-12-06 Rick Ju <[email protected]>
rickju
parents: 11157
diff changeset
    34
@@ -363,8 +370,13 @@
9968
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    35
 	if (purple_account_get_remember_password(account) &&
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    36
 		((tmp = purple_account_get_password(account)) != NULL))
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    37
 	{
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    38
+#ifdef GAIM_ENABLE_KEYRING
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    39
+                gaim_account_set_password_in_keyring( purple_account_get_protocol_id(account),
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    40
+                                          purple_account_get_username(account), tmp);
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    41
+#else
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    42
 		child = xmlnode_new_child(node, "password");
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    43
 		xmlnode_insert_data(child, tmp, -1);
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    44
+#endif
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    45
 	}
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    46
 
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    47
 	if ((tmp = purple_account_get_alias(account)) != NULL)
11300
3060d2518108 2007-12-06 Rick Ju <[email protected]>
rickju
parents: 11157
diff changeset
    48
@@ -778,17 +790,30 @@
9968
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    49
 	}
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    50
 
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    51
 	ret = purple_account_new(name, _purple_oscar_convert(name, protocol_id)); /* XXX: */
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    52
-	g_free(name);
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    53
-	g_free(protocol_id);
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    54
-
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    55
-	/* Read the password */
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    56
-	child = xmlnode_get_child(node, "password");
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    57
-	if ((child != NULL) && ((data = xmlnode_get_data(child)) != NULL))
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    58
-	{
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    59
-		purple_account_set_remember_password(ret, TRUE);
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    60
-		purple_account_set_password(ret, data);
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    61
-		g_free(data);
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    62
-	}
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    63
+        gboolean got_pwd = FALSE;
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    64
+#ifdef GAIM_ENABLE_KEYRING
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    65
+        data = gaim_account_get_password_from_keyring(protocol_id, name);
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    66
+        if (data)
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    67
+        {
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    68
+                got_pwd = TRUE;
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    69
+                purple_account_set_remember_password(ret, TRUE);
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    70
+                purple_account_set_password(ret, data);
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    71
+                g_free(data);
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    72
+        }
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    73
+#endif
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    74
+        if (!got_pwd)
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    75
+        {
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    76
+                /* Read the password */
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    77
+		child = xmlnode_get_child(node, "password");
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    78
+		if ((child != NULL) && ((data = xmlnode_get_data(child)) != NULL))
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    79
+		{
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    80
+			purple_account_set_remember_password(ret, TRUE);
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    81
+			purple_account_set_password(ret, data);
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    82
+			g_free(data);
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    83
+		}
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    84
+        }
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    85
+        g_free(name);
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    86
+        g_free(protocol_id);
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    87
 
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    88
 	/* Read the alias */
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    89
 	child = xmlnode_get_child(node, "alias");
11300
3060d2518108 2007-12-06 Rick Ju <[email protected]>
rickju
parents: 11157
diff changeset
    90
@@ -2698,3 +2723,61 @@
3060d2518108 2007-12-06 Rick Ju <[email protected]>
rickju
parents: 11157
diff changeset
    91
 	purple_signals_disconnect_by_handle(handle);
3060d2518108 2007-12-06 Rick Ju <[email protected]>
rickju
parents: 11157
diff changeset
    92
 	purple_signals_unregister_by_instance(handle);
9968
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    93
 }
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    94
+
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    95
+#ifdef GAIM_ENABLE_KEYRING
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    96
+static char *
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    97
+gaim_account_get_password_from_keyring(const char *_prpl, const char *_user)
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    98
+{
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
    99
+  GnomeKeyringNetworkPasswordData *found_item;
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   100
+  GnomeKeyringResult               result;
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   101
+  GList                           *matches;
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   102
+  char                            *password;
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   103
+
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   104
+  matches = NULL;
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   105
+
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   106
+  result = gnome_keyring_find_network_password_sync (
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   107
+               _user,          /* user     */
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   108
+               NULL,           /* domain   */
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   109
+               "gaim.local",   /* server   */
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   110
+               NULL,           /* object   */
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   111
+               _prpl,          /* protocol */
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   112
+               NULL,           /* authtype */
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   113
+               1863,           /* port     */
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   114
+               &matches);
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   115
+
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   116
+  if (result != GNOME_KEYRING_RESULT_OK)
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   117
+    return NULL;
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   118
+
10315
edd2971b5fad 2007-08-15 Rick Ju <[email protected]>
rickju
parents: 10276
diff changeset
   119
+  if (matches == NULL || matches->data == NULL)
10276
c1e4bc224327 2007-08-05 Rick Ju <[email protected]>
rickju
parents: 10257
diff changeset
   120
+    return NULL;
9968
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   121
+
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   122
+  found_item = (GnomeKeyringNetworkPasswordData *) matches->data;
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   123
+
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   124
+  password = g_strdup (found_item->password);
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   125
+
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   126
+  gnome_keyring_network_password_list_free (matches);
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   127
+
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   128
+  return password;
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   129
+}
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   130
+
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   131
+static gboolean
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   132
+gaim_account_set_password_in_keyring (const char *_prpl, const char *_user, const char *_password)
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   133
+{
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   134
+  GnomeKeyringResult result;
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   135
+  guint32            item_id;
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   136
+
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   137
+  result = gnome_keyring_set_network_password_sync (
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   138
+                NULL,           /* default keyring */
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   139
+                _user,          /* user            */
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   140
+                NULL,           /* domain          */
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   141
+                "gaim.local",   /* server          */
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   142
+                NULL,           /* object          */
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   143
+                _prpl,          /* protocol        */
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   144
+                NULL,           /* authtype        */
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   145
+                1863,           /* port            */
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   146
+                _password,       /* password        */
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   147
+                &item_id);
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   148
+
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   149
+  return result == GNOME_KEYRING_RESULT_OK;
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   150
+}
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   151
+#endif
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   152
--- pidgin-2.0.0/configure.ac-ori	2007-05-24 14:26:55.133319000 +0800
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   153
+++ pidgin-2.0.0/configure.ac	2007-05-24 14:27:12.141394000 +0800
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   154
@@ -1914,6 +1914,20 @@
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   155
 	LDFLAGS="$orig_LDFLAGS"
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   156
 fi
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   157
 
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   158
+dnl #######################################################################
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   159
+dnl # Check for gnome-keyring
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   160
+dnl #--enable-gnome-keyring=(yes|no)
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   161
+dnl #######################################################################
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   162
+AC_ARG_ENABLE(gnome-keyring,
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   163
+              AC_HELP_STRING([--enable-gnome-keyring],
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   164
+                             [use gnome keyring for storing password [default=no]]),,
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   165
+              enable_gnome_keyring=no)
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   166
+if test "x$enable_gnome_keyring" = "xyes"; then
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   167
+    PKG_CHECK_MODULES(GAIM_KEYRING,
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   168
+                      gnome-keyring-1,
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   169
+                      AC_DEFINE(GAIM_ENABLE_KEYRING, [], [Set if we should use gnome-keyring]))
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   170
+fi
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   171
+
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   172
 AC_MSG_CHECKING(for me pot o' gold)
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   173
 AC_MSG_RESULT(no)
07fa9621fc8b 2007-05-30 Rick Ju <[email protected]>
rickju
parents:
diff changeset
   174
 AC_CHECK_FUNCS(gethostid lrand48)
11157
a01e32482ce3 2007-11-09 Rick Ju <[email protected]>
rickju
parents: 10315
diff changeset
   175
--- old/pidgin/gtkmain.c	Wed Oct 24 04:55:59 2007
a01e32482ce3 2007-11-09 Rick Ju <[email protected]>
rickju
parents: 10315
diff changeset
   176
+++ new/pidgin/gtkmain.c	Fri Nov  9 10:12:22 2007
a01e32482ce3 2007-11-09 Rick Ju <[email protected]>
rickju
parents: 10315
diff changeset
   177
@@ -67,6 +67,10 @@
a01e32482ce3 2007-11-09 Rick Ju <[email protected]>
rickju
parents: 10315
diff changeset
   178
 #include "pidginstock.h"
a01e32482ce3 2007-11-09 Rick Ju <[email protected]>
rickju
parents: 10315
diff changeset
   179
 #include "gtkwhiteboard.h"
a01e32482ce3 2007-11-09 Rick Ju <[email protected]>
rickju
parents: 10315
diff changeset
   180
 
a01e32482ce3 2007-11-09 Rick Ju <[email protected]>
rickju
parents: 10315
diff changeset
   181
+#ifdef GAIM_ENABLE_KEYRING
a01e32482ce3 2007-11-09 Rick Ju <[email protected]>
rickju
parents: 10315
diff changeset
   182
+#include <gnome-keyring.h>
a01e32482ce3 2007-11-09 Rick Ju <[email protected]>
rickju
parents: 10315
diff changeset
   183
+#endif
a01e32482ce3 2007-11-09 Rick Ju <[email protected]>
rickju
parents: 10315
diff changeset
   184
+
a01e32482ce3 2007-11-09 Rick Ju <[email protected]>
rickju
parents: 10315
diff changeset
   185
 #ifdef HAVE_SIGNAL_H
a01e32482ce3 2007-11-09 Rick Ju <[email protected]>
rickju
parents: 10315
diff changeset
   186
 # include <signal.h>
a01e32482ce3 2007-11-09 Rick Ju <[email protected]>
rickju
parents: 10315
diff changeset
   187
 #endif
a01e32482ce3 2007-11-09 Rick Ju <[email protected]>
rickju
parents: 10315
diff changeset
   188
@@ -680,6 +684,12 @@
a01e32482ce3 2007-11-09 Rick Ju <[email protected]>
rickju
parents: 10315
diff changeset
   189
 	gtk_rc_add_default_file(search_path);
a01e32482ce3 2007-11-09 Rick Ju <[email protected]>
rickju
parents: 10315
diff changeset
   190
 	g_free(search_path);
a01e32482ce3 2007-11-09 Rick Ju <[email protected]>
rickju
parents: 10315
diff changeset
   191
 
a01e32482ce3 2007-11-09 Rick Ju <[email protected]>
rickju
parents: 10315
diff changeset
   192
+#ifdef  GAIM_ENABLE_KEYRING
a01e32482ce3 2007-11-09 Rick Ju <[email protected]>
rickju
parents: 10315
diff changeset
   193
+	GnomeKeyringResult rtn = gnome_keyring_unlock_sync(NULL, NULL);
a01e32482ce3 2007-11-09 Rick Ju <[email protected]>
rickju
parents: 10315
diff changeset
   194
+	// if (rtn == GNOME_KEYRING_RESULT_DENIED)
a01e32482ce3 2007-11-09 Rick Ju <[email protected]>
rickju
parents: 10315
diff changeset
   195
+	//   return 0;
a01e32482ce3 2007-11-09 Rick Ju <[email protected]>
rickju
parents: 10315
diff changeset
   196
+#endif
a01e32482ce3 2007-11-09 Rick Ju <[email protected]>
rickju
parents: 10315
diff changeset
   197
+
a01e32482ce3 2007-11-09 Rick Ju <[email protected]>
rickju
parents: 10315
diff changeset
   198
 	gui_check = gtk_init_check(&argc, &argv);
a01e32482ce3 2007-11-09 Rick Ju <[email protected]>
rickju
parents: 10315
diff changeset
   199
 	if (!gui_check) {
a01e32482ce3 2007-11-09 Rick Ju <[email protected]>
rickju
parents: 10315
diff changeset
   200
 		char *display = gdk_get_display();
a01e32482ce3 2007-11-09 Rick Ju <[email protected]>
rickju
parents: 10315
diff changeset
   201
--- old/pidgin/Makefile.am	2007-08-21 02:12:53.000000000 +0800
a01e32482ce3 2007-11-09 Rick Ju <[email protected]>
rickju
parents: 10315
diff changeset
   202
+++ new/pidgin/Makefile.am	2007-09-18 14:55:09.688398000 +0800
a01e32482ce3 2007-11-09 Rick Ju <[email protected]>
rickju
parents: 10315
diff changeset
   203
@@ -185,6 +185,7 @@
a01e32482ce3 2007-11-09 Rick Ju <[email protected]>
rickju
parents: 10315
diff changeset
   204
 	$(GTKSPELL_LIBS) \
a01e32482ce3 2007-11-09 Rick Ju <[email protected]>
rickju
parents: 10315
diff changeset
   205
 	$(STARTUP_NOTIFICATION_LIBS) \
a01e32482ce3 2007-11-09 Rick Ju <[email protected]>
rickju
parents: 10315
diff changeset
   206
 	$(LIBXML_LIBS) \
a01e32482ce3 2007-11-09 Rick Ju <[email protected]>
rickju
parents: 10315
diff changeset
   207
+	$(GAIM_KEYRING_LIBS) \
a01e32482ce3 2007-11-09 Rick Ju <[email protected]>
rickju
parents: 10315
diff changeset
   208
 	$(GTK_LIBS) \
a01e32482ce3 2007-11-09 Rick Ju <[email protected]>
rickju
parents: 10315
diff changeset
   209
 	$(top_builddir)/libpurple/libpurple.la
a01e32482ce3 2007-11-09 Rick Ju <[email protected]>
rickju
parents: 10315
diff changeset
   210
 
a01e32482ce3 2007-11-09 Rick Ju <[email protected]>
rickju
parents: 10315
diff changeset
   211
@@ -204,6 +205,7 @@
a01e32482ce3 2007-11-09 Rick Ju <[email protected]>
rickju
parents: 10315
diff changeset
   212
 	$(GSTREAMER_CFLAGS) \
a01e32482ce3 2007-11-09 Rick Ju <[email protected]>
rickju
parents: 10315
diff changeset
   213
 	$(DEBUG_CFLAGS) \
a01e32482ce3 2007-11-09 Rick Ju <[email protected]>
rickju
parents: 10315
diff changeset
   214
 	$(GTK_CFLAGS) \
a01e32482ce3 2007-11-09 Rick Ju <[email protected]>
rickju
parents: 10315
diff changeset
   215
+	$(GAIM_KEYRING_CFLAGS) \
a01e32482ce3 2007-11-09 Rick Ju <[email protected]>
rickju
parents: 10315
diff changeset
   216
 	$(DBUS_CFLAGS) \
a01e32482ce3 2007-11-09 Rick Ju <[email protected]>
rickju
parents: 10315
diff changeset
   217
 	$(GTKSPELL_CFLAGS) \
a01e32482ce3 2007-11-09 Rick Ju <[email protected]>
rickju
parents: 10315
diff changeset
   218
 	$(STARTUP_NOTIFICATION_CFLAGS) \