Packet received = new Message(); received.addExtension(new DeliveryReceipt(packet.getPacketID())); received.setTo(packet.getFrom()); connection.sendPacket(received);
private static void sendToIndividualRecipients(Connection connection, Packet packet, List<String> to, List<String> cc, List<String> bcc) { if (to != null) { for (Iterator<String> it = to.iterator(); it.hasNext();) { String jid = it.next(); packet.setTo(jid); connection.sendPacket(new PacketCopy(packet.toXML())); } } if (cc != null) { for (Iterator<String> it = cc.iterator(); it.hasNext();) { String jid = it.next(); packet.setTo(jid); connection.sendPacket(new PacketCopy(packet.toXML())); } } if (bcc != null) { for (Iterator<String> it = bcc.iterator(); it.hasNext();) { String jid = it.next(); packet.setTo(jid); connection.sendPacket(new PacketCopy(packet.toXML())); } } }
private static void sendToIndividualRecipients(Connection connection, Packet packet, List to, List cc, List bcc) { if (to != null) { for (Iterator it = to.iterator(); it.hasNext();) { String jid = (String) it.next(); packet.setTo(jid); connection.sendPacket(new PacketCopy(packet.toXML())); } } if (cc != null) { for (Iterator it = cc.iterator(); it.hasNext();) { String jid = (String) it.next(); packet.setTo(jid); connection.sendPacket(new PacketCopy(packet.toXML())); } } if (bcc != null) { for (Iterator it = bcc.iterator(); it.hasNext();) { String jid = (String) it.next(); packet.setTo(jid); connection.sendPacket(new PacketCopy(packet.toXML())); } } }
private static void sendToIndividualRecipients(Connection connection, Packet packet, List to, List cc, List bcc) { if (to != null) { for (Iterator it = to.iterator(); it.hasNext();) { String jid = (String) it.next(); packet.setTo(jid); connection.sendPacket(new PacketCopy(packet.toXML())); } } if (cc != null) { for (Iterator it = cc.iterator(); it.hasNext();) { String jid = (String) it.next(); packet.setTo(jid); connection.sendPacket(new PacketCopy(packet.toXML())); } } if (bcc != null) { for (Iterator it = bcc.iterator(); it.hasNext();) { String jid = (String) it.next(); packet.setTo(jid); connection.sendPacket(new PacketCopy(packet.toXML())); } } }
private static void sendToIndividualRecipients(XMPPConnection connection, Packet packet, List to, List cc, List bcc) { if (to != null) { for (Iterator it = to.iterator(); it.hasNext();) { String jid = (String) it.next(); packet.setTo(jid); connection.sendPacket(new PacketCopy(packet.toXML())); } } if (cc != null) { for (Iterator it = cc.iterator(); it.hasNext();) { String jid = (String) it.next(); packet.setTo(jid); connection.sendPacket(new PacketCopy(packet.toXML())); } } if (bcc != null) { for (Iterator it = bcc.iterator(); it.hasNext();) { String jid = (String) it.next(); packet.setTo(jid); connection.sendPacket(new PacketCopy(packet.toXML())); } } }
PacketFilter packetFilter = new MessageTypeFilter( Message.Type.chat); connection.addPacketListener(new PacketListener() { @Override public void processPacket(Packet packet) throws NotConnectedException { Message message = (Message) packet; if (message.getBody() != null) { String fromName = StringUtils .parseBareAddress(message.getFrom()); Log.e("XMPPChatDemoActivity", "Text Recieved " + message.getBody() + " from " + fromName); Packet received = new Message(); received.addExtension(new DeliveryReceipt( packet.getPacketID())); received.setTo(packet.getFrom()); connection.sendPacket(received); } } }, packetFilter);
packet.setTo(serviceAddress);
packet.setTo(serviceAddress);
packet.setTo(serviceAddress);
packet.setTo(serviceAddress);