--- src/jingle-content.c.orig 2009-02-04 15:11:10.000000000 -0500 +++ src/jingle-content.c 2009-02-04 15:32:51.000000000 -0500 @@ -217,9 +217,12 @@ gabble_jingle_content_set_property (GObj if (priv->transport_ns != NULL) { - GType transport_type = GPOINTER_TO_INT ( - g_hash_table_lookup (self->conn->jingle_factory->transports, - priv->transport_ns)); + GabbleJingleFactoryHashType *htype; + GType transport_type = 0; + htype = g_hash_table_lookup (self->conn->jingle_factory->transports, + priv->transport_ns); + if (htype) + transport_type = htype->type; g_assert (transport_type != 0); @@ -448,6 +451,7 @@ gabble_jingle_content_parse_add (GabbleJ GabbleJingleContentPrivate *priv = GABBLE_JINGLE_CONTENT_GET_PRIVATE (c); const gchar *name, *creator, *senders, *disposition; LmMessageNode *trans_node, *desc_node; + GabbleJingleFactoryHashType *htype; GType transport_type = 0; GabbleJingleTransportIface *trans = NULL; JingleDialect dialect; @@ -480,8 +484,9 @@ gabble_jingle_content_parse_add (GabbleJ dialect = JINGLE_DIALECT_GTALK3; g_object_set (c->session, "dialect", JINGLE_DIALECT_GTALK3, NULL); - transport_type = GPOINTER_TO_INT ( - g_hash_table_lookup (c->conn->jingle_factory->transports, "")); + htype = g_hash_table_lookup (c->conn->jingle_factory->transports, ""); + if (htype) + transport_type = htype->type; priv->transport_ns = g_strdup (""); } } @@ -499,8 +504,9 @@ gabble_jingle_content_parse_add (GabbleJ { const gchar *ns = lm_message_node_get_namespace (trans_node); - transport_type = GPOINTER_TO_INT ( - g_hash_table_lookup (c->conn->jingle_factory->transports, ns)); + htype = g_hash_table_lookup (c->conn->jingle_factory->transports, ns); + if (htype) + transport_type = htype->type; if (transport_type == 0) { --- src/jingle-factory.c.orig 2009-02-04 15:04:28.000000000 -0500 +++ src/jingle-factory.c 2009-02-04 15:10:48.000000000 -0500 @@ -91,10 +91,10 @@ gabble_jingle_factory_init (GabbleJingle g_free, g_object_unref); obj->transports = g_hash_table_new_full (g_str_hash, g_str_equal, - NULL, NULL); + NULL, (GDestroyNotify) g_free); obj->content_types = g_hash_table_new_full (g_str_hash, g_str_equal, - NULL, NULL); + NULL, (GDestroyNotify) g_free); priv->jingle_cb = NULL; @@ -606,16 +606,22 @@ void gabble_jingle_factory_register_transport (GabbleJingleFactory *factory, gchar *namespace, GType transport_type) { - g_hash_table_insert (factory->transports, namespace, - GINT_TO_POINTER (transport_type)); + GabbleJingleFactoryHashType *htype; + + htype = g_new (GabbleJingleFactoryHashType, 1); + htype->type = transport_type; + g_hash_table_insert (factory->transports, namespace, htype); } void gabble_jingle_factory_register_content_type (GabbleJingleFactory *factory, gchar *namespace, GType content_type) { - g_hash_table_insert (factory->content_types, namespace, - GINT_TO_POINTER (content_type)); + GabbleJingleFactoryHashType *htype; + + htype = g_new (GabbleJingleFactoryHashType, 1); + htype->type = content_type; + g_hash_table_insert (factory->content_types, namespace, htype); } static void --- src/jingle-factory.h.orig 2009-02-04 15:04:34.000000000 -0500 +++ src/jingle-factory.h 2009-02-04 15:06:02.000000000 -0500 @@ -94,6 +94,11 @@ typedef enum { } JingleCandidateType; typedef struct _GabbleJingleFactoryClass GabbleJingleFactoryClass; +typedef struct _GabbleJingleFactoryHashType GabbleJingleFactoryHashType; + +struct _GabbleJingleFactoryHashType { + GType type; +}; GType gabble_jingle_factory_get_type (void); --- src/jingle-session.c.orig 2009-02-04 15:15:32.000000000 -0500 +++ src/jingle-session.c 2009-02-04 15:33:12.000000000 -0500 @@ -602,6 +602,7 @@ _each_content_add (GabbleJingleSession * const gchar *name = lm_message_node_get_attribute (content_node, "name"); LmMessageNode *desc_node = lm_message_node_get_child_any_ns (content_node, "description"); + GabbleJingleFactoryHashType *htype; GType content_type = 0; const gchar *content_ns = NULL; @@ -609,9 +610,10 @@ _each_content_add (GabbleJingleSession * { content_ns = lm_message_node_get_namespace (desc_node); DEBUG ("namespace: %s", content_ns); - content_type = - GPOINTER_TO_INT (g_hash_table_lookup (priv->conn->jingle_factory->content_types, - content_ns)); + htype = g_hash_table_lookup (priv->conn->jingle_factory->content_types, + content_ns); + if (htype) + content_type = htype->type; } if (content_type == 0) @@ -1597,7 +1599,8 @@ gabble_jingle_session_add_content (Gabbl { GabbleJingleSessionPrivate *priv = GABBLE_JINGLE_SESSION_GET_PRIVATE (sess); GabbleJingleContent *c; - GType content_type; + GabbleJingleFactoryHashType *htype; + GType content_type = 0; gchar *name = NULL; gint id = g_hash_table_size (priv->contents) + 1; @@ -1608,9 +1611,10 @@ gabble_jingle_session_add_content (Gabbl } while (g_hash_table_lookup (priv->contents, name) != NULL); - content_type = - GPOINTER_TO_INT (g_hash_table_lookup (priv->conn->jingle_factory->content_types, - content_ns)); + htype = g_hash_table_lookup (priv->conn->jingle_factory->content_types, + content_ns); + if (htype) + content_type = htype->type; g_assert (content_type != 0);