mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-04-14 11:46:32 +00:00
prevent android test user from flagging posts
This commit is contained in:
parent
6dc5452f6e
commit
f269f41a4e
4 changed files with 12 additions and 7 deletions
|
|
@ -152,7 +152,7 @@ android {
|
|||
buildConfigField "String", "TESTING_LEVEL", "\"production\""
|
||||
multiDexEnabled true
|
||||
|
||||
versionCode 2222
|
||||
versionCode 2224
|
||||
versionName "2.1"
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.habitrpg.android.habitica.data.implementation
|
||||
|
||||
import com.habitrpg.android.habitica.BuildConfig
|
||||
import com.habitrpg.android.habitica.data.ApiClient
|
||||
import com.habitrpg.android.habitica.data.SocialRepository
|
||||
import com.habitrpg.android.habitica.data.local.SocialLocalRepository
|
||||
|
|
@ -68,12 +69,14 @@ class SocialRepositoryImpl(localRepository: SocialLocalRepository, apiClient: Ap
|
|||
}
|
||||
|
||||
override fun flagMessage(chatMessage: ChatMessage, additionalInfo: String): Flowable<Void> {
|
||||
return if (chatMessage.id == "") {
|
||||
Flowable.empty()
|
||||
} else {
|
||||
val data = mutableMapOf<String, String>()
|
||||
data["comment"] = additionalInfo
|
||||
apiClient.flagMessage(chatMessage.groupId ?: "", chatMessage.id, data)
|
||||
return when {
|
||||
chatMessage.id == "" -> Flowable.empty()
|
||||
userID == BuildConfig.ANDROID_TESTING_UUID -> Flowable.empty()
|
||||
else -> {
|
||||
val data = mutableMapOf<String, String>()
|
||||
data["comment"] = additionalInfo
|
||||
apiClient.flagMessage(chatMessage.groupId ?: "", chatMessage.id, data)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,3 +14,4 @@ PORT=80
|
|||
BASE_URL=https://habitica.com
|
||||
|
||||
STAGING_KEY=
|
||||
ANDROID_TESTING_UUID=
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
PORT=3000
|
||||
BASE_URL=http://localhost:3000
|
||||
STAGING_KEY=
|
||||
ANDROID_TESTING_UUID=
|
||||
|
|
|
|||
Loading…
Reference in a new issue