Commit 4b66d629 authored by Andrea Clement's avatar Andrea Clement
Browse files

can post with boolean replaced by int

parent be4b9e74
Pipeline #30 passed with stage
in 7 minutes and 35 seconds
......@@ -45,7 +45,7 @@ class PostCreationActivity : AppCompatActivity() {
private var user: UserDatabaseEntity? = null
private var maxLength: Int = Instance.DEFAULT_MAX_TOOT_CHARS
private var isSensitive = false
private var isSensitive = 0
private var description: String = ""
......@@ -87,7 +87,7 @@ class PostCreationActivity : AppCompatActivity() {
// Listen to sensitive checkBox
findViewById<CheckBox>(R.id.checkSensitive).setOnClickListener {
isSensitive = !isSensitive
isSensitive = (isSensitive + 1) % 2
}
// get the description and send the post to PixelFed
......@@ -159,12 +159,15 @@ class PostCreationActivity : AppCompatActivity() {
private fun post(id: String) {
if (id.isEmpty()) return
pixelfedAPI.postStatus(
val post = pixelfedAPI.postStatus(
authorization = "Bearer $accessToken",
statusText = description,
media_ids = listOf(id),
sensitive = isSensitive
).enqueue(object: Callback<Status> {
)
Log.e(TAG, post.request().toString())
post.enqueue(object: Callback<Status> {
override fun onFailure(call: Call<Status>, t: Throwable) {
Toast.makeText(applicationContext,"Post upload failed",Toast.LENGTH_SHORT).show()
Log.e(TAG, t.message + call.request())
......
......@@ -98,7 +98,7 @@ interface PixelfedAPI {
@Field("poll[expires_in]") poll_expires : List<String>? = null,
@Field("poll[multiple]") poll_multiple : List<String>? = null,
@Field("poll[hide_totals]") poll_hideTotals : List<String>? = null,
@Field("sensitive") sensitive : Boolean? = null,
@Field("sensitive") sensitive : Int? = null,
@Field("spoiler_text") spoiler_text : String? = null,
@Field("visibility") visibility : String = "public",
@Field("scheduled_at") scheduled_at : String? = null,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment