1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-06-29 23:14:52 +02:00

Add Packet to onReceiptReceived parameters

in ReceiptReceivedListener. SMACK-582
This commit is contained in:
Florian Schmaus 2014-10-05 12:54:12 +02:00
parent 1e803ab29d
commit 8bf74c6e92
3 changed files with 6 additions and 3 deletions

View file

@ -105,7 +105,7 @@ public class DeliveryReceiptManager extends Manager implements PacketListener {
if (dr != null) { if (dr != null) {
// notify listeners of incoming receipt // notify listeners of incoming receipt
for (ReceiptReceivedListener l : receiptReceivedListeners) { for (ReceiptReceivedListener l : receiptReceivedListeners) {
l.onReceiptReceived(packet.getFrom(), packet.getTo(), dr.getId()); l.onReceiptReceived(packet.getFrom(), packet.getTo(), dr.getId(), packet);
} }
} }

View file

@ -16,6 +16,8 @@
*/ */
package org.jivesoftware.smackx.receipts; package org.jivesoftware.smackx.receipts;
import org.jivesoftware.smack.packet.Packet;
/** /**
* Interface for received receipt notifications. * Interface for received receipt notifications.
* *
@ -32,6 +34,7 @@ public interface ReceiptReceivedListener {
* @param fromJid the jid that send this receipt * @param fromJid the jid that send this receipt
* @param toJid the jid which received this receipt * @param toJid the jid which received this receipt
* @param receiptId the message ID of the packet which has been received and this receipt is for * @param receiptId the message ID of the packet which has been received and this receipt is for
* @param receipt the receipt
*/ */
void onReceiptReceived(String fromJid, String toJid, String receiptId); void onReceiptReceived(String fromJid, String toJid, String receiptId, Packet receipt);
} }

View file

@ -90,7 +90,7 @@ public class DeliveryReceiptTest extends InitExtensions {
private static class TestReceiptReceivedListener implements ReceiptReceivedListener { private static class TestReceiptReceivedListener implements ReceiptReceivedListener {
public String receiptId = null; public String receiptId = null;
@Override @Override
public void onReceiptReceived(String fromJid, String toJid, String receiptId) { public void onReceiptReceived(String fromJid, String toJid, String receiptId, Packet receipt) {
assertEquals("julia@capulet.com", fromJid); assertEquals("julia@capulet.com", fromJid);
assertEquals("romeo@montague.com", toJid); assertEquals("romeo@montague.com", toJid);
assertEquals("original-test-id", receiptId); assertEquals("original-test-id", receiptId);