1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-16 09:12:06 +01:00
Smack/test-unit/org/jivesoftware/smackx
Florian Schmaus bfefbdb777 Implement XEP-0184 delivery notifications
This patch provides three components required to implement XEP-0184:

 * DeliveryReceiptRequest is a PacketExtension to request a receipt
 * DeliveryReceipt is a PacketExtension that contains the receipt
 * DeliveryReceiptManager to handle sending/receiving of requests and
   receipts.

Implementation:

For requesting a receipt, just add a new DeliveryReceiptRequest() to
your message or use the helper function:

    DeliveryReceiptManager.addDeliveryReceiptRequest(packet);

Register a ReceiptReceivedListener to find out if your packet arrived:

    DeliveryReceiptManager.getInstanceFor(myConnection)
	.registerReceiptReceivedListener(new ReceiptReceivedListener() {
	    @Override public void onReceiptReceived(String fromJid,
				    String toJid, String receiptId) {
		// receipt received for packet id receiptId
	    }

To answer a receipt request, you can either check incoming packets
manually:

    if (DeliveryReceiptManager.hasDeliveryReceiptRequest(packet)) {
	// send receipt
    }

Or you can enable automatic receipt transmission with:

    DeliveryReceiptManager.getInstanceFor(myConnection)
	    .setAutoReceiptsEnabled(true);

Signed-Off-By: Georg Lukas <georg@op-co.de>

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@13431 b35dd754-fafc-0310-a699-88a17e54d16e
2013-02-04 09:53:56 +00:00
..
bytestreams SMACK-404 Changed StringUtils.decodeBase64(String) behavior so that the method does not try to detect and decompress a gzip-compressed input. Refactored every use of the Base64.(de|en)code* methods to use the StringUtils (de|en)codeBase64 methods instead. 2013-01-29 22:49:20 +00:00
carbons SMACK-403 add support for 2013-01-28 09:38:02 +00:00
filetransfer SMACK-334 FileTransferNegotiator now passes the correct type in the stream-method variable. 2011-03-30 00:43:35 +00:00
muc SMACK-163 Fixed NPE in accessing form field information. 2011-03-29 00:44:38 +00:00
ping SMACK-388 Moved PingProvider, Ping and Pong under ../smackx/ping package 2013-01-15 19:56:25 +00:00
provider improved Delay Information Parser (fixes SMACK-243) 2010-08-15 13:20:48 +00:00
pubsub Merged the 3.2 branch back into trunk. 2011-09-09 01:26:22 +00:00
receipts Implement XEP-0184 delivery notifications 2013-02-04 09:53:56 +00:00