1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-09-09 17:19:39 +02:00

UI updates.

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@2073 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Matt Tucker 2003-08-29 18:47:39 +00:00 committed by mtucker
parent b8a72c2f04
commit de84ef5d36
8 changed files with 201 additions and 68 deletions

View file

@ -1,17 +1,18 @@
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<title>Message Events</title>
<title>Message Events</title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<h1>Message Events Support</h1>
<div class="header">Message Events</div><p>
This extension is used to request and respond to events relating to the delivery,
display, and composition of messages. There are three stages in this extension: 1) Request for
event notifications, 2) Receive the event notification requests and send event notifications, and
3) Receive the event notifications.
display, and composition of messages. There are three stages in this extension:<ol>
<li>Request for event notifications,
<li>Receive the event notification requests and send event notifications, and
<li>Receive the event notifications.</ol>
<p>For more information on each stage please follow these links:</p>
<ul>
<li><a href="#reqevnot">Requesting Event Notifications</a></li>
@ -20,19 +21,23 @@ event notifications, 2) Receive the event notification requests and send event n
</ul>
<b>JEP related:</b> <a href="http://www.jabber.org/jeps/jep-0022.html">JEP-22</a>
<hr>
<h2><a name="reqevnot">Requesting Event Notifications</a></h2>
<h3>Description</h3>
<div class="subheader"><a name="reqevnot">Requesting Event Notifications</a></div><p>
<b>Description</b><p>
In order to receive event notifications for a given message you first have to specify
which events are you interested in. Each message that you send has to request its own event
notifications. Therefore, every message that you send as part of a chat should request its own event
notifications.
<h3>Usage</h3>
notifications.</p>
<b>Usage</b><p>
The class <i>MessageEventManager</i> provides an easy way for requesting event notifications. All you have to do is specify
the message that requires the event notifications and the events that you are interested in.
<p>Use the static method <i><b>MessageEventManager.addNotificationsRequests(Message message, boolean offline, boolean
delivered, boolean displayed, boolean composing)</b></i> for requesting event notifications.
</p>
<h3>Example</h3>
<b>Example</b><p>
Below you can find an example that logs in a user to the server, creates a message, adds the requests
for notifications and sends the message.
<blockquote>
@ -55,12 +60,18 @@ for notifications and sends the message.
chat1.sendMessage(msg);
</pre>
</blockquote>
<hr>
<h2><a name="lstevnotreq">Reacting to Event Notification Requests</a></h2>
<h3>Description</h3>
<div class="subheader"><a name="lstevnotreq">Reacting to Event Notification Requests</a></div><p>
<b>Description</b><p>
You can receive notification requests for the following events: delivered, displayed, composing and offline. You
<b>must</b> listen for these requests and react accordingly.
<h3>Usage</h3>
<b>must</b> listen for these requests and react accordingly.</p>
<b>Usage</b><p>
The general idea is to create a new <i>DefaultMessageEventRequestListener</i> that will listen to the event notifications
requests and react with custom logic. Then you will have to add the listener to the
<i>MessageEventManager</i> that works on
@ -78,8 +89,10 @@ implements the <i>MessageEventRequestListener</i> interface, please remember to
</li>
<li>To add a listener to the messageEventManager use the MessageEventManager's message
<i><b>addMessageEventRequestListener(MessageEventRequestListener)</b></i>.</li>
</ul>
<h3>Example</h3>
</ul></p>
<b>Example</b><p>
Below you can find an example that connects two users to the server. One user will create a message, add the requests
for notifications and will send the message to the other user. The other user will add a
<i>DefaultMessageEventRequestListener</i>
@ -150,13 +163,19 @@ to a <i>MessageEventManager</i> that will listen and react to the event notifica
messageEventManager.sendCancelledNotification(user1, msg.getPacketID());
</pre>
</blockquote>
<hr>
<h2><a name="lstevnot">Reacting to Event Notifications</a></h2>
<h3>Description</h3>
<div clas="subheader"><a name="lstevnot">Reacting to Event Notifications</a></div><p>
<b>Description</b><p>
Once you have requested for event notifications you will start to receive notifications of events. You can
receive notifications of the following events: delivered, displayed, composing, offline and cancelled. You
will probably want to react to some or all of these events.
<h3>Usage</h3>
will probably want to react to some or all of these events.</p>
<b>Usage</b><p>
The general idea is to create a new <i>MessageEventNotificationListener</i> that will listen to the event notifications
and react with custom logic. Then you will have to add the listener to the <i>MessageEventManager</i> that works on
the desired <i>XMPPConnection</i>.
@ -168,8 +187,9 @@ the desired <i>XMPPConnection</i>.
</li>
<li>To add a listener to the messageEventManager use the MessageEventManager's message
<i><b>addMessageEventNotificationListener(MessageEventNotificationListener)</b></i>.</li>
</ul>
<h3>Example</h3>
</ul></p>
<b>Example</b><p>
Below you can find an example that logs in a user to the server, adds a <i>MessageEventNotificationListener</i>
to a <i>MessageEventManager</i> that will listen and react to the event notifications, creates a message, adds
the requests for notifications and sends the message.