mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-19 19:49:33 +01:00
remove api v1 variants for conversations canLeave and canDelete methods
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
aedede9ffd
commit
d76203a093
@ -598,13 +598,13 @@ class ConversationInfoController(args: Bundle) :
|
||||
|
||||
setupWebinaryView()
|
||||
|
||||
if (!conversation!!.canLeave(conversationUser)) {
|
||||
if (!conversation!!.canLeave()) {
|
||||
binding.leaveConversationAction.visibility = View.GONE
|
||||
} else {
|
||||
binding.leaveConversationAction.visibility = View.VISIBLE
|
||||
}
|
||||
|
||||
if (!conversation!!.canDelete(conversationUser)) {
|
||||
if (!conversation!!.canDelete()) {
|
||||
binding.deleteConversationAction.visibility = View.GONE
|
||||
} else {
|
||||
binding.deleteConversationAction.visibility = View.VISIBLE
|
||||
|
@ -148,23 +148,12 @@ public class Conversation {
|
||||
return (canModerate(conversationUser) && !ConversationType.ROOM_TYPE_ONE_TO_ONE_CALL.equals(type));
|
||||
}
|
||||
|
||||
public boolean canLeave(UserEntity conversationUser) {
|
||||
if (canLeaveConversation != null) {
|
||||
// Available since APIv2
|
||||
return canLeaveConversation;
|
||||
}
|
||||
// Fallback for APIv1
|
||||
return !canModerate(conversationUser) ||
|
||||
(getType() != ConversationType.ROOM_TYPE_ONE_TO_ONE_CALL && this.participants.size() > 1);
|
||||
public boolean canLeave() {
|
||||
return canLeaveConversation;
|
||||
}
|
||||
|
||||
public boolean canDelete(UserEntity conversationUser) {
|
||||
if (canDeleteConversation != null) {
|
||||
// Available since APIv2
|
||||
return canDeleteConversation;
|
||||
}
|
||||
// Fallback for APIv1
|
||||
return canModerate(conversationUser);
|
||||
public boolean canDelete() {
|
||||
return canDeleteConversation;
|
||||
}
|
||||
|
||||
public String getRoomId() {
|
||||
|
@ -123,7 +123,7 @@ class ConversationOperationDialog(
|
||||
)
|
||||
|
||||
binding.conversationOperationLeave.visibility = setVisibleIf(
|
||||
conversation.canLeave(currentUser)
|
||||
conversation.canLeave()
|
||||
)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user