Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1cd6b58
commit 1b01196
Showing
4 changed files
with
369 additions
and
156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
app/src/main/java/org/thoughtcrime/securesms/database/model/StatusUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package org.thoughtcrime.securesms.database.model; | ||
|
||
import org.thoughtcrime.securesms.database.MmsSmsColumns; | ||
import org.thoughtcrime.securesms.database.SmsDatabase; | ||
|
||
final class StatusUtil { | ||
private StatusUtil() {} | ||
|
||
static boolean isDelivered(long deliveryStatus, int deliveryReceiptCount) { | ||
return (deliveryStatus >= SmsDatabase.Status.STATUS_COMPLETE && | ||
deliveryStatus < SmsDatabase.Status.STATUS_PENDING) || deliveryReceiptCount > 0; | ||
} | ||
|
||
static boolean isPending(long type) { | ||
return MmsSmsColumns.Types.isPendingMessageType(type) && | ||
!MmsSmsColumns.Types.isIdentityVerified(type) && | ||
!MmsSmsColumns.Types.isIdentityDefault(type); | ||
} | ||
|
||
static boolean isFailed(long type, long deliveryStatus) { | ||
return MmsSmsColumns.Types.isFailedMessageType(type) || | ||
MmsSmsColumns.Types.isPendingSecureSmsFallbackType(type) || | ||
deliveryStatus >= SmsDatabase.Status.STATUS_FAILED; | ||
} | ||
|
||
static boolean isVerificationStatusChange(long type) { | ||
return SmsDatabase.Types.isIdentityDefault(type) || SmsDatabase.Types.isIdentityVerified(type); | ||
} | ||
} |
Oops, something went wrong.