summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill Thompson <will.thompson@collabora.co.uk>2010-02-12 14:17:56 +0000
committerWill Thompson <will.thompson@collabora.co.uk>2010-02-12 16:38:09 +0000
commit63a76d10d6055bcce29667c020b3c1592c2ad989 (patch)
tree0ebf0089705ea566bc54f1d166331ce2004dd5f0
parent5af87f52d8e3bf5a9f2c139512dfb184561aa5a0 (diff)
Use correct client type when calculating hash.
Previously, if you compiled with --enable-is-a-phone, Gabble would still use "pc" when calculating its own hash. Bzzt. Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
-rw-r--r--configure.ac6
-rw-r--r--src/caps-hash.c3
-rw-r--r--src/connection.c6
3 files changed, 8 insertions, 7 deletions
diff --git a/configure.ac b/configure.ac
index 0d2ff3055..0083c5e1b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -126,7 +126,11 @@ AC_ARG_ENABLE([is-a-phone],
[is_a_phone=$enableval], [is_a_phone=no])
if test x$is_a_phone = xyes; then
- AC_DEFINE(IS_A_PHONE, [], [Defined if the target device is a phone])
+ AC_DEFINE(CLIENT_TYPE, ["phone"],
+ [Client type from http://xmpp.org/registrar/disco-categories.html#client])
+else
+ AC_DEFINE(CLIENT_TYPE, ["pc"],
+ [Client type from http://xmpp.org/registrar/disco-categories.html#client])
fi
dnl Check for Glib
diff --git a/src/caps-hash.c b/src/caps-hash.c
index c51fa0345..966a3463d 100644
--- a/src/caps-hash.c
+++ b/src/caps-hash.c
@@ -375,7 +375,8 @@ caps_hash_compute_from_self_presence (GabbleConnection *self)
}
/* XEP-0030 requires at least 1 identity. We don't need more. */
- g_ptr_array_add (identities, g_strdup ("client/pc//" PACKAGE_STRING));
+ g_ptr_array_add (identities, g_strdup_printf (
+ "client/%s//%s", CLIENT_TYPE, PACKAGE_STRING));
/* Gabble does not use dataforms, let 'dataforms' be empty */
diff --git a/src/connection.c b/src/connection.c
index 152d752df..907884f25 100644
--- a/src/connection.c
+++ b/src/connection.c
@@ -1815,11 +1815,7 @@ connection_iq_disco_cb (LmMessageHandler *handler,
(result_query, "identity", NULL);
lm_message_node_set_attribute (identity, "category", "client");
lm_message_node_set_attribute (identity, "name", PACKAGE_STRING);
-#ifdef IS_A_PHONE
- lm_message_node_set_attribute (identity, "type", "phone");
-#else
- lm_message_node_set_attribute (identity, "type", "pc");
-#endif
+ lm_message_node_set_attribute (identity, "type", CLIENT_TYPE);
if (node == NULL)
{