org.jivesoftware.smackx.receipts.DeliveryReceiptManager Java Examples
The following examples show how to use
org.jivesoftware.smackx.receipts.DeliveryReceiptManager.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MessengerService.java From KlyphMessenger with MIT License | 5 votes |
protected void onConnectionSuccess() { Log.d(TAG, "onConnectionSuccess"); DeliveryReceiptManager.getInstanceFor(connection).enableAutoReceipts(); isLoggedIn = true; //listenMsgEvents(); listenNewChats(); executePendingActions(); }
Example #2
Source File: MessengerService.java From KlyphMessenger with MIT License | 4 votes |
private void sendMessageTo(Bundle bundle) { if (!connection.isConnected()) { addPendingAction(ACTION_SEND_MSG, bundle); } else { String to = bundle.getString("to"); String message = bundle.getString("message"); to = "-" + to + "@chat.facebook.com"; Log.d(TAG, "sendMessage to " + to + " " + message); Chat toChat = null; for (Chat chat : chats) { if (chat.getParticipant().equals(to)) { toChat = chat; } } if (toChat == null) { toChat = createChat(to); } org.jivesoftware.smack.packet.Message msg = new org.jivesoftware.smack.packet.Message(); msg.setBody(message); msg.setTo(to); msg.setType(org.jivesoftware.smack.packet.Message.Type.chat); msg.setThread(toChat.getThreadID()); // Add to the message all the notifications requests (offline, delivered, displayed, composing) MessageEventManager.addNotificationsRequests(msg, true, true, true, true); DeliveryReceiptManager.addDeliveryReceiptRequest(msg); try { toChat.sendMessage(msg); } catch (XMPPException e) { e.printStackTrace(); } } }