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.
This Connection can provide a URL (with optional POST data) to open
a specific mail in a web-based client, via the
If this flag is not set, clients SHOULD fall back to using
Each
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.
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.
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.
A key providing information about the mail or thread. Well-known keys are as follows:
A unique ID for this e-mail. CMs with
Supports_Unread_Mails set in
If provided, the ID SHOULD be unique to a Mail at least until
that mail is removed with the
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
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.
The number of unread messages in the Inbox. Change notification is
via
This property is only useful if Supports_Unread_Mail_Count
is set in the
If Thread_Based appears in the
Note that this count MAY be bigger than the number of items in
An array of unread
The array size MAY be shorter than
Some servers may limits the amount of detailed e-mails sent. This
can significantly reduce the network traffic for large inbox. For
this reason, it is normal that
An array of
On connections that emit this signal, it's impossible to tell when a mail has been removed, and hence when "id" has become invalid.
A list of
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.
Emitted when
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.
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
Protocols have various different levels of Mail Notification support.
To describe the level of support, the interface provides a property
called
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
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
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
Orthogonal features described by the