diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2013-09-24 19:20:17 +0100 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2013-09-25 15:01:32 +0100 |
commit | 303e8583eebd3c28f0edbf53f252a56bc1c73b5f (patch) | |
tree | 6e70e78f37ac84e33d59dbb344ec667807527002 /src | |
parent | 43a54163d71bba262af39535c98ce1547ce901ec (diff) | |
download | telepathy-haze-303e8583eebd3c28f0edbf53f252a56bc1c73b5f.tar.gz |
Use the "undrafted" version of MailNotification
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69468
Reviewed-by: Guillume Desmottes <guillaume.desmottes@collabora.co.uk>
[cherry-picked from next to master, no changes -smcv]
Diffstat (limited to 'src')
-rw-r--r-- | src/connection-mail.c | 54 | ||||
-rw-r--r-- | src/connection.c | 8 |
2 files changed, 19 insertions, 43 deletions
diff --git a/src/connection-mail.c b/src/connection-mail.c index 0e663ca..767ee2d 100644 --- a/src/connection-mail.c +++ b/src/connection-mail.c @@ -22,6 +22,7 @@ #include "extensions/extensions.h" #include <telepathy-glib/telepathy-glib.h> +#include <telepathy-glib/telepathy-glib-dbus.h> #include "connection.h" #include "connection-mail.h" @@ -40,32 +41,9 @@ enum static GPtrArray empty_array = { 0 }; - -static void -haze_connection_mail_subscribe ( - HazeSvcConnectionInterfaceMailNotification *iface, - DBusGMethodInvocation *context) -{ - /* Nothing do do, no resources attached to mail notification */ - haze_svc_connection_interface_mail_notification_return_from_subscribe ( - context); -} - - -static void -haze_connection_mail_unsubscribe ( - HazeSvcConnectionInterfaceMailNotification *iface, - DBusGMethodInvocation *context) -{ - /* Nothing do do, no resources attached to mail notification */ - haze_svc_connection_interface_mail_notification_return_from_unsubscribe ( - context); -} - - static void haze_connection_mail_request_inbox_url ( - HazeSvcConnectionInterfaceMailNotification *iface, + TpSvcConnectionInterfaceMailNotification *iface, DBusGMethodInvocation *context) { GError e = {TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, @@ -76,7 +54,7 @@ haze_connection_mail_request_inbox_url ( static void haze_connection_mail_request_mail_url ( - HazeSvcConnectionInterfaceMailNotification *iface, + TpSvcConnectionInterfaceMailNotification *iface, const gchar *in_id, const GValue *in_url_data, DBusGMethodInvocation *context) @@ -93,11 +71,11 @@ haze_connection_mail_request_mail_url ( result = tp_value_array_build (3, G_TYPE_STRING, g_value_get_string (in_url_data), - G_TYPE_UINT, HAZE_HTTP_METHOD_GET, - HAZE_ARRAY_TYPE_HTTP_POST_DATA_LIST, &empty_array, + G_TYPE_UINT, TP_HTTP_METHOD_GET, + TP_ARRAY_TYPE_HTTP_POST_DATA_LIST, &empty_array, G_TYPE_INVALID); - haze_svc_connection_interface_mail_notification_return_from_request_inbox_url ( + tp_svc_connection_interface_mail_notification_return_from_request_inbox_url ( context, result); g_value_array_free (result); @@ -115,12 +93,10 @@ void haze_connection_mail_iface_init (gpointer g_iface, gpointer iface_data) { - HazeSvcConnectionInterfaceMailNotificationClass *klass = g_iface; + TpSvcConnectionInterfaceMailNotificationClass *klass = g_iface; -#define IMPLEMENT(x) haze_svc_connection_interface_mail_notification_implement_##x (\ +#define IMPLEMENT(x) tp_svc_connection_interface_mail_notification_implement_##x (\ klass, haze_connection_mail_##x) - IMPLEMENT(subscribe); - IMPLEMENT(unsubscribe); IMPLEMENT(request_inbox_url); IMPLEMENT(request_mail_url); #undef IMPLEMENT @@ -180,8 +156,8 @@ haze_connection_mail_properties_getter (GObject *object, if (name == prop_quarks[PROP_MAIL_NOTIFICATION_FLAGS]) g_value_set_uint (value, - HAZE_MAIL_NOTIFICATION_FLAG_EMITS_MAILS_RECEIVED - | HAZE_MAIL_NOTIFICATION_FLAG_SUPPORTS_REQUEST_MAIL_URL); + TP_MAIL_NOTIFICATION_FLAG_EMITS_MAILS_RECEIVED + | TP_MAIL_NOTIFICATION_FLAG_SUPPORTS_REQUEST_MAIL_URL); else if (name == prop_quarks[PROP_UNREAD_MAIL_COUNT]) g_value_set_uint (value, 0); else if (name == prop_quarks[PROP_UNREAD_MAILS]) @@ -216,7 +192,7 @@ static GPtrArray * wrap_mail_address (const char *name_str, const char *addr_str) { GPtrArray *addr_array; - GType addr_type = HAZE_STRUCT_TYPE_MAIL_ADDRESS; + GType addr_type = TP_STRUCT_TYPE_MAIL_ADDRESS; GValue addr = {0}; addr_array = g_ptr_array_new (); @@ -246,8 +222,8 @@ haze_connection_mail_notify_emails (PurpleConnection *pc, const char **urls) { GPtrArray *mails; - HazeSvcConnectionInterfaceMailNotification *conn = - HAZE_SVC_CONNECTION_INTERFACE_MAIL_NOTIFICATION ( + TpSvcConnectionInterfaceMailNotification *conn = + TP_SVC_CONNECTION_INTERFACE_MAIL_NOTIFICATION ( ACCOUNT_GET_TP_BASE_CONNECTION ( purple_connection_get_account (pc))); @@ -280,7 +256,7 @@ haze_connection_mail_notify_emails (PurpleConnection *pc, /* Filter out any aberations */ if (from && to && subject && url) { - GType addr_list_type = HAZE_ARRAY_TYPE_MAIL_ADDRESS_LIST; + GType addr_list_type = TP_ARRAY_TYPE_MAIL_ADDRESS_LIST; GPtrArray *senders, *recipients; GHashTable *mail; @@ -316,7 +292,7 @@ haze_connection_mail_notify_emails (PurpleConnection *pc, } } - haze_svc_connection_interface_mail_notification_emit_mails_received ( + tp_svc_connection_interface_mail_notification_emit_mails_received ( conn, mails); g_ptr_array_unref (mails); diff --git a/src/connection.c b/src/connection.c index 8e1c0fc..10da219 100644 --- a/src/connection.c +++ b/src/connection.c @@ -79,7 +79,7 @@ G_DEFINE_TYPE_WITH_CODE(HazeConnection, tp_base_contact_list_mixin_groups_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION_INTERFACE_CONTACT_BLOCKING, tp_base_contact_list_mixin_blocking_iface_init); - G_IMPLEMENT_INTERFACE (HAZE_TYPE_SVC_CONNECTION_INTERFACE_MAIL_NOTIFICATION, + G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION_INTERFACE_MAIL_NOTIFICATION, haze_connection_mail_iface_init); ); @@ -87,7 +87,7 @@ static const gchar * implemented_interfaces[] = { /* Conditionally present */ TP_IFACE_CONNECTION_INTERFACE_AVATARS, - HAZE_IFACE_CONNECTION_INTERFACE_MAIL_NOTIFICATION, + TP_IFACE_CONNECTION_INTERFACE_MAIL_NOTIFICATION, TP_IFACE_CONNECTION_INTERFACE_CONTACT_BLOCKING, # define HAZE_NUM_CONDITIONAL_INTERFACES 3 @@ -205,7 +205,7 @@ add_optional_connection_interfaces (GPtrArray *ifaces, if (protocol_info_supports_mail_notification (prpl_info)) g_ptr_array_add (ifaces, - HAZE_IFACE_CONNECTION_INTERFACE_MAIL_NOTIFICATION); + TP_IFACE_CONNECTION_INTERFACE_MAIL_NOTIFICATION); } static void @@ -836,7 +836,7 @@ haze_connection_class_init (HazeConnectionClass *klass) haze_connection_avatars_properties_getter, NULL, NULL }, /* initialized a bit later */ - { HAZE_IFACE_CONNECTION_INTERFACE_MAIL_NOTIFICATION, + { TP_IFACE_CONNECTION_INTERFACE_MAIL_NOTIFICATION, haze_connection_mail_properties_getter, NULL, mail_props, |