From 303e8583eebd3c28f0edbf53f252a56bc1c73b5f Mon Sep 17 00:00:00 2001
From: Simon McVittie
Date: Tue, 24 Sep 2013 19:20:17 +0100
Subject: Use the "undrafted" version of MailNotification
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69468
Reviewed-by: Guillume Desmottes
[cherry-picked from next to master, no changes -smcv]
---
.../Connection_Interface_Mail_Notification.xml | 653 ---------------------
extensions/Makefile.am | 2 +-
extensions/all.xml | 7 +-
src/connection-mail.c | 54 +-
src/connection.c | 8 +-
tests/twisted/cm/protocols.py | 4 +-
6 files changed, 23 insertions(+), 705 deletions(-)
delete mode 100644 extensions/Connection_Interface_Mail_Notification.xml
diff --git a/extensions/Connection_Interface_Mail_Notification.xml b/extensions/Connection_Interface_Mail_Notification.xml
deleted file mode 100644
index 35678c2..0000000
--- a/extensions/Connection_Interface_Mail_Notification.xml
+++ /dev/null
@@ -1,653 +0,0 @@
-
-
- Copyright (C) 2007 Collabora Limited
-
- This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Library General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-
-
- (as draft 1)
-
-
-
-
- This Connection provides the number of unread e-mails (or e-mail
- threads) in the main folder of your e-mail account, as the
- UnreadMailCount property. The
- connection manager will update this value by emitting the
- UnreadMailsChanged signal.
-
-
-
-
- This Connection provides a detailed list of unread e-mails, as the
- UnreadMails property. If this flag
- is set, Supports_Unread_Mail_Count MUST be set, and
- Emits_Mails_Received MUST NOT be set.
- The Connection will update the list by emitting the
- UnreadMailsChanged signals.
-
-
-
-
- This Connection emits the MailsReceived
- signal, which provides details about newly arrived e-mails but does
- not maintain their read/unread status afterwards. This flag MUST NOT
- be combined with Supports_Unread_Mails.
-
-
-
-
- This Connection can provide a URL (with optional POST data) to
- open the the inbox of the e-mail account in a web-based client, via
- the RequestInboxURL method.
-
-
-
-
- This Connection can provide a URL (with optional POST data) to open
- a specific mail in a web-based client, via the
- RequestMailURL method. This feature
- is not useful unless either Emits_Mails_Received or
- Supports_Unread_Mails is set.
-
- If this flag is not set, clients SHOULD fall back to using
- RequestInboxURL if available.
-
-
-
-
- Each Mail represents a thread of e-mails, which
- MAY have more than one sender.
-
-
- Google Talk notifies users about new mail in terms of unread
- threads, rather than unread e-mails.
-
-
-
-
-
- Flags representing capabilities provided by a connection manager.
- Those values can be used as bitfield. Some flags depend on, or
- conflict with, each other.
-
- Connections SHOULD implement as many of these features as the
- underlying protocol allows, preferring to implement
- Supports_Unread_Mails instead of Emits_Mails_Received if both are
- possible.
-
-
-
-
-
-
- Use the GET method when opening the URL.
-
-
-
-
- Use the POST method when opening the URL. Refer to
- HTTP_Post_Data for more details.
-
-
-
- The HTTP Method with which to request a URL.
-
-
-
-
-
- A pair (key, value) representing POST data compatible with the
- application/x-www-form-urlencoded MIME type. The strings MUST be
- valid UTF-8 strings, and the characters used in the key MUST obey
- the requirements of the
-
- HTML CDATA type. The value MUST NOT be
- encoded with HTML entities.
-
- For example, if the POST data should contain a key "less-than" with value
- "<", and a key "percent" with value "%", this should be represented as
- two HTTP_Post_Data structures, ("less-than", "<") and ("percent", "%"),
- resulting in a POST request whose request body is "less-than=<&percent=%25".
- If a client passes this to a browser by writing it into an HTML form, it
- could do so by representing it as:
-
-
- <input type="hidden" name="less-than"><</input>
- <input type="hidden" name="percent">%</input>
-
-
-
- This data can be used to generate a HTML file that will
- automatically load the URL with appropriate POST data, in which case
- the client MUST convert any characters that are special within HTML
- into HTML entities. Alternatively, it can be used in an API that will
- instruct the browser how to load the URL (like the Netscape Plug-in
- API), in which case the client MUST escape
- characters that are
- reserved in URLs, if appropriate for that API.
-
- An array of pairs is used instead of a map from keys to values,
- because it's valid to repeat keys in both HTML and
- x-www-form-urlencoded data.
-
-
-
- The key, corresponding to a HTML control
- name
-
-
- The value
-
-
-
-
-
- A pair (name, address) representing an e-mail address,
- such as ("Nicolas Dufresne", "nicolas.dufresne@collabora.co.uk").
-
-
- The displayed name corresponding to the e-mail
- address
-
-
- The actual e-mail address
-
-
-
-
-
- A structure containing the required information to open a web-based
- e-mail UI, without needing re-authentication (if possible).
-
- Because the URL and POST data frequently contain short-lived
- credential tokens, a new URL should be requested (by calling one of
- the methods that returns a Mail_URL) for each visit to the web-based
- UI, and the URL should be visited soon after it is returned.
-
-
-
- The URL to which to send a request.
-
-
-
-
- The HTTP method of the request.
-
-
-
-
- An array of name-value pairs containing the POST data to use when
- opening the URL. This MUST be an empty array if the Method is not
- POST.
-
-
-
-
-
-
- An extensible map representing a mail, or (on protocols where
- Thread_Based appears in
- MailNotificationFlags) a thread of
- mails. All keys are optional where not otherwise stated; however, at
- least one of "senders" and "subject" must be included.
-
-
-
-
- A key providing information about the mail or thread. Well-known
- keys are as follows:
-
-
- - id — s
- -
-
A unique ID for this e-mail. CMs with
- Supports_Unread_Mails set in
- MailNotificationFlags MUST provide
- this key in each Mail.
-
- If provided, the ID SHOULD be unique to a Mail at least until
- that mail is removed with the
- UnreadMailsChanged signal
- (in protocols with Supports_Unread_Emails), or
- unique for the duration of a session (otherwise).
-
-
- In protocols with Supports_Unread_Mails, this key is used to
- indicate which mail was removed. In protocols without that
- feature, it's impossible to tell when a mail has been removed
- (and hence how long the identifier will remain valid for use
- with RequestMailURL).
-
-
-
- - url-data — any type
- - An opaque identifier (typically a string or list of strings)
- provided to the Connection when calling
- RequestMailURL,
- containing information used by the Connection to build the URL.
-
-
- - senders — a(ss) (Mail_Address)
- -
- An array of sender display name and e-mail address pairs. Note that
- only e-mails represented as a thread can have multiple senders.
-
-
- - to-addresses — a(ss) (Mail_Address)
- -
- An array of display name and e-mail address pairs representing
- the recipients.
-
-
- - cc-addresses — a(ss) (Mail_Address)
- -
- An array of display name and e-mail address pairs representing
- the carbon-copy recipients.
-
-
- - sent-timestamp — x (Unix_Timestamp64)
- - A UNIX timestamp indicating when the message was sent, or for
- a thread, when the most recent message was sent.
-
-
- - received-timestamp — x (Unix_Timestamp64)
- - A UNIX timestamp indicating when the message was received, or for
- a thread, when the most recent message was received.
-
-
- - has-attachments — b
- - If true, this mail has attachments.
-
- - subject — s
- -
- The subject of the message. This MUST be encoded in UTF-8.
-
-
- - content-type — s
- -
-
The MIME type of the message content. Two types are currently
- supported: "text/plain" for plain text, and "text/html" for a
- HTML document. If omitted, "text/plain" MUST be assumed.
- Regardless of MIME type, the content MUST be valid UTF-8 (which
- may require that the Connection transcodes it from a legacy
- encoding).
-
-
- All strings on D-Bus must be UTF-8.
-
-
-
- - truncated — b
- -
- If true, the content is only a partial message; if false or
- omitted, the content is the entire message.
-
-
- - content — s
- -
- The body of the message, possibly truncated, encoded as appropriate
- for "content-type".
-
-
- - folder — s
- -
- The name of the folder containing this e-mails.
- If omitted, the inbox SHOULD be assumed.
-
-
-
-
-
-
- The value, of whatever type is appropriate for the
- key.
-
-
-
-
-
- Integer representing the bitwise-OR of supported features for e-mails
- notification on this server. This property MUST NOT change after the
- Connection becomes CONNECTED.
-
-
- This property indicates the behavior and availability
- of the other properties and signals within this interface. A
- connection manager that cannot at least set one of the flags
- in the Mail_Notification_Flags
- SHOULD NOT provide this interface.
-
-
-
-
-
-
- The number of unread messages in the Inbox. Change notification is
- via UnreadMailsChanged.
-
- This property is only useful if Supports_Unread_Mail_Count
- is set in the MailNotificationFlags;
- otherwise, it MUST be zero.
-
- If Thread_Based appears in the
- MailNotificationFlags, this property
- counts the number of threads, not the number of mails.
-
-
-
-
-
- A array of unread Mails. Change notification is via
- UnreadMailsChanged. This property is
- only useful if Supports_Unread_Mails is set in
- MailNotificationFlags; otherwise, it MUST be
- an empty list.
-
-
-
-
-
- A string representing the e-mail address of the account. The CMs MUST
- provide this information.
-
- In close integration of MailNotification with other e-mail services,
- the e-mail address can be used has a unique identifier for the
- account. Possible integration could be between Telepathy and
- Evolution where the e-mail address is the common information in
- both interfaces.
-
-
-
-
-
-
-
- An array of Mails. Those e-mail MUST NOT have
- the "id" key.
-
-
- On connections that emit this signal, it's impossible to tell
- when a mail has been removed, and hence when "id" has become
- invalid.
-
-
-
-
-
- Emitted when new e-mails messages arrive to the inbox associated with
- this connection. This signal is used for protocols that are not able
- to maintain the UnreadMails list, but
- do provide real-time notification about newly arrived e-mails. It MUST
- NOT be emitted unless Emits_Mails_Received is set in
- MailNotificationFlags.
-
-
-
-
-
-
- Number of unread messages in the inbox (the new value of
- UnreadMailCount).
-
-
-
-
- A list of Mail that are being added or updated
- in UnreadMails.
-
-
- Mails may be updated when the URL information (URL and POST data)
- have changed, or senders were added or removed from an e-mail
- thread.
-
-
- If the Supports_Unread_Mails flag is not set, this list
- MUST be empty, even if Count has increased.
-
-
-
-
- A list of e-mail IDs that are being removed from
- UnreadMails.
- If the Supports_Unread_Mails flag is not set, this list
- MUST be empty, even if Count has decreased.
-
-
-
- Emitted when UnreadMails or
- UnreadMailCount have changed. It MUST
- NOT be emited if Supports_Unread_Mail_Count flag is not set
- in MailNotificationFlags.
-
- Mails_Added and
- Mails_Removed MUST be empty if the
- Supports_Unread_Mails flag is not set.
-
-
-
-
-
- This method subscribes a client to the notification interface. This
- MUST be called by clients before using this interface.
-
- The Connection tracks a subscription count (like a refcount) for
- each unique bus name that has called Subscribe(). When a client calls
- Unsubscribe(), it releases one "reference". If a client exits
- (or crashes), the Connection releases all "references" held on its
- behalf.
-
-
- The reference count imposed on the subscription simplifies
- implementation of client running in the same process
- (e.g. plug-ins): two plug-ins interested in mail notification can
- call Subscribe and Unsubscribe independently without interfering
- with each other.
-
- This method exists to reduce memory and network overhead when
- there is no active subscription. An example of a protocol that
- benefits from this method is the Google XMPP Mail Notification
- extension: in this protocol, the CM receives a notification
- that something has changed, but to get more information, the CM
- must request this information. Knowing that nobody is currently
- interested in this information, the CM can avoid generating
- useless network traffic. Similarly, the CM may free
- the list of unread messages to reduce memory overhead.
-
-
-
-
-
-
-
-
-
-
-
- This method unsubscribes a client from the notification interface.
- This SHOULD be called by each client that has successfully called
- Subscribe when it no longer needs the mail notification interface.
-
-
- See Subscribe for rationale.
-
-
-
-
-
- Raised if the client calling this method has no references to
- release.
-
-
-
-
-
-
-
-
-
- A struture containing a URL and optional additional data to open a
- webmail client, without re-authentication if possible.
-
-
-
- This method creates and returns a URL and an optional POST data that
- allow opening the Inbox folder of a webmail account. This URL MAY
- contain tokens with a short lifetime, so clients SHOULD request a new
- URL for each visit to the webmail interface. This method is implemented
- only if the Supports_Request_Inbox_URL flag is set in
- MailNotificationFlags.
-
-
- We are not using properties here because the tokens are unsuitable
- for sharing between clients, and network round-trips may be required
- to obtain the information that leads to authentication free webmail
- access.
-
-
-
-
-
-
-
-
-
-
-
-
- The mail's id as found in the Mail
- structure, or the empty string if no id key was provided.
-
-
-
-
- Whatever url-data was found in the Mail
- structure, or the boolean value False (D-Bus type 'b') if no
- url-data was provided in the Mail.
-
-
-
-
- A struture that contains a URL and optional additional data to open a
- webmail client, without re-authentication if possible.
-
-
-
- This method creates and returns a URL and optional POST data that
- allow opening a specific mail in a webmail interface. This
- method is implemented only if Supports_Request_Mail_URL flag
- is set in MailNotificationFlags.
-
- See RequestInboxURL for design
- rationale.
-
-
-
-
-
-
-
-
-
-
-
- An interface to support receiving notifications about a e-mail
- account associated with this connection.
-
- In protocols where this is possible, this interface also allows the
- connection manager to provide the necessary information for clients
- to open a web-based mail client without having to re-authenticate.
-
- To use this interface, a client MUST first subscribe using the
- Subscribe method. The subscription
- mechanic aims at reducing network traffic and memory footprint in the
- situation where nobody is currently interesting in provided
- information. When done with this interface, clients SHOULD call
- Unsubscribe to release resources in
- the CM.
-
- Protocols have various different levels of Mail Notification support.
- To describe the level of support, the interface provides a property
- called MailNotificationFlags.
- Not all combinations are valid; protocols can be divided into four
- categories as follows.
-
- Connections to the most capable protocols, such as Google's XMPP Mail
- Notification extension, have the Supports_Unread_Mails flag (this
- implies that they must also have Supports_Unread_Mail_Count, but not
- Emits_Mails_Received). On these connections, clients
- requiring change notification MUST monitor the
- UnreadMailsChanged signal, and
- either recover the initial state from the
- UnreadMails property (if they require
- details other than the number of mails) or the
- UnreadMailCount property (if they
- are only interested in the number of unread mails). The
- MailsReceived signal is never emitted
- on these connections, so clients that will display a short-term
- notification for each new mail MUST do so in response to emission of
- the UnreadMailsChanged signal.
-
- The most common situation, seen in protocols like MSN and Yahoo, is
- that the number of unread mails is provided and kept up-to-date,
- and a separate notification is emitted with some details of each new
- mail. This is a combination of the following two features, and clients
- SHOULD implement one or both as appropriate for their requirements.
-
- On protocols that have the Emits_Mails_Received flag (which implies
- that they do not have Supports_Unread_Mails), the CM does not keep
- track of any mails; it simply emits a notification whenever new mail
- arrives. Those events may be used for short term display (like a
- notification popup) to inform the user. No protocol is known to support
- only this feature, but it is useful for integration with libraries that
- that do not implement tracking of the number of mails. Clients
- requiring these notifications MUST monitor the
- MailsReceived signal on any connections
- with this flag.
-
- On protocols that have the Supports_Unread_Mail_Count flag but not
- the Supports_Unread_Mails flag, clients cannot display complete
- details of unread email, but can display an up-to-date count of the
- number of unread mails. To do this, they must monitor the
- UnreadMailsChanged signal, and
- retrieve the initial state from the
- UnreadMailCount property.
-
-
- Orthogonal features described by the
- MailNotificationFlags property include the
- RequestSomethingURL methods, which are used to obtain URLs allowing
- clients to open a webmail client. Connections SHOULD support as many
- of these methods as possible.
-
-
-
-
-
diff --git a/extensions/Makefile.am b/extensions/Makefile.am
index 32c9640..239c599 100644
--- a/extensions/Makefile.am
+++ b/extensions/Makefile.am
@@ -2,7 +2,7 @@ tools_dir = $(top_srcdir)/tools
EXTRA_DIST = \
all.xml \
- Connection_Interface_Mail_Notification.xml
+ $(NULL)
noinst_LTLIBRARIES = libhaze-extensions.la
diff --git a/extensions/all.xml b/extensions/all.xml
index 708cc7d..66b4a89 100644
--- a/extensions/all.xml
+++ b/extensions/all.xml
@@ -22,11 +22,6 @@ License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-
-
-
-
+
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
+#include
#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,
diff --git a/tests/twisted/cm/protocols.py b/tests/twisted/cm/protocols.py
index 1e8d3a7..2bd835b 100644
--- a/tests/twisted/cm/protocols.py
+++ b/tests/twisted/cm/protocols.py
@@ -105,7 +105,7 @@ def test(q, bus, conn, stream):
assertDoesNotContain(cs.CONN_IFACE_AVATARS, flat_props['ConnectionInterfaces'])
assertDoesNotContain(cs.CONN_IFACE_CONTACT_BLOCKING, flat_props['ConnectionInterfaces'])
- assertDoesNotContain(cs.CONN_IFACE_MAIL_NOTIFICATION + '.DRAFT', flat_props['ConnectionInterfaces'])
+ assertDoesNotContain(cs.CONN_IFACE_MAIL_NOTIFICATION, flat_props['ConnectionInterfaces'])
# Avatar not supported
assertEquals(0, protocol_avatar_props['MaximumAvatarBytes'])
@@ -164,7 +164,7 @@ def test(q, bus, conn, stream):
assertContains(cs.CONN_IFACE_AVATARS, flat_props['ConnectionInterfaces'])
assertContains(cs.CONN_IFACE_CONTACT_BLOCKING, flat_props['ConnectionInterfaces'])
- assertContains(cs.CONN_IFACE_MAIL_NOTIFICATION + '.DRAFT', flat_props['ConnectionInterfaces'])
+ assertContains(cs.CONN_IFACE_MAIL_NOTIFICATION, flat_props['ConnectionInterfaces'])
# libpurple currently says there's no max size
assertEquals(0, protocol_avatar_props['MaximumAvatarBytes'])
--
cgit v1.2.1