/** * Saves successfully sent messages into the db * * @param message the message */ protected boolean postToSentBox(Message message) { Logger.log(TAG, "postToSentBox(): postToWebService message to sent box " + message.toString()); // Change the status to SENT message.status = Message.Status.SENT; mMessageDatabaseHelper.putMessage(message); return true; }
protected void savePendingMessage(Message message) { // only save to pending when the number is not blacklisted if (!mPrefsFactory.enableBlacklist().get()) { message.status = Message.Status.FAILED; mMessageDatabaseHelper.put(message); } }
public void processRetries(Message message) { if (message.retries > mPrefsFactory.retries().get()) { // Delete from db deleteMessage(message); } else { // Increase message's number of tries for future comparison to know when to delete it. int retries = message.retries + 1; message.retries = retries; mMessageDatabaseHelper.put(message); } }
protected void deleteMessage(Message message) { Logger.log(TAG, " message ID " + message.messageUuid); mMessageDatabaseHelper.deleteByUuid(message.messageUuid); }