Add isControlMessage convenience variable

This commit is contained in:
nielsandriesse 2021-06-01 10:02:20 +10:00
parent 7710a2c32f
commit b000be9037
2 changed files with 5 additions and 1 deletions

View File

@ -32,7 +32,7 @@ class ConversationAdapter(context: Context, cursor: Cursor) : CursorRecyclerView
override fun getItemViewType(cursor: Cursor): Int {
val message = getMessage(cursor)!!
if (message.isExpirationTimerUpdate) { return ViewType.Control.rawValue }
if (message.isControlMessage) { return ViewType.Control.rawValue }
return ViewType.Visible.rawValue
}

View File

@ -127,4 +127,8 @@ public abstract class DisplayRecord {
public boolean isMissedCall() {
return SmsDatabase.Types.isMissedCall(type);
}
public boolean isControlMessage() {
return isGroupUpdateMessage() || isExpirationTimerUpdate() || isDataExtractionNotification();
}
}