forked from NdoleStudio/httpsms
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReceiver.kt
More file actions
25 lines (20 loc) · 724 Bytes
/
Receiver.kt
File metadata and controls
25 lines (20 loc) · 724 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package com.httpsms
import android.content.Context
import timber.log.Timber
object Receiver {
fun isValid(context: Context, messageId: String?): Boolean {
if (messageId == null) {
Timber.e("cannot handle event because the message ID is null")
return false
}
if (!Settings.isLoggedIn(context)) {
Timber.w("cannot handle message with id [$messageId] because the user is not logged in")
return false
}
if (!Settings.getActiveStatus(context)) {
Timber.w("cannot handle message with id [$messageId] because the user is not active")
return false
}
return true
}
}