Minor code consistency change

This commit is contained in:
Naveen 2022-11-18 01:45:17 +05:30
parent 9fbf6fa581
commit 89f378b973
3 changed files with 16 additions and 14 deletions

View file

@ -18,17 +18,19 @@ data class Conversation(
@ColumnInfo(name = "is_scheduled") var isScheduled: Boolean = false
) {
fun areItemsTheSame(other: Conversation): Boolean {
return threadId == other.threadId
}
companion object {
fun areItemsTheSame(old: Conversation, new: Conversation): Boolean {
return old.threadId == new.threadId
}
fun areContentsTheSame(other: Conversation): Boolean {
return snippet == other.snippet &&
date == other.date &&
read == other.read &&
title == other.title &&
photoUri == other.photoUri &&
isGroupConversation == other.isGroupConversation &&
phoneNumber == other.phoneNumber
fun areContentsTheSame(old: Conversation, new: Conversation): Boolean {
return old.snippet == new.snippet &&
old.date == new.date &&
old.read == new.read &&
old.title == new.title &&
old.photoUri == new.photoUri &&
old.isGroupConversation == new.isGroupConversation &&
old.phoneNumber == new.phoneNumber
}
}
}