Files
baresip-studio/app/src/main/kotlin/com/tutpro/baresip/CallHistory.kt
T
Juha Heinanen 289faa0793 - fixed callee completion from contacts
- moved restoring of call and message history from baresip service to
  main activity
- small cleanups
2018-10-26 12:04:48 +03:00

39 lines
1005 B
Kotlin

package com.tutpro.baresip
import java.io.Serializable
import java.util.GregorianCalendar
class CallHistory(val aor: String, val peerURI: String, val direction: String,
val connected: Boolean) : Serializable {
val time: GregorianCalendar = GregorianCalendar()
companion object {
fun aorHistory(history: ArrayList<CallHistory>, aor: String): Int {
var size = 0;
for (h in history) {
if (h.aor == aor) size++
}
return size
}
fun aorRemoveHistory(history: ArrayList<CallHistory>, aor: String) {
for (h in history) {
if (h.aor == aor) {
history.remove(h)
return
}
}
}
fun aorLatestHistory(history: ArrayList<CallHistory>, aor: String): CallHistory? {
for (h in history.reversed())
if (h.aor == aor) return h
return null
}
}
}