mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-20 12:09:45 +01:00
Fix key name to upload conversation avatars
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
fdb845d298
commit
0063fa8c10
@ -230,12 +230,12 @@ class ConversationInfoActivity :
|
|||||||
val builder = MultipartBody.Builder()
|
val builder = MultipartBody.Builder()
|
||||||
builder.setType(MultipartBody.FORM)
|
builder.setType(MultipartBody.FORM)
|
||||||
builder.addFormDataPart(
|
builder.addFormDataPart(
|
||||||
"files[]",
|
"file",
|
||||||
file!!.name,
|
file!!.name,
|
||||||
file.asRequestBody(Mimetype.IMAGE_PREFIX_GENERIC.toMediaTypeOrNull())
|
file.asRequestBody(Mimetype.IMAGE_PREFIX_GENERIC.toMediaTypeOrNull())
|
||||||
)
|
)
|
||||||
val filePart: MultipartBody.Part = MultipartBody.Part.createFormData(
|
val filePart: MultipartBody.Part = MultipartBody.Part.createFormData(
|
||||||
"files[]",
|
"file",
|
||||||
file.name,
|
file.name,
|
||||||
file.asRequestBody(Mimetype.IMAGE_JPG.toMediaTypeOrNull())
|
file.asRequestBody(Mimetype.IMAGE_JPG.toMediaTypeOrNull())
|
||||||
)
|
)
|
||||||
@ -243,7 +243,7 @@ class ConversationInfoActivity :
|
|||||||
// upload file
|
// upload file
|
||||||
ncApi.uploadAvatar(
|
ncApi.uploadAvatar(
|
||||||
ApiUtils.getCredentials(conversationUser.username, conversationUser.token),
|
ApiUtils.getCredentials(conversationUser.username, conversationUser.token),
|
||||||
ApiUtils.getUrlForConversationAvatar(1,conversationUser.baseUrl, conversation!!.token),
|
ApiUtils.getUrlForConversationAvatar(1, conversationUser.baseUrl, conversation!!.token),
|
||||||
filePart
|
filePart
|
||||||
)
|
)
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
@ -261,8 +261,7 @@ class ConversationInfoActivity :
|
|||||||
Toast.makeText(
|
Toast.makeText(
|
||||||
applicationContext,
|
applicationContext,
|
||||||
context.getString(R.string.default_error_msg),
|
context.getString(R.string.default_error_msg),
|
||||||
Toast
|
Toast.LENGTH_LONG
|
||||||
.LENGTH_LONG
|
|
||||||
).show()
|
).show()
|
||||||
Log.e(TAG, "Error uploading avatar", e)
|
Log.e(TAG, "Error uploading avatar", e)
|
||||||
}
|
}
|
||||||
|
@ -162,10 +162,8 @@ class PickImage(
|
|||||||
if (resultCode != Activity.RESULT_OK) {
|
if (resultCode != Activity.RESULT_OK) {
|
||||||
Log.w(
|
Log.w(
|
||||||
TAG,
|
TAG,
|
||||||
"Check result code before calling 'PickImage#handleActivtyResult'. It should be ${
|
"Check result code before calling " +
|
||||||
Activity
|
"'PickImage#handleActivtyResult'. It should be ${Activity.RESULT_OK}, but it is $resultCode!"
|
||||||
.RESULT_OK
|
|
||||||
}, but it is $resultCode!"
|
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user