mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-07-13 17:51:57 +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\""
|
buildConfigField "String", "TESTING_LEVEL", "\"production\""
|
||||||
multiDexEnabled true
|
multiDexEnabled true
|
||||||
|
|
||||||
versionCode 2222
|
versionCode 2224
|
||||||
versionName "2.1"
|
versionName "2.1"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.habitrpg.android.habitica.data.implementation
|
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.ApiClient
|
||||||
import com.habitrpg.android.habitica.data.SocialRepository
|
import com.habitrpg.android.habitica.data.SocialRepository
|
||||||
import com.habitrpg.android.habitica.data.local.SocialLocalRepository
|
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> {
|
override fun flagMessage(chatMessage: ChatMessage, additionalInfo: String): Flowable<Void> {
|
||||||
return if (chatMessage.id == "") {
|
return when {
|
||||||
Flowable.empty()
|
chatMessage.id == "" -> Flowable.empty()
|
||||||
} else {
|
userID == BuildConfig.ANDROID_TESTING_UUID -> Flowable.empty()
|
||||||
val data = mutableMapOf<String, String>()
|
else -> {
|
||||||
data["comment"] = additionalInfo
|
val data = mutableMapOf<String, String>()
|
||||||
apiClient.flagMessage(chatMessage.groupId ?: "", chatMessage.id, data)
|
data["comment"] = additionalInfo
|
||||||
|
apiClient.flagMessage(chatMessage.groupId ?: "", chatMessage.id, data)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,3 +14,4 @@ PORT=80
|
||||||
BASE_URL=https://habitica.com
|
BASE_URL=https://habitica.com
|
||||||
|
|
||||||
STAGING_KEY=
|
STAGING_KEY=
|
||||||
|
ANDROID_TESTING_UUID=
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
PORT=3000
|
PORT=3000
|
||||||
BASE_URL=http://localhost:3000
|
BASE_URL=http://localhost:3000
|
||||||
STAGING_KEY=
|
STAGING_KEY=
|
||||||
|
ANDROID_TESTING_UUID=
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue