[2.15.0_merge_3.2.0]

This commit is contained in:
zhongchao
2023-05-08 11:21:15 +08:00
523 changed files with 6717 additions and 4571 deletions

View File

@@ -92,6 +92,22 @@ object DataManager {
}
}
fun delMsgTable(context: Context) {
if (Thread.currentThread() == Looper.getMainLooper().thread) {
scope.launch {
withContext(Dispatchers.Default) {
MsgBoxDb.getDb(context)
.monitorDao()
.deleteMsgTable()
}
}
} else {
MsgBoxDb.getDb(context)
.monitorDao()
.deleteMsgTable()
}
}
private fun realSaveMsg(msg: MsgBoxBean) {
val type = msg.type
msg.timestamp = System.currentTimeMillis()

View File

@@ -34,6 +34,10 @@ class MsgBoxProvider : IMsgBoxProvider {
DataManager.saveMsg(bean)
}
override fun delMsgTable(context: Context) {
DataManager.delMsgTable(context)
}
override fun getCachedNotifyData(): List<MsgBoxBean> {
return DataManager.getNotifyData()
}

View File

@@ -15,4 +15,7 @@ interface MsgBoxDao {
@Query("SELECT * FROM t_msg_box")
fun getAllCachedMessages(): List<MsgBoxInfo>
@Query("DELETE FROM t_msg_box")
fun deleteMsgTable()
}