Java 类org.jivesoftware.smackx.receipts.ReceiptReceivedListener 实例源码

项目:BizareChat    文件:DisplayedManager.java   
private DisplayedManager(XMPPConnection connection) {
    super(connection);
    ServiceDiscoveryManager sdm = ServiceDiscoveryManager.getInstanceFor(connection);
    sdm.addFeature(Displayed.NAMESPACE);
    connection.addAsyncStanzaListener(packet -> {
        Displayed receipt = Displayed.from((Message) packet);
        for (ReceiptReceivedListener listener : receiptReceivedListeners) {
            listener.onReceiptReceived(packet.getFrom(), packet.getTo(), receipt.getId(), packet);
        }
    }, MESSAGES_WITH_DISPLAYED);
}
项目:BizareChat    文件:ReceivedManager.java   
private ReceivedManager(XMPPConnection connection) {
    super(connection);
    ServiceDiscoveryManager sdm = ServiceDiscoveryManager.getInstanceFor(connection);
    sdm.addFeature(Received.NAMESPACE);
    connection.addAsyncStanzaListener(packet -> {
        Received receipt = Received.from((Message) packet);
        for (ReceiptReceivedListener listener : receiptReceivedListeners) {
            listener.onReceiptReceived(packet.getFrom(), packet.getTo(), receipt.getId(), packet);
        }
    }, MESSAGES_WITH_RECEIVED);
}
项目:BizareChat    文件:DeliveredReceiptManager.java   
private DeliveredReceiptManager(XMPPConnection connection) {
    super(connection);
    ServiceDiscoveryManager sdm = ServiceDiscoveryManager.getInstanceFor(connection);
    sdm.addFeature(DeliveredReceipt.NAMESPACE);
    connection.addAsyncStanzaListener(packet -> {
        DeliveredReceipt receipt = DeliveredReceipt.from((Message) packet);
        for (ReceiptReceivedListener listener : receiptReceivedListeners) {
            listener.onReceiptReceived(packet.getFrom(), packet.getTo(), receipt.getId(), packet);
        }
    }, MESSAGES_WITH_DELIVERED_RECEIPT);
}
项目:BizareChat    文件:ReadReceiptManager.java   
private ReadReceiptManager(XMPPConnection connection) {
    super(connection);
    ServiceDiscoveryManager sdm = ServiceDiscoveryManager.getInstanceFor(connection);
    sdm.addFeature(ReadReceipt.NAMESPACE);
    connection.addAsyncStanzaListener(packet -> {
        ReadReceipt receipt = ReadReceipt.from((Message) packet);
        for (ReceiptReceivedListener listener : receiptReceivedListeners) {
            listener.onReceiptReceived(packet.getFrom(), packet.getTo(), receipt.getId(), packet);
        }
    }, MESSAGES_WITH_READ_RECEIPT);
}
项目:maven-yaxim    文件:SmackableImp.java   
private void initServiceDiscovery() {
    // register connection features
    ServiceDiscoveryManager sdm = ServiceDiscoveryManager.getInstanceFor(mXMPPConnection);

    // init Entity Caps manager with storage in app's cache dir
    try {
        if (capsCacheDir == null) {
            capsCacheDir = new File(mService.getCacheDir(), "entity-caps-cache");
            capsCacheDir.mkdirs();
            EntityCapsManager.setPersistentCache(new SimpleDirectoryPersistentCache(capsCacheDir));
        }
    } catch (java.io.IOException e) {
        Log.e(TAG, "Could not init Entity Caps cache: " + e.getLocalizedMessage());
    }

    // reference PingManager, set ping flood protection to 10s
    PingManager.getInstanceFor(mXMPPConnection).setPingMinimumInterval(10*1000);

    // set Version for replies
    String app_name = mService.getString(org.yaxim.androidclient.R.string.app_name);
    String build_version[] = mService.getString(org.yaxim.androidclient.R.string.build_version).split(" ");
    Version.Manager.getInstanceFor(mXMPPConnection).setVersion(
            new Version(app_name, build_version[1], "Android"));

    // reference DeliveryReceiptManager, add listener
    DeliveryReceiptManager dm = DeliveryReceiptManager.getInstanceFor(mXMPPConnection);
    dm.enableAutoReceipts();
    dm.addReceiptReceivedListener(new ReceiptReceivedListener() { // DOES NOT WORK IN CARBONS
        public void onReceiptReceived(String fromJid, String toJid, String receiptId) {
            Log.d(TAG, "got delivery receipt for " + receiptId);
            changeMessageDeliveryStatus(receiptId, ChatConstants.DS_ACKED);
        }});
}
项目:BizareChat    文件:DisplayedManager.java   
public void addDisplayedListener(ReceiptReceivedListener listener) {
    receiptReceivedListeners.add(listener);
}
项目:BizareChat    文件:DisplayedManager.java   
public void removeDisplayedListener(ReceiptReceivedListener listener) {
    receiptReceivedListeners.remove(listener);
}
项目:BizareChat    文件:ReceivedManager.java   
public void addReceivedListener(ReceiptReceivedListener listener) {
    receiptReceivedListeners.add(listener);
}
项目:BizareChat    文件:ReceivedManager.java   
public void removeReceivedListener(ReceiptReceivedListener listener) {
    receiptReceivedListeners.remove(listener);
}
项目:BizareChat    文件:DeliveredReceiptManager.java   
public void addDeliveredReceivedListener(ReceiptReceivedListener listener) {
    receiptReceivedListeners.add(listener);
}
项目:BizareChat    文件:DeliveredReceiptManager.java   
public void removeDeliveredReceivedListener(ReceiptReceivedListener listener) {
    receiptReceivedListeners.remove(listener);
}
项目:BizareChat    文件:ReadReceiptManager.java   
public void addReadReceivedListener(ReceiptReceivedListener listener) {
    receiptReceivedListeners.add(listener);
}
项目:BizareChat    文件:ReadReceiptManager.java   
public void removeRemoveReceivedListener(ReceiptReceivedListener listener) {
    receiptReceivedListeners.remove(listener);
}