diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/connection-contact-info.c | 49 | ||||
-rw-r--r-- | src/connection.c | 341 | ||||
-rw-r--r-- | src/contact-manager.c | 5 | ||||
-rw-r--r-- | src/file-transfer-channel.c | 4 | ||||
-rw-r--r-- | src/im-channel.c | 23 | ||||
-rw-r--r-- | src/muc-channel.c | 120 | ||||
-rw-r--r-- | src/muc-manager.c | 4 | ||||
-rw-r--r-- | src/muc-tube-dbus.c | 2 | ||||
-rw-r--r-- | src/muc-tube-stream.c | 2 | ||||
-rw-r--r-- | src/protocol.c | 3 | ||||
-rw-r--r-- | src/protocol.h | 4 | ||||
-rw-r--r-- | src/roomlist-channel.c | 8 | ||||
-rw-r--r-- | src/text-helper.h | 2 | ||||
-rw-r--r-- | src/tube-dbus.c | 7 | ||||
-rw-r--r-- | src/tube-iface.c | 4 | ||||
-rw-r--r-- | src/tube-stream.c | 14 | ||||
-rw-r--r-- | src/tubes-manager.c | 34 | ||||
-rw-r--r-- | src/util.h | 6 | ||||
-rw-r--r-- | src/write-mgr-file.c | 12 |
19 files changed, 168 insertions, 476 deletions
diff --git a/src/connection-contact-info.c b/src/connection-contact-info.c index cf1f0cb6..c49963fe 100644 --- a/src/connection-contact-info.c +++ b/src/connection-contact-info.c @@ -253,54 +253,6 @@ salut_conn_contact_info_changed ( } static void -salut_conn_contact_info_get_contact_info ( - TpSvcConnectionInterfaceContactInfo *iface, - const GArray *contacts, - DBusGMethodInvocation *context) -{ - SalutConnection *self = SALUT_CONNECTION (iface); - TpBaseConnection *base = (TpBaseConnection *) self; - TpHandleRepoIface *contacts_repo = - tp_base_connection_get_handles (base, TP_HANDLE_TYPE_CONTACT); - SalutContactManager *contact_manager; - guint i; - GHashTable *ret; - GError *error = NULL; - - TP_BASE_CONNECTION_ERROR_IF_NOT_CONNECTED (TP_BASE_CONNECTION (iface), - context); - - if (!tp_handles_are_valid (contacts_repo, contacts, FALSE, &error)) - { - dbus_g_method_return_error (context, error); - g_error_free (error); - return; - } - - g_object_get (self, "contact-manager", &contact_manager, NULL); - ret = dbus_g_type_specialized_construct (TP_HASH_TYPE_CONTACT_INFO_MAP); - - for (i = 0; i < contacts->len; i++) - { - TpHandle handle = g_array_index (contacts, TpHandle, i); - SalutContact *contact = salut_contact_manager_get_contact ( - contact_manager, handle); - - if (contact != NULL) - { - g_hash_table_insert (ret, GUINT_TO_POINTER (handle), - build_contact_info_for_contact (contact)); - g_object_unref (contact); - } - } - - tp_svc_connection_interface_contact_info_return_from_get_contact_info ( - context, ret); - g_boxed_free (TP_HASH_TYPE_CONTACT_INFO_MAP, ret); - g_object_unref (contact_manager); -} - -static void salut_conn_contact_info_request_contact_info ( TpSvcConnectionInterfaceContactInfo *iface, guint handle, @@ -367,7 +319,6 @@ salut_conn_contact_info_iface_init ( #define IMPLEMENT(x) tp_svc_connection_interface_contact_info_implement_##x \ (klass, salut_conn_contact_info_##x) - IMPLEMENT (get_contact_info); IMPLEMENT (request_contact_info); IMPLEMENT (refresh_contact_info); #undef IMPLEMENT diff --git a/src/connection.c b/src/connection.c index a0e19e4d..9916bd5f 100644 --- a/src/connection.c +++ b/src/connection.c @@ -116,8 +116,8 @@ G_DEFINE_TYPE_WITH_CODE(SalutConnection, tp_contacts_mixin_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION_INTERFACE_CONTACT_LIST, tp_base_contact_list_mixin_list_iface_init); - G_IMPLEMENT_INTERFACE(TP_TYPE_SVC_CONNECTION_INTERFACE_SIMPLE_PRESENCE, - tp_presence_mixin_simple_presence_iface_init); + G_IMPLEMENT_INTERFACE(TP_TYPE_SVC_CONNECTION_INTERFACE_PRESENCE, + tp_presence_mixin_iface_init); G_IMPLEMENT_INTERFACE(TP_TYPE_SVC_CONNECTION_INTERFACE_AVATARS, salut_connection_avatar_service_iface_init); G_IMPLEMENT_INTERFACE @@ -256,9 +256,6 @@ salut_connection_create_handle_repos (TpBaseConnection *self, TpHandleRepoIface *repos[TP_NUM_HANDLE_TYPES]); static GPtrArray * -salut_connection_create_channel_factories (TpBaseConnection *self); - -static GPtrArray * salut_connection_create_channel_managers (TpBaseConnection *self); static gchar * @@ -354,6 +351,13 @@ static void sidecars_conn_status_changed_cb (SalutConnection *conn, guint status, guint reason, gpointer unused); +static void _contact_manager_contact_change_cb (SalutContactManager *mgr, + SalutContact *contact, int changes, gpointer data); + +#ifdef ENABLE_OLPC +static void setup_olpc_activity_manager (SalutConnection *self); +#endif + static void salut_connection_constructed (GObject *obj) { @@ -365,12 +369,17 @@ salut_connection_constructed (GObject *obj) g_signal_connect (self->presence_cache, "capabilities-update", G_CALLBACK (connection_capabilities_update_cb), self); +#ifdef ENABLE_OLPC + setup_olpc_activity_manager (self); +#endif + tp_contacts_mixin_init (obj, G_STRUCT_OFFSET (SalutConnection, contacts_mixin)); tp_base_connection_register_with_contacts_mixin (base); - tp_presence_mixin_simple_presence_register_with_contacts_mixin (obj); - tp_base_contact_list_mixin_register_with_contacts_mixin (base); + tp_presence_mixin_register_with_contacts_mixin (obj); + tp_base_contact_list_mixin_register_with_contacts_mixin ( + TP_BASE_CONTACT_LIST (self->priv->contact_manager), base); tp_contacts_mixin_add_contact_attributes_iface (obj, TP_IFACE_CONNECTION_INTERFACE_AVATARS, @@ -583,23 +592,15 @@ make_presence_opt_args (SalutPresenceId presence, const gchar *message) static GHashTable * get_contact_statuses (GObject *obj, - const GArray *handles, - GError **error) + const GArray *handles) { SalutConnection *self = SALUT_CONNECTION (obj); SalutConnectionPrivate *priv = self->priv; TpBaseConnection *base = (TpBaseConnection *) self; TpHandle self_handle = tp_base_connection_get_self_handle (base); - TpHandleRepoIface *handle_repo = tp_base_connection_get_handles (base, - TP_HANDLE_TYPE_CONTACT); GHashTable *ret; guint i; - if (!tp_handles_are_valid (handle_repo, handles, FALSE, error)) - { - return NULL; - } - ret = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, (GDestroyNotify) tp_presence_status_free); @@ -716,7 +717,7 @@ static const gchar *interfaces [] = { TP_IFACE_CONNECTION_INTERFACE_ALIASING, TP_IFACE_CONNECTION_INTERFACE_AVATARS, TP_IFACE_CONNECTION_INTERFACE_CONTACTS, - TP_IFACE_CONNECTION_INTERFACE_SIMPLE_PRESENCE, + TP_IFACE_CONNECTION_INTERFACE_PRESENCE, TP_IFACE_CONNECTION_INTERFACE_REQUESTS, TP_IFACE_CONNECTION_INTERFACE_CONTACT_CAPABILITIES, TP_IFACE_CONNECTION_INTERFACE_CONTACT_INFO, @@ -778,8 +779,6 @@ salut_connection_class_init (SalutConnectionClass *salut_connection_class) tp_connection_class->create_handle_repos = salut_connection_create_handle_repos; - tp_connection_class->create_channel_factories = - salut_connection_create_channel_factories; tp_connection_class->create_channel_managers = salut_connection_create_channel_managers; tp_connection_class->get_unique_connection_name = @@ -799,7 +798,7 @@ salut_connection_class_init (SalutConnectionClass *salut_connection_class) is_presence_status_available, get_contact_statuses, set_own_status, presence_statuses); - tp_presence_mixin_simple_presence_init_dbus_properties (object_class); + tp_presence_mixin_init_dbus_properties (object_class); tp_contacts_mixin_class_init (object_class, G_STRUCT_OFFSET (SalutConnectionClass, contacts_mixin)); @@ -1289,23 +1288,6 @@ _salut_connection_disconnect (SalutConnection *self) /* Aliasing interface */ -/** - * salut_connection_get_alias_flags - * - * Implements D-Bus method GetAliasFlags - * on interface org.freedesktop.Telepathy.Connection.Interface.Aliasing - * - */ -static void -salut_connection_get_alias_flags (TpSvcConnectionInterfaceAliasing *self, - DBusGMethodInvocation *context) -{ - /* Aliases are set by the contacts - * Actually we concat the first and lastname property */ - - tp_svc_connection_interface_aliasing_return_from_get_alias_flags (context, - 0); -} static const gchar * salut_connection_get_alias (SalutConnection *self, TpHandle handle) @@ -1344,7 +1326,7 @@ salut_connection_get_alias (SalutConnection *self, TpHandle handle) * salut_connection_request_aliases * * Implements D-Bus method RequestAliases - * on interface org.freedesktop.Telepathy.Connection.Interface.Aliasing + * on interface im.telepathy1.Connection.Interface.Aliasing * */ static void @@ -1386,40 +1368,6 @@ salut_connection_request_aliases (TpSvcConnectionInterfaceAliasing *iface, } static void -salut_connection_get_aliases (TpSvcConnectionInterfaceAliasing *iface, - const GArray *contacts, DBusGMethodInvocation *context) -{ - SalutConnection *self = SALUT_CONNECTION (iface); - TpBaseConnection *base = TP_BASE_CONNECTION (self); - TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (base, - TP_HANDLE_TYPE_CONTACT); - guint i; - GError *error = NULL; - GHashTable *result = g_hash_table_new_full (g_direct_hash, g_direct_equal, - NULL, NULL); - - if (!tp_handles_are_valid (contact_repo, contacts, FALSE, &error)) - { - dbus_g_method_return_error (context, error); - g_error_free (error); - return; - } - - for (i = 0; i < contacts->len; i++) - { - TpHandle handle = g_array_index (contacts, TpHandle, i); - - g_hash_table_insert (result, GUINT_TO_POINTER (handle), - (gchar *) salut_connection_get_alias (self, handle)); - } - - tp_svc_connection_interface_aliasing_return_from_get_aliases (context, - result); - - g_hash_table_unref (result); -} - -static void salut_connection_aliasing_fill_contact_attributes (GObject *obj, const GArray *contacts, GHashTable *attributes_hash) { @@ -1559,24 +1507,18 @@ static void _contact_manager_contact_alias_changed (SalutConnection *self, SalutContact *contact, TpHandle handle) { - GPtrArray *aliases; - GValue entry = {0, }; - - g_value_init (&entry, TP_STRUCT_TYPE_ALIAS_PAIR); - g_value_take_boxed (&entry, - dbus_g_type_specialized_construct (TP_STRUCT_TYPE_ALIAS_PAIR)); - - dbus_g_type_struct_set (&entry, - 0, handle, 1, salut_contact_get_alias (contact), G_MAXUINT); - aliases = g_ptr_array_sized_new (1); - g_ptr_array_add (aliases, g_value_get_boxed (&entry)); + GHashTable *aliases; DEBUG("Emitting AliasesChanged"); + aliases = g_hash_table_new (NULL, NULL); + g_hash_table_insert (aliases, + GUINT_TO_POINTER (handle), + (gchar *) salut_contact_get_alias (contact)); + tp_svc_connection_interface_aliasing_emit_aliases_changed (self, aliases); - g_value_unset (&entry); - g_ptr_array_unref (aliases); + g_hash_table_unref (aliases); } static void @@ -1588,9 +1530,7 @@ salut_connection_aliasing_service_iface_init (gpointer g_iface, #define IMPLEMENT(x) tp_svc_connection_interface_aliasing_implement_##x \ (klass, salut_connection_##x) - IMPLEMENT (get_alias_flags); IMPLEMENT (request_aliases); - IMPLEMENT (get_aliases); IMPLEMENT (set_aliases); #undef IMPLEMENT } @@ -1653,62 +1593,6 @@ salut_connection_set_avatar (TpSvcConnectionInterfaceAvatars *iface, static void -salut_connection_get_avatar_tokens (TpSvcConnectionInterfaceAvatars *iface, - const GArray *contacts, DBusGMethodInvocation *context) -{ - guint i; - gchar **ret; - GError *err = NULL; - SalutConnection *self = SALUT_CONNECTION (iface); - SalutConnectionPrivate *priv = self->priv; - TpBaseConnection *base = TP_BASE_CONNECTION (self); - TpHandle self_handle = tp_base_connection_get_self_handle (base); - TpHandleRepoIface *handle_repo; - - TP_BASE_CONNECTION_ERROR_IF_NOT_CONNECTED (base, context); - - handle_repo = tp_base_connection_get_handles (base, - TP_HANDLE_TYPE_CONTACT); - - if (!tp_handles_are_valid (handle_repo, contacts, FALSE, &err)) - { - dbus_g_method_return_error (context, err); - g_error_free (err); - return; - } - - ret = g_new0(gchar *, contacts->len + 1); - - for (i = 0; i < contacts->len ; i++) - { - TpHandle handle = g_array_index (contacts, TpHandle, i); - if (self_handle == handle) - { - ret[i] = priv->self->avatar_token; - } - else - { - SalutContact *contact; - - contact = salut_contact_manager_get_contact (priv->contact_manager, - handle); - if (contact != NULL) - { - ret[i] = contact->avatar_token; - g_object_unref (contact); - } - } - if (ret[i] == NULL) - ret[i] = ""; - } - - tp_svc_connection_interface_avatars_return_from_get_avatar_tokens (context, - (const gchar **)ret); - - g_free (ret); -} - -static void salut_connection_get_known_avatar_tokens ( TpSvcConnectionInterfaceAvatars *iface, const GArray *contacts, DBusGMethodInvocation *context) @@ -1902,78 +1786,6 @@ salut_connection_request_avatars ( } static void -_request_avatar_cb (SalutContact *contact, guint8 *avatar, gsize size, - gpointer user_data) -{ - DBusGMethodInvocation *context = (DBusGMethodInvocation *) user_data; - - GError *err = NULL; - GArray *arr; - - if (size == 0) - { - err = g_error_new (TP_ERROR, TP_ERROR_NOT_AVAILABLE, - "Unable to get avatar"); - dbus_g_method_return_error (context, err); - g_error_free (err); - return; - } - - arr = g_array_sized_new (FALSE, FALSE, sizeof (guint8), size); - arr = g_array_append_vals (arr, avatar, size); - tp_svc_connection_interface_avatars_return_from_request_avatar (context, - arr, ""); - g_array_unref (arr); -} - -static void -salut_connection_request_avatar (TpSvcConnectionInterfaceAvatars *iface, - guint handle, DBusGMethodInvocation *context) -{ - SalutConnection *self = SALUT_CONNECTION (iface); - SalutConnectionPrivate *priv = self->priv; - TpBaseConnection *base = TP_BASE_CONNECTION (self); - TpHandle self_handle = tp_base_connection_get_self_handle (base); - SalutContact *contact; - GError *err = NULL; - TpHandleRepoIface *handle_repo; - - TP_BASE_CONNECTION_ERROR_IF_NOT_CONNECTED (base, context); - - handle_repo = tp_base_connection_get_handles (base, - TP_HANDLE_TYPE_CONTACT); - - if (!tp_handle_is_valid (handle_repo, handle, &err)) - { - dbus_g_method_return_error (context, err); - g_error_free (err); - return; - } - - if (handle == self_handle) - { - _request_avatar_cb (NULL, priv->self->avatar, priv->self->avatar_size, - context); - return; - } - - contact = salut_contact_manager_get_contact (priv->contact_manager, handle); - if (contact == NULL || contact->avatar_token == NULL) - { - err = g_error_new (TP_ERROR, TP_ERROR_NOT_AVAILABLE, "No known avatar"); - dbus_g_method_return_error (context, err); - g_error_free (err); - if (contact != NULL) - { - g_object_unref (contact); - } - return; - } - salut_contact_get_avatar (contact, _request_avatar_cb, context); - g_object_unref (contact); -} - -static void conn_avatars_properties_getter (GObject *object, GQuark interface, GQuark name, @@ -1994,15 +1806,6 @@ conn_avatars_properties_getter (GObject *object, } static void -salut_connection_get_avatar_requirements ( - TpSvcConnectionInterfaceAvatars *iface, DBusGMethodInvocation *context) -{ - tp_svc_connection_interface_avatars_return_from_get_avatar_requirements ( - context, mimetypes, AVATAR_MIN_PX, AVATAR_MIN_PX, AVATAR_MAX_PX, - AVATAR_MAX_PX, AVATAR_MAX_BYTES); -} - -static void salut_connection_avatar_service_iface_init (gpointer g_iface, gpointer iface_data) { @@ -2011,10 +1814,7 @@ salut_connection_avatar_service_iface_init (gpointer g_iface, #define IMPLEMENT(x) tp_svc_connection_interface_avatars_implement_##x \ (klass, salut_connection_##x) - IMPLEMENT (get_avatar_requirements); - IMPLEMENT (get_avatar_tokens); IMPLEMENT (get_known_avatar_tokens); - IMPLEMENT (request_avatar); IMPLEMENT (request_avatars); IMPLEMENT (set_avatar); IMPLEMENT (clear_avatar); @@ -2038,56 +1838,6 @@ salut_free_enhanced_contact_capabilities (GPtrArray *caps) g_ptr_array_unref (caps); } -/** - * salut_connection_get_contact_capabilities - * - * Implements D-Bus method GetContactCapabilities - * on interface - * org.freedesktop.Telepathy.Connection.Interface.ContactCapabilities - */ -static void -salut_connection_get_contact_capabilities ( - TpSvcConnectionInterfaceContactCapabilities *iface, - const GArray *handles, - DBusGMethodInvocation *context) -{ - SalutConnection *self = SALUT_CONNECTION (iface); - TpBaseConnection *base = (TpBaseConnection *) self; - TpHandleRepoIface *contact_handles = tp_base_connection_get_handles (base, - TP_HANDLE_TYPE_CONTACT); - guint i; - GHashTable *ret; - GError *error = NULL; - - TP_BASE_CONNECTION_ERROR_IF_NOT_CONNECTED (base, context); - - if (!tp_handles_are_valid (contact_handles, handles, FALSE, &error)) - { - dbus_g_method_return_error (context, error); - g_error_free (error); - return; - } - - ret = g_hash_table_new_full (NULL, NULL, NULL, - (GDestroyNotify) salut_free_enhanced_contact_capabilities); - - for (i = 0; i < handles->len; i++) - { - GPtrArray *arr = g_ptr_array_new (); - TpHandle handle = g_array_index (handles, TpHandle, i); - - salut_connection_get_handle_contact_capabilities (self, handle, arr); - - g_hash_table_insert (ret, GINT_TO_POINTER (handle), arr); - } - - tp_svc_connection_interface_contact_capabilities_return_from_get_contact_capabilities - (context, ret); - - g_hash_table_unref (ret); -} - - static void _emit_contact_capabilities_changed (SalutConnection *conn, TpHandle handle) @@ -2169,7 +1919,7 @@ data_forms_equal (GPtrArray *one, * * Implements D-Bus method UpdateCapabilities * on interface - * org.freedesktop.Telepathy.Connection.Interface.ContactCapabilities + * im.telepathy1.Connection.Interface.ContactCapabilities */ static void salut_connection_update_capabilities ( @@ -2301,7 +2051,6 @@ salut_conn_contact_caps_iface_init (gpointer g_iface, gpointer iface_data) #define IMPLEMENT(x) \ tp_svc_connection_interface_contact_capabilities_implement_##x (\ klass, salut_connection_##x) - IMPLEMENT(get_contact_capabilities); IMPLEMENT(update_capabilities); #undef IMPLEMENT } @@ -3531,22 +3280,11 @@ uninvite_stanza_callback (WockyPorter *porter, return TRUE; } -#endif - -static GPtrArray * -salut_connection_create_channel_factories (TpBaseConnection *base) +static void +setup_olpc_activity_manager (SalutConnection *self) { - SalutConnection *self = SALUT_CONNECTION (base); SalutConnectionPrivate *priv = self->priv; - GPtrArray *factories = g_ptr_array_sized_new (4); - - /* Create the contact manager */ - priv->contact_manager = salut_discovery_client_create_contact_manager ( - priv->discovery_client, self); - g_signal_connect (priv->contact_manager, "contact-change", - G_CALLBACK (_contact_manager_contact_change_cb), self); -#ifdef ENABLE_OLPC priv->uninvite_handler_id = wocky_porter_register_handler_from_anyone ( self->porter, WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_NONE, @@ -3562,12 +3300,8 @@ salut_connection_create_channel_factories (TpBaseConnection *base) priv->discovery_client, self); g_signal_connect (priv->olpc_activity_manager, "activity-modified", G_CALLBACK (_olpc_activity_manager_activity_modified_cb), self); -#endif - - return factories; } -#ifdef ENABLE_OLPC static void muc_channel_closed_cb (SalutMucChannel *chan, SalutOlpcActivity *activity) @@ -3652,12 +3386,16 @@ salut_connection_create_channel_managers (TpBaseConnection *base) GPtrArray *tmp; SalutPluginLoader *loader; - /* FIXME: The second and third arguments depend on create_channel_factories - * being called before this; should telepathy-glib guarantee that or - * should we be defensive? - */ - priv->im_manager = salut_im_manager_new (self, priv->contact_manager); + /* Create the contact manager. This is not a channel manager anymore, + * but still needs to be created from here because others channel managers use + * it and TpBaseConnection calls ::create_channel_managers() before + * ::constructed() */ + self->priv->contact_manager = salut_discovery_client_create_contact_manager ( + self->priv->discovery_client, self); + g_signal_connect (self->priv->contact_manager, "contact-change", + G_CALLBACK (_contact_manager_contact_change_cb), self); + priv->im_manager = salut_im_manager_new (self, priv->contact_manager); priv->ft_manager = salut_ft_manager_new (self, priv->contact_manager); #ifndef USE_BACKEND_BONJOUR @@ -3673,7 +3411,6 @@ salut_connection_create_channel_managers (TpBaseConnection *base) #endif g_ptr_array_add (managers, priv->im_manager); - g_ptr_array_add (managers, priv->contact_manager); g_ptr_array_add (managers, priv->ft_manager); #ifndef USE_BACKEND_BONJOUR g_ptr_array_add (managers, priv->muc_manager); diff --git a/src/contact-manager.c b/src/contact-manager.c index f15eda01..8efd6f83 100644 --- a/src/contact-manager.c +++ b/src/contact-manager.c @@ -40,9 +40,8 @@ static void salut_contact_manager_close_all (SalutContactManager *mgr); static void _contact_finalized_cb (gpointer data, GObject *old_object); -G_DEFINE_TYPE_WITH_CODE(SalutContactManager, salut_contact_manager, - TP_TYPE_BASE_CONTACT_LIST, - G_IMPLEMENT_INTERFACE (GABBLE_TYPE_CAPS_CHANNEL_MANAGER, NULL)) +G_DEFINE_TYPE(SalutContactManager, salut_contact_manager, + TP_TYPE_BASE_CONTACT_LIST) /* signal enum */ enum diff --git a/src/file-transfer-channel.c b/src/file-transfer-channel.c index 78271d63..efc28802 100644 --- a/src/file-transfer-channel.c +++ b/src/file-transfer-channel.c @@ -1188,7 +1188,7 @@ salut_file_transfer_channel_offer_file (SalutFileTransferChannel *self, * salut_file_transfer_channel_accept_file * * Implements D-Bus method AcceptFile - * on interface org.freedesktop.Telepathy.Channel.Type.FileTransfer + * on interface im.telepathy1.Channel.Type.FileTransfer */ static void salut_file_transfer_channel_accept_file (TpSvcChannelTypeFileTransfer *iface, @@ -1264,7 +1264,7 @@ salut_file_transfer_channel_accept_file (TpSvcChannelTypeFileTransfer *iface, * salut_file_transfer_channel_provide_file * * Implements D-Bus method ProvideFile - * on interface org.freedesktop.Telepathy.Channel.Type.FileTransfer + * on interface im.telepathy1.Channel.Type.FileTransfer */ static void salut_file_transfer_channel_provide_file ( diff --git a/src/im-channel.c b/src/im-channel.c index d7a409be..46ecc32f 100644 --- a/src/im-channel.c +++ b/src/im-channel.c @@ -47,9 +47,7 @@ G_DEFINE_TYPE_WITH_CODE (SalutImChannel, salut_im_channel, TP_TYPE_BASE_CHANNEL, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_TYPE_TEXT, - tp_message_mixin_text_iface_init); - G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_INTERFACE_MESSAGES, - tp_message_mixin_messages_iface_init); + tp_message_mixin_iface_init) ); /* properties */ @@ -210,10 +208,10 @@ salut_im_channel_fill_immutable_properties (TpBaseChannel *chan, tp_dbus_properties_mixin_fill_properties_hash ( G_OBJECT (chan), properties, - TP_IFACE_CHANNEL_INTERFACE_MESSAGES, "MessagePartSupportFlags", - TP_IFACE_CHANNEL_INTERFACE_MESSAGES, "DeliveryReportingSupport", - TP_IFACE_CHANNEL_INTERFACE_MESSAGES, "SupportedContentTypes", - TP_IFACE_CHANNEL_INTERFACE_MESSAGES, "MessageTypes", + TP_IFACE_CHANNEL_TYPE_TEXT, "MessagePartSupportFlags", + TP_IFACE_CHANNEL_TYPE_TEXT, "DeliveryReportingSupport", + TP_IFACE_CHANNEL_TYPE_TEXT, "SupportedContentTypes", + TP_IFACE_CHANNEL_TYPE_TEXT, "MessageTypes", NULL); } @@ -224,16 +222,6 @@ salut_im_channel_get_object_path_suffix (TpBaseChannel *chan) tp_base_channel_get_target_handle (chan)); } -static GPtrArray * -salut_im_channel_get_interfaces (TpBaseChannel *chan) -{ - GPtrArray *interfaces = TP_BASE_CHANNEL_CLASS (salut_im_channel_parent_class) - ->get_interfaces (chan); - - g_ptr_array_add (interfaces, TP_IFACE_CHANNEL_INTERFACE_MESSAGES); - return interfaces; -} - static void salut_im_channel_class_init (SalutImChannelClass *salut_im_channel_class) { @@ -251,7 +239,6 @@ salut_im_channel_class_init (SalutImChannelClass *salut_im_channel_class) object_class->set_property = salut_im_channel_set_property; base_class->channel_type = TP_IFACE_CHANNEL_TYPE_TEXT; - base_class->get_interfaces = salut_im_channel_get_interfaces; base_class->target_handle_type = TP_HANDLE_TYPE_CONTACT; base_class->close = salut_im_channel_close; base_class->fill_immutable_properties = diff --git a/src/muc-channel.c b/src/muc-channel.c index 091e60a2..73d7bf96 100644 --- a/src/muc-channel.c +++ b/src/muc-channel.c @@ -54,14 +54,13 @@ #include "text-helper.h" #include "tube-stream.h" #include "tube-dbus.h" +#include "util.h" G_DEFINE_TYPE_WITH_CODE(SalutMucChannel, salut_muc_channel, TP_TYPE_BASE_CHANNEL, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_INTERFACE_GROUP, tp_group_mixin_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_TYPE_TEXT, - tp_message_mixin_text_iface_init); - G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_INTERFACE_MESSAGES, - tp_message_mixin_messages_iface_init); + tp_message_mixin_iface_init); ) /* signal enum */ @@ -123,7 +122,7 @@ static void salut_muc_channel_close (TpBaseChannel *base); static void update_tube_info (SalutMucChannel *self); static SalutTubeIface * create_new_tube (SalutMucChannel *self, - TpTubeType type, + SalutTubeType type, TpHandle initiator, const gchar *service, GHashTable *parameters, @@ -183,6 +182,34 @@ salut_muc_channel_set_property (GObject *object, } } +/* This is helper function with the signature of tp_group_mixin_change_members() + * from tp-glib 0.x */ +static void +change_members (GObject *obj, + const gchar *message, + const TpIntset *add, + const TpIntset *del, + const TpIntset *add_local_pending, + const TpIntset *add_remote_pending, + TpHandle actor, + TpChannelGroupChangeReason reason) +{ + GHashTable *details; + + details = tp_asv_new ( + "actor", G_TYPE_UINT, actor, + "change-reason", G_TYPE_UINT, reason, + NULL); + + if (message != NULL) + tp_asv_set_string (details, "message", message); + + tp_group_mixin_change_members (obj, + add, del, add_local_pending, add_remote_pending, details); + + g_hash_table_unref (details); +} + static void salut_muc_channel_add_self_to_members (SalutMucChannel *self) { @@ -206,7 +233,7 @@ salut_muc_channel_add_self_to_members (SalutMucChannel *self) add = tp_intset_new (); tp_intset_add (add, tp_base_connection_get_self_handle (base_conn)); - tp_group_mixin_change_members (G_OBJECT (self), + change_members (G_OBJECT (self), "", add, empty, empty, empty, tp_base_connection_get_self_handle (base_conn), TP_CHANNEL_GROUP_CHANGE_REASON_NONE); @@ -304,7 +331,6 @@ salut_muc_channel_constructed (GObject *obj) contact_repo, tp_base_connection_get_self_handle (base_conn)); tp_group_mixin_change_flags (obj, - TP_CHANNEL_GROUP_FLAG_PROPERTIES | TP_CHANNEL_GROUP_FLAG_CAN_ADD | TP_CHANNEL_GROUP_FLAG_MESSAGE_ADD, 0); @@ -430,7 +456,7 @@ send_invite_cb (GObject *source_object, removed = tp_intset_new (); tp_intset_add (removed, handle); - tp_group_mixin_change_members (G_OBJECT (data->self), "", empty, removed, empty, + change_members (G_OBJECT (data->self), "", empty, removed, empty, empty, tp_base_connection_get_self_handle (base_connection), TP_CHANNEL_GROUP_CHANGE_REASON_ERROR); @@ -522,7 +548,7 @@ salut_muc_channel_add_member (GObject *iface, { /* We are considered as remote-pending while the muc connection * is not connected */ - tp_group_mixin_change_members (G_OBJECT (self), + change_members (G_OBJECT (self), message, empty_, empty_, empty_, add, tp_base_connection_get_self_handle (base_connection), TP_CHANNEL_GROUP_CHANGE_REASON_NONE); @@ -551,7 +577,7 @@ salut_muc_channel_add_member (GObject *iface, empty = tp_intset_new (); remote_pending = tp_intset_new (); tp_intset_add (remote_pending, handle); - tp_group_mixin_change_members (G_OBJECT(self), "", empty, empty, empty, + change_members (G_OBJECT(self), "", empty, empty, empty, remote_pending, tp_base_connection_get_self_handle (base_connection), TP_CHANNEL_GROUP_CHANGE_REASON_INVITED); tp_intset_destroy (empty); @@ -618,10 +644,10 @@ salut_muc_channel_fill_immutable_properties (TpBaseChannel *chan, tp_dbus_properties_mixin_fill_properties_hash ( G_OBJECT (chan), properties, - TP_IFACE_CHANNEL_INTERFACE_MESSAGES, "MessagePartSupportFlags", - TP_IFACE_CHANNEL_INTERFACE_MESSAGES, "DeliveryReportingSupport", - TP_IFACE_CHANNEL_INTERFACE_MESSAGES, "SupportedContentTypes", - TP_IFACE_CHANNEL_INTERFACE_MESSAGES, "MessageTypes", + TP_IFACE_CHANNEL_TYPE_TEXT, "MessagePartSupportFlags", + TP_IFACE_CHANNEL_TYPE_TEXT, "DeliveryReportingSupport", + TP_IFACE_CHANNEL_TYPE_TEXT, "SupportedContentTypes", + TP_IFACE_CHANNEL_TYPE_TEXT, "MessageTypes", NULL); } @@ -632,7 +658,7 @@ salut_muc_channel_get_interfaces (TpBaseChannel *chan) ->get_interfaces (chan); g_ptr_array_add (interfaces, TP_IFACE_CHANNEL_INTERFACE_GROUP); - g_ptr_array_add (interfaces, TP_IFACE_CHANNEL_INTERFACE_MESSAGES); + return interfaces; } @@ -828,11 +854,9 @@ salut_muc_channel_invited (SalutMucChannel *self, TpHandle inviter, g_assert (stanza != NULL); tp_intset_add (local_pending, self_handle); - tp_group_mixin_change_members (G_OBJECT(self), stanza, - empty, empty, - local_pending, empty, - inviter, - TP_CHANNEL_GROUP_CHANGE_REASON_INVITED); + change_members (G_OBJECT(self), stanza, + empty, empty, local_pending, empty, + inviter, TP_CHANNEL_GROUP_CHANGE_REASON_INVITED); tp_intset_destroy (local_pending); tp_intset_destroy (empty); } @@ -889,13 +913,8 @@ salut_muc_channel_add_members (SalutMucChannel *self, tp_intset_add (changes, contact->handle); } - tp_group_mixin_change_members (G_OBJECT(self), - "", - changes, - empty, - empty, empty, - 0, - TP_CHANNEL_GROUP_CHANGE_REASON_NONE); + change_members (G_OBJECT(self), "", changes, empty, empty, empty, + 0, TP_CHANNEL_GROUP_CHANGE_REASON_NONE); tp_intset_destroy (changes); tp_intset_destroy (empty); g_object_unref (contact_mgr); @@ -934,13 +953,8 @@ salut_muc_channel_remove_members (SalutMucChannel *self, tp_intset_add (changes, handle); } - tp_group_mixin_change_members (G_OBJECT(self), - "", - empty, - changes, - empty, empty, - 0, - TP_CHANNEL_GROUP_CHANGE_REASON_NONE); + change_members (G_OBJECT(self), "", empty, changes, empty, empty, + 0, TP_CHANNEL_GROUP_CHANGE_REASON_NONE); tp_intset_destroy (changes); tp_intset_destroy (empty); } @@ -949,7 +963,7 @@ salut_muc_channel_remove_members (SalutMucChannel *self, static gboolean extract_tube_information (SalutMucChannel *self, WockyNode *tube_node, - TpTubeType *type, + SalutTubeType *type, TpHandle *initiator_handle, const gchar **service, GHashTable **parameters, @@ -969,11 +983,11 @@ extract_tube_information (SalutMucChannel *self, if (!tp_strdiff (_type, "stream")) { - *type = TP_TUBE_TYPE_STREAM; + *type = SALUT_TUBE_TYPE_STREAM; } else if (!tp_strdiff (_type, "dbus")) { - *type = TP_TUBE_TYPE_DBUS; + *type = SALUT_TUBE_TYPE_DBUS; } else { @@ -1088,13 +1102,13 @@ muc_channel_handle_tubes (SalutMucChannel *self, { guint tube_id = GPOINTER_TO_UINT (key); SalutTubeIface *tube = value; - TpTubeType type; + SalutTubeType type; g_object_get (tube, "type", &type, NULL); - if (type != TP_TUBE_TYPE_DBUS) + if (type != SALUT_TUBE_TYPE_DBUS) return; if (salut_tube_dbus_handle_in_names (SALUT_TUBE_DBUS (tube), @@ -1110,7 +1124,7 @@ muc_channel_handle_tubes (SalutMucChannel *self, const gchar *stream_id; SalutTubeIface *tube; guint tube_id; - TpTubeType type; + SalutTubeType type; GibberBytestreamIface *bytestream; stream_id = wocky_node_get_attribute (tube_node, "stream-id"); @@ -1134,7 +1148,7 @@ muc_channel_handle_tubes (SalutMucChannel *self, { switch (type) { - case TP_TUBE_TYPE_DBUS: + case SALUT_TUBE_TYPE_DBUS: { if (initiator_handle == 0) { @@ -1143,7 +1157,7 @@ muc_channel_handle_tubes (SalutMucChannel *self, } } break; - case TP_TUBE_TYPE_STREAM: + case SALUT_TUBE_TYPE_STREAM: initiator_handle = contact; break; default: @@ -1172,7 +1186,7 @@ muc_channel_handle_tubes (SalutMucChannel *self, "type", &type, NULL); - if (type == TP_TUBE_TYPE_DBUS + if (type == SALUT_TUBE_TYPE_DBUS && !salut_tube_dbus_handle_in_names (SALUT_TUBE_DBUS (tube), contact)) { @@ -1479,7 +1493,7 @@ publish_tube_in_node (SalutMucChannel *self, base_conn, TP_HANDLE_TYPE_CONTACT); WockyNode *parameters_node; GHashTable *parameters; - TpTubeType type; + SalutTubeType type; gchar *service, *id_str; guint64 tube_id; TpHandle initiator_handle; @@ -1501,7 +1515,7 @@ publish_tube_in_node (SalutMucChannel *self, switch (type) { - case TP_TUBE_TYPE_DBUS: + case SALUT_TUBE_TYPE_DBUS: { gchar *name, *stream_id; @@ -1523,7 +1537,7 @@ publish_tube_in_node (SalutMucChannel *self, } break; - case TP_TUBE_TYPE_STREAM: + case SALUT_TUBE_TYPE_STREAM: wocky_node_set_attribute (node, "type", "stream"); break; default: @@ -1577,7 +1591,7 @@ update_tube_info (SalutMucChannel *self) while (g_hash_table_iter_next (&iter, NULL, &value)) { TpTubeChannelState state; - TpTubeType type; + SalutTubeType type; TpHandle initiator; WockyNode *tube_node; @@ -1590,7 +1604,7 @@ update_tube_info (SalutMucChannel *self) if (state != TP_TUBE_CHANNEL_STATE_OPEN) continue; - if (type == TP_TUBE_TYPE_STREAM + if (type == SALUT_TUBE_TYPE_STREAM && initiator != TP_GROUP_MIXIN (self)->self_handle) /* We only announce stream tubes we initiated */ return; @@ -1674,7 +1688,7 @@ generate_tube_id (SalutMucChannel *self) static SalutTubeIface * create_new_tube (SalutMucChannel *self, - TpTubeType type, + SalutTubeType type, TpHandle initiator, const gchar *service, GHashTable *parameters, @@ -1693,12 +1707,12 @@ create_new_tube (SalutMucChannel *self, switch (type) { - case TP_TUBE_TYPE_DBUS: + case SALUT_TUBE_TYPE_DBUS: tube = SALUT_TUBE_IFACE (salut_tube_dbus_new (conn, handle, TP_HANDLE_TYPE_ROOM, self_handle, priv->muc_connection, initiator, service, parameters, tube_id, requested)); break; - case TP_TUBE_TYPE_STREAM: + case SALUT_TUBE_TYPE_STREAM: tube = SALUT_TUBE_IFACE (salut_tube_stream_new (conn, handle, TP_HANDLE_TYPE_ROOM, self_handle, initiator, FALSE, service, @@ -1729,7 +1743,7 @@ salut_muc_channel_tube_request (SalutMucChannel *self, const gchar *service; GHashTable *parameters = NULL; guint64 tube_id; - TpTubeType type; + SalutTubeType type; tube_id = generate_tube_id (self); @@ -1738,14 +1752,14 @@ salut_muc_channel_tube_request (SalutMucChannel *self, if (!tp_strdiff (channel_type, TP_IFACE_CHANNEL_TYPE_STREAM_TUBE)) { - type = TP_TUBE_TYPE_STREAM; + type = SALUT_TUBE_TYPE_STREAM; service = tp_asv_get_string (request_properties, TP_PROP_CHANNEL_TYPE_STREAM_TUBE_SERVICE); } else if (! tp_strdiff (channel_type, TP_IFACE_CHANNEL_TYPE_DBUS_TUBE)) { - type = TP_TUBE_TYPE_DBUS; + type = SALUT_TUBE_TYPE_DBUS; service = tp_asv_get_string (request_properties, TP_PROP_CHANNEL_TYPE_DBUS_TUBE_SERVICE_NAME); } diff --git a/src/muc-manager.c b/src/muc-manager.c index 41cd3438..cdeccdd3 100644 --- a/src/muc-manager.c +++ b/src/muc-manager.c @@ -360,12 +360,12 @@ salut_muc_manager_type_foreach_channel_class (GType type, g_hash_table_insert (table, TP_IFACE_CHANNEL ".TargetHandleType", handle_type_value); - /* org.freedesktop.Telepathy.Channel.Type.Text */ + /* im.telepathy1.Channel.Type.Text */ g_value_set_static_string (channel_type_value, TP_IFACE_CHANNEL_TYPE_TEXT); func (type, table, muc_channel_allowed_properties, user_data); - /* org.freedesktop.Telepathy.Channel.Type.StreamTube */ + /* im.telepathy1.Channel.Type.StreamTube */ g_value_set_static_string (channel_type_value, TP_IFACE_CHANNEL_TYPE_STREAM_TUBE); func (type, table, salut_tube_stream_channel_get_allowed_properties (), diff --git a/src/muc-tube-dbus.c b/src/muc-tube-dbus.c index 5d639f40..3054885e 100644 --- a/src/muc-tube-dbus.c +++ b/src/muc-tube-dbus.c @@ -21,6 +21,8 @@ #include "muc-tube-dbus.h" +#include <telepathy-glib/telepathy-glib-dbus.h> + G_DEFINE_TYPE (SalutMucTubeDBus, salut_muc_tube_dbus, SALUT_TYPE_TUBE_DBUS) diff --git a/src/muc-tube-stream.c b/src/muc-tube-stream.c index 8155b9c2..f66a96fe 100644 --- a/src/muc-tube-stream.c +++ b/src/muc-tube-stream.c @@ -21,6 +21,8 @@ #include "muc-tube-stream.h" +#include <telepathy-glib/telepathy-glib-dbus.h> + G_DEFINE_TYPE (SalutMucTubeStream, salut_muc_tube_stream, SALUT_TYPE_TUBE_STREAM) diff --git a/src/protocol.c b/src/protocol.c index 2b805c85..1223734e 100644 --- a/src/protocol.c +++ b/src/protocol.c @@ -22,7 +22,7 @@ #include <dbus/dbus-glib.h> #include <dbus/dbus-protocol.h> -#include <telepathy-glib/telepathy-glib.h> +#include <telepathy-glib/telepathy-glib-dbus.h> #include "connection.h" #include "contact-manager.h" @@ -156,7 +156,6 @@ get_connection_details (TpBaseProtocol *self, if (channel_managers != NULL) { GType types[] = { - SALUT_TYPE_CONTACT_MANAGER, SALUT_TYPE_FT_MANAGER, SALUT_TYPE_IM_MANAGER, SALUT_TYPE_MUC_MANAGER, diff --git a/src/protocol.h b/src/protocol.h index 8e3b4d5b..9b99d538 100644 --- a/src/protocol.h +++ b/src/protocol.h @@ -63,9 +63,9 @@ GType salut_protocol_get_type (void); SALUT_TYPE_PROTOCOL, \ SalutProtocolClass)) -#define SALUT_PROTOCOL_LOCAL_XMPP_NAME "local-xmpp" +#define SALUT_PROTOCOL_LOCAL_XMPP_NAME "local_xmpp" #define SALUT_PROTOCOL_LOCAL_XMPP_ENGLISH_NAME "Link-local XMPP" -#define SALUT_PROTOCOL_LOCAL_XMPP_ICON_NAME "im-" SALUT_PROTOCOL_LOCAL_XMPP_NAME +#define SALUT_PROTOCOL_LOCAL_XMPP_ICON_NAME "im-local-xmpp" /** * salut_protocol_new: diff --git a/src/roomlist-channel.c b/src/roomlist-channel.c index bdaa5c99..c09a643c 100644 --- a/src/roomlist-channel.c +++ b/src/roomlist-channel.c @@ -247,7 +247,7 @@ salut_roomlist_channel_add_room (SalutRoomlistChannel *self, dbus_g_type_specialized_construct (TP_STRUCT_TYPE_ROOM_INFO)); dbus_g_type_struct_set (&room, 0, handle, - 1, "org.freedesktop.Telepathy.Channel.Type.Text", + 1, "im.telepathy1.Channel.Type.Text", 2, keys, G_MAXUINT); g_ptr_array_add (priv->rooms, g_value_get_boxed (&room)); @@ -299,7 +299,7 @@ salut_roomlist_channel_remove_room (SalutRoomlistChannel *self, * salut_roomlist_channel_get_listing_rooms * * Implements D-Bus method GetListingRooms - * on interface org.freedesktop.Telepathy.Channel.Type.RoomList + * on interface im.telepathy1.Channel.Type.RoomList * * @error: Used to return a pointer to a GError detailing any error * that occurred, D-Bus will throw the error only if this @@ -324,7 +324,7 @@ salut_roomlist_channel_get_listing_rooms (TpSvcChannelTypeRoomList *iface, * salut_roomlist_channel_list_rooms * * Implements D-Bus method ListRooms - * on interface org.freedesktop.Telepathy.Channel.Type.RoomList + * on interface im.telepathy1.Channel.Type.RoomList * * @error: Used to return a pointer to a GError detailing any error * that occurred, D-Bus will throw the error only if this @@ -350,7 +350,7 @@ salut_roomlist_channel_list_rooms (TpSvcChannelTypeRoomList *iface, * salut_roomlist_channel_stop_listing * * Implements D-Bus method StopListing - * on interface org.freedesktop.Telepathy.Channel.Type.RoomList + * on interface im.telepathy1.Channel.Type.RoomList */ static void salut_roomlist_channel_stop_listing (TpSvcChannelTypeRoomList *iface, diff --git a/src/text-helper.h b/src/text-helper.h index d1ab7c6c..c9c2fcde 100644 --- a/src/text-helper.h +++ b/src/text-helper.h @@ -21,7 +21,7 @@ #ifndef __TEXT_HELPER_H__ #define __TEXT_HELPER_H__ -#include <telepathy-glib/telepathy-glib.h> +#include <telepathy-glib/telepathy-glib-dbus.h> #include <wocky/wocky.h> diff --git a/src/tube-dbus.c b/src/tube-dbus.c index 08cb0016..c48421d6 100644 --- a/src/tube-dbus.c +++ b/src/tube-dbus.c @@ -43,6 +43,7 @@ #include "muc-tube-dbus.h" #include "tube-iface.h" #include "sha1/sha1-util.h" +#include "util.h" /* When we receive D-Bus messages to be delivered to the application and the * application is not yet connected to the D-Bus tube, theses D-Bus messages @@ -636,7 +637,7 @@ salut_tube_dbus_get_property (GObject *object, g_value_set_string (value, priv->stream_id); break; case PROP_TYPE: - g_value_set_uint (value, TP_TUBE_TYPE_DBUS); + g_value_set_uint (value, SALUT_TUBE_TYPE_DBUS); break; case PROP_SERVICE: g_value_set_string (value, priv->service); @@ -1535,7 +1536,7 @@ salut_tube_dbus_check_access_control (SalutTubeDBus *self, * salut_tube_dbus_offer_async * * Implement D-Bus method Offer on interface - * org.freedesktop.Telepathy.Channel.Type.DBusTube + * im.telepathy1.Channel.Type.DBusTube */ static void salut_tube_dbus_offer_async (TpSvcChannelTypeDBusTube *self, @@ -1575,7 +1576,7 @@ salut_tube_dbus_offer_async (TpSvcChannelTypeDBusTube *self, * salut_tube_dbus_accept_async * * Implements D-Bus method Accept on interface - * org.freedesktop.Telepathy.Channel.Type.DBusTube + * im.telepathy1.Channel.Type.DBusTube */ static void salut_tube_dbus_accept_async (TpSvcChannelTypeDBusTube *self, diff --git a/src/tube-iface.c b/src/tube-iface.c index 5381c989..60b9012a 100644 --- a/src/tube-iface.c +++ b/src/tube-iface.c @@ -144,7 +144,7 @@ salut_tube_iface_base_init (gpointer klass) param_spec = g_param_spec_uint ( "type", "Tube type", - "The TpTubeType this D-Bus tube object.", + "The SalutTubeType this D-Bus tube object.", 0, G_MAXUINT32, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_interface_install_property (klass, param_spec); @@ -179,7 +179,7 @@ salut_tube_iface_base_init (gpointer klass) "state", "Tube state", "The TpTubeChannelState of this DBUS tube object", - 0, G_MAXUINT32, TP_TUBE_STATE_REMOTE_PENDING, + 0, G_MAXUINT32, TP_TUBE_CHANNEL_STATE_REMOTE_PENDING, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_interface_install_property (klass, param_spec); diff --git a/src/tube-stream.c b/src/tube-stream.c index fea5be7c..c55c4db1 100644 --- a/src/tube-stream.c +++ b/src/tube-stream.c @@ -65,6 +65,7 @@ #include "tube-iface.h" #include "si-bytestream-manager.h" #include "contact-manager.h" +#include "util.h" static void tube_iface_init (gpointer g_iface, gpointer iface_data); static void streamtube_iface_init (gpointer g_iface, gpointer iface_data); @@ -717,7 +718,8 @@ local_new_connection_cb (GibberListener *listener, static void fire_new_remote_connection (SalutTubeStream *self, GibberTransport *transport, - TpHandle contact) + TpHandle contact, + const gchar *contact_id) { SalutTubeStreamPrivate *priv = SALUT_TUBE_STREAM_GET_PRIVATE (self); GValue access_control_param = {0,}; @@ -734,7 +736,7 @@ fire_new_remote_connection (SalutTubeStream *self, g_assert (connection_id != 0); tp_svc_channel_type_stream_tube_emit_new_remote_connection (self, - contact, &access_control_param, connection_id); + contact, contact_id, &access_control_param, connection_id); g_value_unset (&access_control_param); } @@ -1088,7 +1090,7 @@ salut_tube_stream_get_property (GObject *object, g_value_set_uint64 (value, priv->id); break; case PROP_TYPE: - g_value_set_uint (value, TP_TUBE_TYPE_STREAM); + g_value_set_uint (value, SALUT_TUBE_TYPE_STREAM); break; case PROP_SERVICE: g_value_set_string (value, priv->service); @@ -1857,7 +1859,7 @@ salut_tube_stream_add_bytestream (SalutTubeIface *tube, g_signal_emit (G_OBJECT (self), signals[NEW_CONNECTION], 0, contact); - fire_new_remote_connection (self, transport, contact); + fire_new_remote_connection (self, transport, contact, peer_id); g_free (peer_id); } @@ -2051,7 +2053,7 @@ salut_tube_stream_check_params (TpSocketAddressType address_type, * salut_tube_stream_offer_async * * Implements D-Bus method Offer - * on org.freedesktop.Telepathy.Channel.Type.StreamTube + * on im.telepathy1.Channel.Type.StreamTube */ static void salut_tube_stream_offer_async (TpSvcChannelTypeStreamTube *iface, @@ -2108,7 +2110,7 @@ salut_tube_stream_offer_async (TpSvcChannelTypeStreamTube *iface, * salut_tube_stream_accept_async * * Implements D-Bus method Accept - * on org.freedesktop.Telepathy.Channel.Type.StreamTube + * on im.telepathy1.Channel.Type.StreamTube */ static void salut_tube_stream_accept_async (TpSvcChannelTypeStreamTube *iface, diff --git a/src/tubes-manager.c b/src/tubes-manager.c index 998296cc..45b65669 100644 --- a/src/tubes-manager.c +++ b/src/tubes-manager.c @@ -57,7 +57,7 @@ static void gabble_caps_channel_manager_iface_init ( GabbleCapsChannelManagerIface *); static SalutTubeIface * create_new_tube (SalutTubesManager *self, - TpTubeType type, + SalutTubeType type, TpHandle handle, const gchar *service, GHashTable *parameters, @@ -120,7 +120,7 @@ static gboolean extract_tube_information (TpHandleRepoIface *contact_repo, WockyStanza *stanza, gboolean *close_out, - TpTubeType *type, + SalutTubeType *type, TpHandle *initiator_handle, const gchar **service, GHashTable **parameters, @@ -220,9 +220,9 @@ extract_tube_information (TpHandleRepoIface *contact_repo, tube_type = wocky_node_get_attribute (tube_node, "type"); if (!tp_strdiff (tube_type, "stream")) - *type = TP_TUBE_TYPE_STREAM; + *type = SALUT_TUBE_TYPE_STREAM; else if (!tp_strdiff (tube_type, "dbus")) - *type = TP_TUBE_TYPE_DBUS; + *type = SALUT_TUBE_TYPE_DBUS; else { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, @@ -293,7 +293,7 @@ iq_tube_request_cb (WockyPorter *porter, /* tube informations */ const gchar *service; - TpTubeType tube_type; + SalutTubeType tube_type; TpHandle initiator_handle; GHashTable *parameters; guint64 tube_id; @@ -706,7 +706,7 @@ generate_tube_id (SalutTubesManager *self) static SalutTubeIface * create_new_tube (SalutTubesManager *self, - TpTubeType type, + SalutTubeType type, TpHandle handle, const gchar *service, GHashTable *parameters, @@ -720,14 +720,14 @@ create_new_tube (SalutTubesManager *self, TpHandle self_handle = tp_base_connection_get_self_handle (base_conn); SalutTubeIface *tube; - if (type == TP_TUBE_TYPE_STREAM) + if (type == SALUT_TUBE_TYPE_STREAM) { tube = SALUT_TUBE_IFACE (salut_tube_stream_new (priv->conn, handle, TP_HANDLE_TYPE_CONTACT, self_handle, self_handle, FALSE, service, parameters, tube_id, portnum, iq_req, TRUE)); } - else if (type == TP_TUBE_TYPE_DBUS) + else if (type == SALUT_TUBE_TYPE_DBUS) { tube = SALUT_TUBE_IFACE (salut_tube_dbus_new (priv->conn, handle, TP_HANDLE_TYPE_CONTACT, self_handle, NULL, @@ -757,7 +757,7 @@ new_channel_from_request (SalutTubesManager *self, { SalutTubeIface *tube; - TpTubeType type; + SalutTubeType type; const gchar *ctype, *service; TpHandle handle; guint64 tube_id; @@ -778,14 +778,14 @@ new_channel_from_request (SalutTubesManager *self, service = tp_asv_get_string (request, TP_PROP_CHANNEL_TYPE_STREAM_TUBE_SERVICE); - type = TP_TUBE_TYPE_STREAM; + type = SALUT_TUBE_TYPE_STREAM; } else if (!tp_strdiff (ctype, TP_IFACE_CHANNEL_TYPE_DBUS_TUBE)) { service = tp_asv_get_string (request, TP_PROP_CHANNEL_TYPE_DBUS_TUBE_SERVICE_NAME); - type = TP_TUBE_TYPE_DBUS; + type = SALUT_TUBE_TYPE_DBUS; } else { @@ -991,7 +991,7 @@ salut_tubes_manager_iface_init (gpointer g_iface, static void add_service_to_array (const gchar *service, GPtrArray *arr, - TpTubeType type) + SalutTubeType type) { GValue monster = {0, }; GHashTable *fixed_properties; @@ -1003,7 +1003,7 @@ add_service_to_array (const gchar *service, NULL }; - g_assert (type == TP_TUBE_TYPE_STREAM || type == TP_TUBE_TYPE_DBUS); + g_assert (type == SALUT_TUBE_TYPE_STREAM || type == SALUT_TUBE_TYPE_DBUS); g_value_init (&monster, TP_STRUCT_TYPE_REQUESTABLE_CHANNEL_CLASS); g_value_take_boxed (&monster, @@ -1014,7 +1014,7 @@ add_service_to_array (const gchar *service, (GDestroyNotify) tp_g_value_slice_free); channel_type_value = tp_g_value_slice_new (G_TYPE_STRING); - if (type == TP_TUBE_TYPE_STREAM) + if (type == SALUT_TUBE_TYPE_STREAM) g_value_set_static_string (channel_type_value, TP_IFACE_CHANNEL_TYPE_STREAM_TUBE); else @@ -1030,7 +1030,7 @@ add_service_to_array (const gchar *service, target_handle_type_value = tp_g_value_slice_new (G_TYPE_STRING); g_value_set_string (target_handle_type_value, service); - if (type == TP_TUBE_TYPE_STREAM) + if (type == SALUT_TUBE_TYPE_STREAM) g_hash_table_insert (fixed_properties, TP_IFACE_CHANNEL_TYPE_STREAM_TUBE ".Service", target_handle_type_value); @@ -1142,10 +1142,10 @@ get_contact_caps_foreach (gpointer data, if (g_str_has_prefix (ns, STREAM_CAP_PREFIX)) add_service_to_array (ns + strlen (STREAM_CAP_PREFIX), closure->arr, - TP_TUBE_TYPE_STREAM); + SALUT_TUBE_TYPE_STREAM); else if (g_str_has_prefix (ns, DBUS_CAP_PREFIX)) add_service_to_array (ns + strlen (DBUS_CAP_PREFIX), closure->arr, - TP_TUBE_TYPE_DBUS); + SALUT_TUBE_TYPE_DBUS); } static void @@ -32,4 +32,10 @@ void salut_wocky_node_add_children_from_properties (WockyNode *node, GHashTable *properties, const gchar *prop); gchar *salut_generate_id (void); +typedef enum +{ + SALUT_TUBE_TYPE_STREAM, + SALUT_TUBE_TYPE_DBUS, +} SalutTubeType; + #endif /* __SALUT_UTIL_H__ */ diff --git a/src/write-mgr-file.c b/src/write-mgr-file.c index 6a02fff8..fd52820c 100644 --- a/src/write-mgr-file.c +++ b/src/write-mgr-file.c @@ -25,7 +25,7 @@ #include <dbus/dbus-glib.h> #include <dbus/dbus-protocol.h> -#include <telepathy-glib/telepathy-glib.h> +#include <telepathy-glib/telepathy-glib-dbus.h> #include "protocol.h" @@ -206,14 +206,6 @@ generate_group_name (GHashTable *props) handle_type_name = "-multi"; break; - case TP_HANDLE_TYPE_GROUP: - handle_type_name = "-group"; - break; - - case TP_HANDLE_TYPE_LIST: - handle_type_name = "-list"; - break; - default: handle_type_name = ""; } @@ -280,7 +272,7 @@ write_presence (GKeyFile *f, statuses = tp_asv_get_boxed (props, TP_PROP_PROTOCOL_INTERFACE_PRESENCE_STATUSES, - TP_HASH_TYPE_SIMPLE_STATUS_SPEC_MAP); + TP_HASH_TYPE_STATUS_SPEC_MAP); g_return_if_fail (statuses != NULL); g_hash_table_iter_init (&iter, statuses); |