mirror of
https://github.com/nextcloud/talk-android
synced 2025-02-02 20:53:09 +00:00
fix klint warnings
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
b603031011
commit
be29459955
@ -1177,9 +1177,9 @@ class ChatController(args: Bundle) :
|
|||||||
|
|
||||||
private fun checkShowMessageInputView() {
|
private fun checkShowMessageInputView() {
|
||||||
if (isAlive()) {
|
if (isAlive()) {
|
||||||
if (isReadOnlyConversation()
|
if (isReadOnlyConversation() ||
|
||||||
|| shouldShowLobby()
|
shouldShowLobby() ||
|
||||||
|| !hasChatPermission
|
!hasChatPermission
|
||||||
) {
|
) {
|
||||||
binding.messageInputView.visibility = View.GONE
|
binding.messageInputView.visibility = View.GONE
|
||||||
} else {
|
} else {
|
||||||
@ -2534,7 +2534,8 @@ class ChatController(args: Bundle) :
|
|||||||
fun deleteMessage(message: IMessage?) {
|
fun deleteMessage(message: IMessage?) {
|
||||||
if (!hasChatPermission) {
|
if (!hasChatPermission) {
|
||||||
Log.e(
|
Log.e(
|
||||||
TAG, "Deletion of message is skipped because of restrictions by permissions. " +
|
TAG,
|
||||||
|
"Deletion of message is skipped because of restrictions by permissions. " +
|
||||||
"This method should not have been called!"
|
"This method should not have been called!"
|
||||||
)
|
)
|
||||||
Toast.makeText(context, R.string.nc_common_error_sorry, Toast.LENGTH_LONG).show()
|
Toast.makeText(context, R.string.nc_common_error_sorry, Toast.LENGTH_LONG).show()
|
||||||
|
@ -1,3 +1,23 @@
|
|||||||
|
/*
|
||||||
|
* Nextcloud Talk application
|
||||||
|
*
|
||||||
|
* @author Marcel Hibbe
|
||||||
|
* Copyright (C) 2022 Marcel Hibbe <dev@mhibbe.de>
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
package com.nextcloud.talk.utils
|
package com.nextcloud.talk.utils
|
||||||
|
|
||||||
import com.nextcloud.talk.models.database.CapabilitiesUtil
|
import com.nextcloud.talk.models.database.CapabilitiesUtil
|
||||||
|
@ -1,3 +1,23 @@
|
|||||||
|
/*
|
||||||
|
* Nextcloud Talk application
|
||||||
|
*
|
||||||
|
* @author Marcel Hibbe
|
||||||
|
* Copyright (C) 2022 Marcel Hibbe <dev@mhibbe.de>
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
package com.nextcloud.talk.utils
|
package com.nextcloud.talk.utils
|
||||||
|
|
||||||
import junit.framework.TestCase
|
import junit.framework.TestCase
|
||||||
@ -7,22 +27,21 @@ class AttendeePermissionsUtilTest : TestCase() {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun test_areFlagsSet() {
|
fun test_areFlagsSet() {
|
||||||
val attendeePermissionsUtil = AttendeePermissionsUtil(
|
val attendeePermissionsUtil =
|
||||||
AttendeePermissionsUtil.PUBLISH_SCREEN
|
AttendeePermissionsUtil(
|
||||||
or AttendeePermissionsUtil.JOIN_CALL
|
AttendeePermissionsUtil.PUBLISH_SCREEN or
|
||||||
or AttendeePermissionsUtil.DEFAULT)
|
AttendeePermissionsUtil.JOIN_CALL or
|
||||||
|
AttendeePermissionsUtil.DEFAULT
|
||||||
|
)
|
||||||
|
|
||||||
assert(attendeePermissionsUtil.canPublishScreen)
|
assert(attendeePermissionsUtil.canPublishScreen)
|
||||||
assert(attendeePermissionsUtil.canJoinCall)
|
assert(attendeePermissionsUtil.canJoinCall)
|
||||||
assert(attendeePermissionsUtil.isDefault) // if AttendeePermissionsUtil.DEFAULT is not set with setFlags and
|
assert(attendeePermissionsUtil.isDefault)
|
||||||
// checked with assertFalse, the logic fails somehow?!
|
|
||||||
|
|
||||||
assertFalse(attendeePermissionsUtil.isCustom)
|
assertFalse(attendeePermissionsUtil.isCustom)
|
||||||
assertFalse(attendeePermissionsUtil.canStartCall)
|
assertFalse(attendeePermissionsUtil.canStartCall)
|
||||||
assertFalse(attendeePermissionsUtil.canIgnoreLobby)
|
assertFalse(attendeePermissionsUtil.canIgnoreLobby)
|
||||||
assertFalse(attendeePermissionsUtil.canPublishAudio)
|
assertFalse(attendeePermissionsUtil.canPublishAudio)
|
||||||
assertFalse(attendeePermissionsUtil.canPublishVideo)
|
assertFalse(attendeePermissionsUtil.canPublishVideo)
|
||||||
|
|
||||||
// hasChatPermission() is not possible to test because userEntity is necessary
|
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user