2003-08-13 14:59:24 +02:00
|
|
|
/**
|
|
|
|
*
|
2007-02-12 01:59:05 +01:00
|
|
|
* Copyright 2003-2007 Jive Software.
|
2003-08-13 14:59:24 +02:00
|
|
|
*
|
2014-02-17 18:57:38 +01:00
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
2004-11-03 00:37:00 +01:00
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
2003-08-13 14:59:24 +02:00
|
|
|
*
|
2004-11-03 00:37:00 +01:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2003-08-13 14:59:24 +02:00
|
|
|
*
|
2004-11-03 00:37:00 +01:00
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
2003-08-13 14:59:24 +02:00
|
|
|
*/
|
|
|
|
|
2014-02-15 11:35:08 +01:00
|
|
|
package org.jivesoftware.smackx.xevent;
|
2003-08-13 14:59:24 +02:00
|
|
|
|
2014-03-19 14:22:20 +01:00
|
|
|
import org.jivesoftware.smack.SmackException.NotConnectedException;
|
2017-06-14 17:12:43 +02:00
|
|
|
|
2015-02-14 17:15:02 +01:00
|
|
|
import org.jxmpp.jid.Jid;
|
2014-03-19 14:22:20 +01:00
|
|
|
|
2003-08-13 14:59:24 +02:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* A listener that is fired anytime a message event request is received.
|
2018-05-09 23:06:12 +02:00
|
|
|
* Message event requests are received when the received message includes an extension
|
2003-08-13 14:59:24 +02:00
|
|
|
* like this:
|
2018-05-09 23:06:12 +02:00
|
|
|
*
|
2003-08-18 22:18:19 +02:00
|
|
|
* <pre>
|
|
|
|
* <x xmlns='jabber:x:event'>
|
|
|
|
* <offline/>
|
|
|
|
* <delivered/>
|
|
|
|
* <composing/>
|
|
|
|
* </x>
|
|
|
|
* </pre>
|
2018-05-09 23:06:12 +02:00
|
|
|
*
|
2003-08-13 14:59:24 +02:00
|
|
|
* In this example you can see that the sender of the message requests to be notified
|
2018-05-09 23:06:12 +02:00
|
|
|
* when the user couldn't receive the message because he/she is offline, the message
|
|
|
|
* was delivered or when the receiver of the message is composing a reply.
|
2003-08-13 14:59:24 +02:00
|
|
|
*
|
|
|
|
* @author Gaston Dombiak
|
|
|
|
*/
|
|
|
|
public interface MessageEventRequestListener {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Called when a request for message delivered notification is received.
|
2018-05-09 23:06:12 +02:00
|
|
|
*
|
2003-08-13 14:59:24 +02:00
|
|
|
* @param from the user that sent the notification.
|
2003-09-18 00:21:45 +02:00
|
|
|
* @param packetID the id of the message that was sent.
|
2003-08-13 14:59:24 +02:00
|
|
|
* @param messageEventManager the messageEventManager that fired the listener.
|
2018-05-09 23:06:12 +02:00
|
|
|
* @throws NotConnectedException
|
|
|
|
* @throws InterruptedException
|
2003-08-13 14:59:24 +02:00
|
|
|
*/
|
2017-12-13 23:10:11 +01:00
|
|
|
void deliveredNotificationRequested(Jid from, String packetID,
|
2015-02-14 09:43:44 +01:00
|
|
|
MessageEventManager messageEventManager) throws NotConnectedException, InterruptedException;
|
2003-08-13 14:59:24 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Called when a request for message displayed notification is received.
|
2018-05-09 23:06:12 +02:00
|
|
|
*
|
2003-08-13 14:59:24 +02:00
|
|
|
* @param from the user that sent the notification.
|
2003-09-18 00:21:45 +02:00
|
|
|
* @param packetID the id of the message that was sent.
|
2003-08-13 14:59:24 +02:00
|
|
|
* @param messageEventManager the messageEventManager that fired the listener.
|
|
|
|
*/
|
2017-12-13 23:10:11 +01:00
|
|
|
void displayedNotificationRequested(Jid from, String packetID,
|
2003-09-18 00:21:45 +02:00
|
|
|
MessageEventManager messageEventManager);
|
2003-08-13 14:59:24 +02:00
|
|
|
|
|
|
|
/**
|
2018-05-09 23:06:12 +02:00
|
|
|
* Called when a request that the receiver of the message is composing a reply notification is
|
2003-08-13 14:59:24 +02:00
|
|
|
* received.
|
2018-05-09 23:06:12 +02:00
|
|
|
*
|
2003-08-13 14:59:24 +02:00
|
|
|
* @param from the user that sent the notification.
|
2003-09-18 00:21:45 +02:00
|
|
|
* @param packetID the id of the message that was sent.
|
2003-08-13 14:59:24 +02:00
|
|
|
* @param messageEventManager the messageEventManager that fired the listener.
|
|
|
|
*/
|
2017-12-13 23:10:11 +01:00
|
|
|
void composingNotificationRequested(Jid from, String packetID,
|
2003-09-18 00:21:45 +02:00
|
|
|
MessageEventManager messageEventManager);
|
2003-08-13 14:59:24 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Called when a request that the receiver of the message is offline is received.
|
2018-05-09 23:06:12 +02:00
|
|
|
*
|
2003-08-13 14:59:24 +02:00
|
|
|
* @param from the user that sent the notification.
|
2003-09-18 00:21:45 +02:00
|
|
|
* @param packetID the id of the message that was sent.
|
2003-08-13 14:59:24 +02:00
|
|
|
* @param messageEventManager the messageEventManager that fired the listener.
|
|
|
|
*/
|
2017-12-13 23:10:11 +01:00
|
|
|
void offlineNotificationRequested(Jid from, String packetID,
|
2003-09-18 00:21:45 +02:00
|
|
|
MessageEventManager messageEventManager);
|
2003-08-13 14:59:24 +02:00
|
|
|
|
|
|
|
}
|