mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-20 03:59:35 +01:00
rename user var to better reflect its type
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
f4cde24f8e
commit
80570e59b4
@ -51,15 +51,15 @@ import org.parceler.Parcels
|
|||||||
|
|
||||||
private const val TAG = "ProfileBottomSheet"
|
private const val TAG = "ProfileBottomSheet"
|
||||||
|
|
||||||
class ProfileBottomSheet(val ncApi: NcApi, val userEntity: User, val router: Router) {
|
class ProfileBottomSheet(val ncApi: NcApi, val userModel: User, val router: Router) {
|
||||||
|
|
||||||
private val allowedAppIds = listOf(SPREED.stringValue, PROFILE.stringValue, EMAIL.stringValue)
|
private val allowedAppIds = listOf(SPREED.stringValue, PROFILE.stringValue, EMAIL.stringValue)
|
||||||
|
|
||||||
fun showFor(user: String, context: Context) {
|
fun showFor(user: String, context: Context) {
|
||||||
|
|
||||||
ncApi.hoverCard(
|
ncApi.hoverCard(
|
||||||
ApiUtils.getCredentials(userEntity.username, userEntity.token),
|
ApiUtils.getCredentials(userModel.username, userModel.token),
|
||||||
ApiUtils.getUrlForHoverCard(userEntity.baseUrl, user)
|
ApiUtils.getUrlForHoverCard(userModel.baseUrl, user)
|
||||||
).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
|
).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribe(object : Observer<HoverCardOverall> {
|
.subscribe(object : Observer<HoverCardOverall> {
|
||||||
override fun onSubscribe(d: Disposable) {
|
override fun onSubscribe(d: Disposable) {
|
||||||
@ -68,7 +68,8 @@ class ProfileBottomSheet(val ncApi: NcApi, val userEntity: User, val router: Rou
|
|||||||
|
|
||||||
override fun onNext(hoverCardOverall: HoverCardOverall) {
|
override fun onNext(hoverCardOverall: HoverCardOverall) {
|
||||||
bottomSheet(
|
bottomSheet(
|
||||||
hoverCardOverall.ocs!!.data!!.actions!!, hoverCardOverall.ocs!!.data!!.displayName!!,
|
hoverCardOverall.ocs!!.data!!.actions!!,
|
||||||
|
hoverCardOverall.ocs!!.data!!.displayName!!,
|
||||||
user,
|
user,
|
||||||
context
|
context
|
||||||
)
|
)
|
||||||
@ -124,16 +125,16 @@ class ProfileBottomSheet(val ncApi: NcApi, val userEntity: User, val router: Rou
|
|||||||
private fun talkTo(userId: String) {
|
private fun talkTo(userId: String) {
|
||||||
|
|
||||||
val apiVersion =
|
val apiVersion =
|
||||||
ApiUtils.getConversationApiVersion(userEntity, intArrayOf(ApiUtils.APIv4, 1))
|
ApiUtils.getConversationApiVersion(userModel, intArrayOf(ApiUtils.APIv4, 1))
|
||||||
val retrofitBucket = ApiUtils.getRetrofitBucketForCreateRoom(
|
val retrofitBucket = ApiUtils.getRetrofitBucketForCreateRoom(
|
||||||
apiVersion,
|
apiVersion,
|
||||||
userEntity.baseUrl,
|
userModel.baseUrl,
|
||||||
"1",
|
"1",
|
||||||
null,
|
null,
|
||||||
userId,
|
userId,
|
||||||
null
|
null
|
||||||
)
|
)
|
||||||
val credentials = ApiUtils.getCredentials(userEntity.username, userEntity.token)
|
val credentials = ApiUtils.getCredentials(userModel.username, userModel.token)
|
||||||
ncApi.createRoom(
|
ncApi.createRoom(
|
||||||
credentials,
|
credentials,
|
||||||
retrofitBucket.url, retrofitBucket.queryMap
|
retrofitBucket.url, retrofitBucket.queryMap
|
||||||
@ -147,7 +148,7 @@ class ProfileBottomSheet(val ncApi: NcApi, val userEntity: User, val router: Rou
|
|||||||
|
|
||||||
override fun onNext(roomOverall: RoomOverall) {
|
override fun onNext(roomOverall: RoomOverall) {
|
||||||
val bundle = Bundle()
|
val bundle = Bundle()
|
||||||
bundle.putParcelable(BundleKeys.KEY_USER_ENTITY, userEntity)
|
bundle.putParcelable(BundleKeys.KEY_USER_ENTITY, userModel)
|
||||||
bundle.putString(BundleKeys.KEY_ROOM_TOKEN, roomOverall.ocs!!.data!!.token)
|
bundle.putString(BundleKeys.KEY_ROOM_TOKEN, roomOverall.ocs!!.data!!.token)
|
||||||
bundle.putString(BundleKeys.KEY_ROOM_ID, roomOverall.ocs!!.data!!.roomId)
|
bundle.putString(BundleKeys.KEY_ROOM_ID, roomOverall.ocs!!.data!!.roomId)
|
||||||
|
|
||||||
@ -155,7 +156,7 @@ class ProfileBottomSheet(val ncApi: NcApi, val userEntity: User, val router: Rou
|
|||||||
ncApi.getRoom(
|
ncApi.getRoom(
|
||||||
credentials,
|
credentials,
|
||||||
ApiUtils.getUrlForRoom(
|
ApiUtils.getUrlForRoom(
|
||||||
apiVersion, userEntity.baseUrl,
|
apiVersion, userModel.baseUrl,
|
||||||
roomOverall.ocs!!.data!!.token
|
roomOverall.ocs!!.data!!.token
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@ -172,7 +173,7 @@ class ProfileBottomSheet(val ncApi: NcApi, val userEntity: User, val router: Rou
|
|||||||
Parcels.wrap(roomOverall.ocs!!.data)
|
Parcels.wrap(roomOverall.ocs!!.data)
|
||||||
)
|
)
|
||||||
ConductorRemapping.remapChatController(
|
ConductorRemapping.remapChatController(
|
||||||
router, userEntity.id!!,
|
router, userModel.id!!,
|
||||||
roomOverall.ocs!!.data!!.token!!, bundle, true
|
roomOverall.ocs!!.data!!.token!!, bundle, true
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user