mirror of
https://github.com/quik-sms/quik.git
synced 2026-11-17 19:38:52 +01:00
Add ScheduledMessage to realm schema
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
package com.moez.QKSMS.model
|
||||
|
||||
import io.realm.RealmList
|
||||
import io.realm.RealmObject
|
||||
import io.realm.annotations.PrimaryKey
|
||||
|
||||
open class ScheduledMessage(
|
||||
@PrimaryKey var id: Long = 0,
|
||||
var date: Long = 0,
|
||||
var recipients: RealmList<String> = RealmList(),
|
||||
var sendAsGroup: Boolean = true,
|
||||
var body: String = "",
|
||||
var attachments: RealmList<String> = RealmList()
|
||||
) : RealmObject()
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.moez.QKSMS.repository
|
||||
|
||||
import com.moez.QKSMS.model.ScheduledMessage
|
||||
import io.realm.RealmList
|
||||
import io.realm.RealmResults
|
||||
|
||||
interface ScheduledMessageRepository {
|
||||
|
||||
/**
|
||||
* Saves a scheduled message and returns the id if successful
|
||||
*/
|
||||
fun saveScheduledMessage(date: Long, recipients: RealmList<String>, sendAsGroup: Boolean, body: String,
|
||||
attachments: RealmList<String>): Long
|
||||
|
||||
/**
|
||||
* Returns all of the scheduled messages, sorted chronologically
|
||||
*/
|
||||
fun getScheduledMessages(): RealmResults<ScheduledMessage>
|
||||
|
||||
/**
|
||||
* Returns the scheduled message with the given [id]
|
||||
*/
|
||||
fun getScheduledMessage(id: Long): ScheduledMessage?
|
||||
|
||||
/**
|
||||
* Deletes the scheduled message with the given [id]
|
||||
*/
|
||||
fun deleteScheduledMessage(id: Long)
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user