1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-27 00:32:07 +01:00
Smack/source/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
..
bookmark SMACK-279: The XMPPConnection extends the new abstract Connection class 2010-02-09 11:55:56 +00:00
bytestreams Fix erroneous cast from byte to int in IBBInputStream's read() 2013-01-05 12:53:45 +00:00
carbons SMACK-403 add support for 2013-01-28 09:38:02 +00:00
commands SMACK-363 Applied code cleanup patches for many generics related issues. 2012-10-26 10:47:55 +00:00
debugger SMACK-363 Applied code cleanup patches for many generics related issues. 2012-10-26 10:47:55 +00:00
filetransfer Updated url in javadoc. Changed from jabber to xmpp. 2011-12-19 15:45:24 +00:00
forward SMACK-403 add support for 2013-01-28 09:38:02 +00:00
muc SMACK-270 MultiUserChat relied on finalize() being called in order to remove packet listeners and the association with RoomListenerMultiplexor. The PacketListeners are referenced by Connection, which meant that MultiUserChat is always strongly reachable until the connection dies. 2013-01-31 22:30:49 +00:00
packet SMACK-375 Properly escape Strings in DiscoverInfo and DiscoverItems for XML. 2013-01-31 22:30:36 +00:00
ping fix typo in PingManager.getInstanceFor() function name 2013-01-26 09:47:39 +00:00
provider 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
pubsub SMACK-363 Applied code cleanup patches for many generics related issues. 2012-10-26 10:47:55 +00:00
receipts Implement XEP-0184 delivery notifications 2013-02-04 09:53:56 +00:00
search SMACK-363 Applied code cleanup patches for many generics related issues. 2012-10-26 10:47:55 +00:00
workgroup SMACK-363 Applied code cleanup patches for many generics related issues. 2012-10-26 10:47:55 +00:00
ChatState.java Copyright update. 2007-02-12 00:59:05 +00:00
ChatStateListener.java Copyright update. 2007-02-12 00:59:05 +00:00
ChatStateManager.java SMACK-374 Added patch to fix memory leak. 2012-11-22 02:51:51 +00:00
DefaultMessageEventRequestListener.java Copyright update. 2007-02-12 00:59:05 +00:00
Form.java Added check for missing field type for multi list in data forms. 2013-02-04 03:53:53 +00:00
FormField.java SMACK-363 Applied code cleanup patches for many generics related issues. 2012-10-26 10:47:55 +00:00
GroupChatInvitation.java Copyright update. 2007-02-12 00:59:05 +00:00
LastActivityManager.java SMACK-279: The XMPPConnection extends the new abstract Connection class 2010-02-09 11:55:56 +00:00
MessageEventManager.java SMACK-363 Applied code cleanup patches for many generics related issues. 2012-10-26 10:47:55 +00:00
MessageEventNotificationListener.java Copyright update. 2007-02-12 00:59:05 +00:00
MessageEventRequestListener.java Copyright update. 2007-02-12 00:59:05 +00:00
MultipleRecipientInfo.java SMACK-363 Applied code cleanup patches for many generics related issues. 2012-10-26 10:47:55 +00:00
MultipleRecipientManager.java SMACK-363 Applied code cleanup patches for many generics related issues. 2012-10-26 10:47:55 +00:00
NodeInformationProvider.java Copyright update. 2007-02-12 00:59:05 +00:00
OfflineMessageHeader.java Copyright update. 2007-02-12 00:59:05 +00:00
OfflineMessageManager.java SMACK-363 Applied code cleanup patches for many generics related issues. 2012-10-26 10:47:55 +00:00
package.html Initial check-in. 2003-08-23 23:08:19 +00:00
PEPListener.java Added a first version of Personal Event Publishing. 2008-10-30 21:29:17 +00:00
PEPManager.java SMACK-279: The XMPPConnection extends the new abstract Connection class 2010-02-09 11:55:56 +00:00
PrivateDataManager.java SMACK-363 Applied code cleanup patches for many generics related issues. 2012-10-26 10:47:55 +00:00
RemoteRosterEntry.java SMACK-363 Applied code cleanup patches for many generics related issues. 2012-10-26 10:47:55 +00:00
ReportedData.java adding Generics to Iterators without 2011-05-30 11:31:02 +00:00
RosterExchangeListener.java SMACK-363 Applied code cleanup patches for many generics related issues. 2012-10-26 10:47:55 +00:00
RosterExchangeManager.java SMACK-363 Applied code cleanup patches for many generics related issues. 2012-10-26 10:47:55 +00:00
ServiceDiscoveryManager.java SMACK-348 Updated broken links. 2011-08-18 03:44:41 +00:00
SharedGroupManager.java SMACK-363 Applied code cleanup patches for many generics related issues. 2012-10-26 10:47:55 +00:00
XHTMLManager.java SMACK-363 Applied code cleanup patches for many generics related issues. 2012-10-26 10:47:55 +00:00
XHTMLText.java SMACK-329 2011-06-01 07:39:05 +00:00