mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-20 03:59:35 +01:00
Fix participants management UI
Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
parent
c1f9dd2ac5
commit
48c1505cb5
@ -594,23 +594,27 @@ class ConversationInfoController(args: Bundle) : BaseController(args), FlexibleA
|
|||||||
val userItem = adapter?.getItem(position) as UserItem
|
val userItem = adapter?.getItem(position) as UserItem
|
||||||
val participant = userItem.model
|
val participant = userItem.model
|
||||||
|
|
||||||
|
|
||||||
if (participant.userId != conversationUser!!.userId) {
|
if (participant.userId != conversationUser!!.userId) {
|
||||||
val items = mutableListOf(
|
var items = mutableListOf(
|
||||||
BasicListItemWithImage(R.drawable.ic_pencil_grey600_24dp, context.getString(R.string.nc_promote)),
|
BasicListItemWithImage(R.drawable.ic_pencil_grey600_24dp, context.getString(R.string.nc_promote)),
|
||||||
BasicListItemWithImage(R.drawable.ic_pencil_grey600_24dp, context.getString(R.string.nc_demote)),
|
BasicListItemWithImage(R.drawable.ic_pencil_grey600_24dp, context.getString(R.string.nc_demote)),
|
||||||
BasicListItemWithImage(R.drawable.ic_delete_grey600_24dp, context.getString(R.string.nc_remove_participant))
|
BasicListItemWithImage(R.drawable.ic_delete_grey600_24dp,
|
||||||
|
context.getString(R.string.nc_remove_participant))
|
||||||
)
|
)
|
||||||
|
|
||||||
if (participant.type == Participant.ParticipantType.MODERATOR) {
|
if (!conversation!!.canModerate(conversationUser)) {
|
||||||
|
items = mutableListOf()
|
||||||
|
} else {
|
||||||
|
if (participant.type == Participant.ParticipantType.MODERATOR || participant.type == Participant.ParticipantType.OWNER) {
|
||||||
items.removeAt(0)
|
items.removeAt(0)
|
||||||
} else if (participant.type == Participant.ParticipantType.USER) {
|
} else if (participant.type == Participant.ParticipantType.USER) {
|
||||||
items.removeAt(1)
|
items.removeAt(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!conversation!!.canModerate(conversationUser)) {
|
|
||||||
items.removeAt(1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (items.isNotEmpty()) {
|
||||||
MaterialDialog(activity!!, BottomSheet(WRAP_CONTENT)).show {
|
MaterialDialog(activity!!, BottomSheet(WRAP_CONTENT)).show {
|
||||||
cornerRadius(res = R.dimen.corner_radius)
|
cornerRadius(res = R.dimen.corner_radius)
|
||||||
|
|
||||||
@ -656,6 +660,7 @@ class ConversationInfoController(args: Bundle) : BaseController(args), FlexibleA
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user