mirror of
https://github.com/nextcloud/talk-android
synced 2025-03-06 22:29:09 +00: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()
|
||||
builder.setType(MultipartBody.FORM)
|
||||
builder.addFormDataPart(
|
||||
"files[]",
|
||||
"file",
|
||||
file!!.name,
|
||||
file.asRequestBody(Mimetype.IMAGE_PREFIX_GENERIC.toMediaTypeOrNull())
|
||||
)
|
||||
val filePart: MultipartBody.Part = MultipartBody.Part.createFormData(
|
||||
"files[]",
|
||||
"file",
|
||||
file.name,
|
||||
file.asRequestBody(Mimetype.IMAGE_JPG.toMediaTypeOrNull())
|
||||
)
|
||||
@ -243,7 +243,7 @@ class ConversationInfoActivity :
|
||||
// upload file
|
||||
ncApi.uploadAvatar(
|
||||
ApiUtils.getCredentials(conversationUser.username, conversationUser.token),
|
||||
ApiUtils.getUrlForConversationAvatar(1,conversationUser.baseUrl, conversation!!.token),
|
||||
ApiUtils.getUrlForConversationAvatar(1, conversationUser.baseUrl, conversation!!.token),
|
||||
filePart
|
||||
)
|
||||
.subscribeOn(Schedulers.io())
|
||||
@ -261,8 +261,7 @@ class ConversationInfoActivity :
|
||||
Toast.makeText(
|
||||
applicationContext,
|
||||
context.getString(R.string.default_error_msg),
|
||||
Toast
|
||||
.LENGTH_LONG
|
||||
Toast.LENGTH_LONG
|
||||
).show()
|
||||
Log.e(TAG, "Error uploading avatar", e)
|
||||
}
|
||||
|
@ -162,10 +162,8 @@ class PickImage(
|
||||
if (resultCode != Activity.RESULT_OK) {
|
||||
Log.w(
|
||||
TAG,
|
||||
"Check result code before calling 'PickImage#handleActivtyResult'. It should be ${
|
||||
Activity
|
||||
.RESULT_OK
|
||||
}, but it is $resultCode!"
|
||||
"Check result code before calling " +
|
||||
"'PickImage#handleActivtyResult'. It should be ${Activity.RESULT_OK}, but it is $resultCode!"
|
||||
)
|
||||
return
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user