1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-22 20:12:07 +01:00
No description
Find a file
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
build Implement XEP-0184 delivery notifications 2013-02-04 09:53:56 +00:00
documentation Merged the 3.2 Beta branch into trunk. 2011-03-14 01:53:42 +00:00
jingle/extension SMACK-363 Applied code cleanup patches for many generics related issues. 2012-10-26 10:47:55 +00:00
sample Fixed smack sample for updated API 2009-09-03 08:42:07 +00:00
source Implement XEP-0184 delivery notifications 2013-02-04 09:53:56 +00:00
test SMACK-391 Moved all date parsing into StringUtils and made it much more robust in handling multiple valid and invalid formats. 2013-02-04 03:45:37 +00:00
test-unit/org/jivesoftware Implement XEP-0184 delivery notifications 2013-02-04 09:53:56 +00:00
Makefile Remove .settings from the 'all' target in Makefile 2013-02-01 17:20:38 +00:00