I create a TpChannel subclass using: g_object_new (EMPATHY_TYPE_TP_CHAT, "account", account, "connection", conn, "dbus-daemon", conn_proxy->dbus_daemon, "bus-name", conn_proxy->bus_name, "object-path", object_path, "channel-properties", immutable_properties, NULL); The props hash table contains the right handle-type (TP_HANDLE_TYPE_ROOM), as expected. But if I call tp_channel_get_handle() it returns TP_HANDLE_TYPE_NONE as handle type! After some debugging I noticed that the following happen: - _tp_channel_maybe_set_handle_type() is called a first time when setting the PROP_CHANNEL_PROPERTIES property; handle-type is correctly defined. - _tp_channel_maybe_set_handle_type() is called a second time as the default setter for the handle-type property (which was not defined in g_object_new), setting it back to TP_HANDLE_TYPE_NONE _tp_channel_maybe_set_handle_type() thinks that the handle_type is valid because it's NONE and not UNKNOWN. Setting TP_UNKNOWN_HANDLE_TYPE as default handle-type in channel-iface solves this but I'm really wondering why we didn't hit this issue before, this is very old code.
http://cgit.collabora.com/git/user/cassidy/telepathy-glib/log/?h=channel-type-38524 Note that this bug has been discovered in https://bugzilla.gnome.org/show_bug.cgi?id=653003 as Empathy now rely more on tp_channel_get_handle().
Created attachment 48228 [details] [review] channel-iface: set TP_UNKNOWN_HANDLE_TYPE as default handle type TP_HANDLE_TYPE_NONE is not a good default, if we don't know the handle type we shouln't try to guess it. This also confuses TpChannel which think we are setting a valid handle type; see fdo#38524.
Review of attachment 48228 [details] [review]: r+ ::: telepathy-glib/channel-iface.c @@ +97,3 @@ param_spec = g_param_spec_uint ("handle-type", "Handle type", "The TpHandleType of this channel's associated handle.", + 0, G_MAXUINT32, TP_UNKNOWN_HANDLE_TYPE, Well, this feels a bit sketchy because TP_UNKNOWN_HANDLE_TYPE is not really a TpHandleType: but the property is already documented to have this value in some cases, as is tp_channel_get_handle(). So this is fine! Good catch, I would never have thought of looking here.
Merged to 0.14 and master. Will be in 0.14.8 and 0.15.2
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.