示例#1
0
 /**
  * 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;
 }
示例#2
0
 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);
   }
 }
示例#3
0
 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);
   }
 }
示例#4
0
 protected void deleteMessage(Message message) {
   Logger.log(TAG, " message ID " + message.messageUuid);
   mMessageDatabaseHelper.deleteByUuid(message.messageUuid);
 }