mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-21 04:29:45 +01:00
Merge pull request #1864 from nextcloud/bugfix/noid/detektImprovements
Detekt improvements
This commit is contained in:
commit
37b950d03d
@ -81,7 +81,9 @@ import javax.inject.Inject
|
|||||||
@SuppressLint("LongLogTag")
|
@SuppressLint("LongLogTag")
|
||||||
@AutoInjector(NextcloudTalkApplication::class)
|
@AutoInjector(NextcloudTalkApplication::class)
|
||||||
class MagicFirebaseMessagingService : FirebaseMessagingService() {
|
class MagicFirebaseMessagingService : FirebaseMessagingService() {
|
||||||
private val TAG = "MagicFirebaseMessagingService"
|
companion object {
|
||||||
|
const val TAG = "MagicFirebaseMessagingService"
|
||||||
|
}
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@Inject
|
@Inject
|
||||||
@ -147,6 +149,7 @@ class MagicFirebaseMessagingService : FirebaseMessagingService() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Suppress("Detekt.TooGenericExceptionCaught")
|
||||||
private fun decryptMessage(subject: String, signature: String) {
|
private fun decryptMessage(subject: String, signature: String) {
|
||||||
try {
|
try {
|
||||||
val base64DecodedSubject = Base64.decode(subject, Base64.DEFAULT)
|
val base64DecodedSubject = Base64.decode(subject, Base64.DEFAULT)
|
||||||
@ -283,6 +286,7 @@ class MagicFirebaseMessagingService : FirebaseMessagingService() {
|
|||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.subscribe(object : Observer<ParticipantsOverall> {
|
.subscribe(object : Observer<ParticipantsOverall> {
|
||||||
override fun onSubscribe(d: Disposable) {
|
override fun onSubscribe(d: Disposable) {
|
||||||
|
// unused atm
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onNext(participantsOverall: ParticipantsOverall) {
|
override fun onNext(participantsOverall: ParticipantsOverall) {
|
||||||
|
@ -52,9 +52,11 @@ class ClosedInterfaceImpl : ClosedInterface, ProviderInstaller.ProviderInstallLi
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onProviderInstalled() {
|
override fun onProviderInstalled() {
|
||||||
|
// unused atm
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onProviderInstallFailed(p0: Int, p1: Intent?) {
|
override fun onProviderInstallFailed(p0: Int, p1: Intent?) {
|
||||||
|
// unused atm
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun isGPlayServicesAvailable(): Boolean {
|
private fun isGPlayServicesAvailable(): Boolean {
|
||||||
|
@ -87,6 +87,7 @@ class MainActivity : BaseActivity(), ActionBarProvider {
|
|||||||
|
|
||||||
private var router: Router? = null
|
private var router: Router? = null
|
||||||
|
|
||||||
|
@Suppress("Detekt.TooGenericExceptionCaught")
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
Log.d(TAG, "onCreate: Activity: " + System.identityHashCode(this).toString())
|
Log.d(TAG, "onCreate: Activity: " + System.identityHashCode(this).toString())
|
||||||
|
|
||||||
|
@ -53,6 +53,7 @@ import com.nextcloud.talk.models.json.chat.ChatMessage
|
|||||||
import com.nextcloud.talk.ui.bottom.sheet.ProfileBottomSheet
|
import com.nextcloud.talk.ui.bottom.sheet.ProfileBottomSheet
|
||||||
import com.nextcloud.talk.utils.ApiUtils
|
import com.nextcloud.talk.utils.ApiUtils
|
||||||
import com.nextcloud.talk.utils.DisplayUtils
|
import com.nextcloud.talk.utils.DisplayUtils
|
||||||
|
import com.nextcloud.talk.utils.UriUtils
|
||||||
import com.nextcloud.talk.utils.preferences.AppPreferences
|
import com.nextcloud.talk.utils.preferences.AppPreferences
|
||||||
import com.stfalcon.chatkit.messages.MessageHolders
|
import com.stfalcon.chatkit.messages.MessageHolders
|
||||||
import java.net.URLEncoder
|
import java.net.URLEncoder
|
||||||
@ -218,7 +219,7 @@ class IncomingLocationMessageViewHolder(incomingView: View, payload: Any) : Mess
|
|||||||
|
|
||||||
binding.webview.webViewClient = object : WebViewClient() {
|
binding.webview.webViewClient = object : WebViewClient() {
|
||||||
override fun shouldOverrideUrlLoading(view: WebView?, url: String?): Boolean {
|
override fun shouldOverrideUrlLoading(view: WebView?, url: String?): Boolean {
|
||||||
return if (url != null && (url.startsWith("http://") || url.startsWith("https://"))
|
return if (url != null && UriUtils.hasHttpProtocollPrefixed(url)
|
||||||
) {
|
) {
|
||||||
view?.context?.startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(url)))
|
view?.context?.startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(url)))
|
||||||
true
|
true
|
||||||
|
@ -47,6 +47,7 @@ import com.nextcloud.talk.models.json.chat.ChatMessage
|
|||||||
import com.nextcloud.talk.models.json.chat.ReadStatus
|
import com.nextcloud.talk.models.json.chat.ReadStatus
|
||||||
import com.nextcloud.talk.utils.ApiUtils
|
import com.nextcloud.talk.utils.ApiUtils
|
||||||
import com.nextcloud.talk.utils.DisplayUtils
|
import com.nextcloud.talk.utils.DisplayUtils
|
||||||
|
import com.nextcloud.talk.utils.UriUtils
|
||||||
import com.stfalcon.chatkit.messages.MessageHolders
|
import com.stfalcon.chatkit.messages.MessageHolders
|
||||||
import java.net.URLEncoder
|
import java.net.URLEncoder
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
@ -131,7 +132,7 @@ class OutcomingLocationMessageViewHolder(incomingView: View) : MessageHolders
|
|||||||
|
|
||||||
binding.webview.webViewClient = object : WebViewClient() {
|
binding.webview.webViewClient = object : WebViewClient() {
|
||||||
override fun shouldOverrideUrlLoading(view: WebView?, url: String?): Boolean {
|
override fun shouldOverrideUrlLoading(view: WebView?, url: String?): Boolean {
|
||||||
return if (url != null && (url.startsWith("http://") || url.startsWith("https://"))
|
return if (url != null && UriUtils.hasHttpProtocollPrefixed(url)
|
||||||
) {
|
) {
|
||||||
view?.context?.startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(url)))
|
view?.context?.startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(url)))
|
||||||
true
|
true
|
||||||
|
@ -48,6 +48,7 @@ import com.nextcloud.talk.models.json.generic.Status
|
|||||||
import com.nextcloud.talk.models.json.userprofile.UserProfileOverall
|
import com.nextcloud.talk.models.json.userprofile.UserProfileOverall
|
||||||
import com.nextcloud.talk.utils.ApiUtils
|
import com.nextcloud.talk.utils.ApiUtils
|
||||||
import com.nextcloud.talk.utils.ClosedInterfaceImpl
|
import com.nextcloud.talk.utils.ClosedInterfaceImpl
|
||||||
|
import com.nextcloud.talk.utils.UriUtils
|
||||||
import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_BASE_URL
|
import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_BASE_URL
|
||||||
import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_INTERNAL_USER_ID
|
import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_INTERNAL_USER_ID
|
||||||
import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_IS_ACCOUNT_IMPORT
|
import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_IS_ACCOUNT_IMPORT
|
||||||
@ -112,11 +113,10 @@ class AccountVerificationController(args: Bundle? = null) :
|
|||||||
|
|
||||||
actionBar?.hide()
|
actionBar?.hide()
|
||||||
|
|
||||||
if (isAccountImport &&
|
if (
|
||||||
!baseUrl!!.startsWith("http://") &&
|
isAccountImport &&
|
||||||
!baseUrl!!.startsWith("https://") ||
|
!UriUtils.hasHttpProtocollPrefixed(baseUrl!!) ||
|
||||||
!TextUtils.isEmpty(originalProtocol!!) &&
|
isSameProtocol(baseUrl!!, originalProtocol!!)
|
||||||
!baseUrl!!.startsWith(originalProtocol!!)
|
|
||||||
) {
|
) {
|
||||||
determineBaseUrlProtocol(true)
|
determineBaseUrlProtocol(true)
|
||||||
} else {
|
} else {
|
||||||
@ -124,6 +124,10 @@ class AccountVerificationController(args: Bundle? = null) :
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun isSameProtocol(baseUrl: String, originalProtocol: String): Boolean {
|
||||||
|
return !TextUtils.isEmpty(originalProtocol) && !baseUrl.startsWith(originalProtocol)
|
||||||
|
}
|
||||||
|
|
||||||
private fun checkEverything() {
|
private fun checkEverything() {
|
||||||
val credentials = ApiUtils.getCredentials(username, token)
|
val credentials = ApiUtils.getCredentials(username, token)
|
||||||
cookieManager.cookieStore.removeAll()
|
cookieManager.cookieStore.removeAll()
|
||||||
@ -176,7 +180,9 @@ class AccountVerificationController(args: Bundle? = null) :
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onComplete() {}
|
override fun onComplete() {
|
||||||
|
// unused atm
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -231,7 +237,9 @@ class AccountVerificationController(args: Bundle? = null) :
|
|||||||
abortVerification()
|
abortVerification()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onComplete() {}
|
override fun onComplete() {
|
||||||
|
// unused atm
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -275,7 +283,9 @@ class AccountVerificationController(args: Bundle? = null) :
|
|||||||
abortVerification()
|
abortVerification()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onComplete() {}
|
override fun onComplete() {
|
||||||
|
// unused atm
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -328,7 +338,9 @@ class AccountVerificationController(args: Bundle? = null) :
|
|||||||
abortVerification()
|
abortVerification()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onComplete() {}
|
override fun onComplete() {
|
||||||
|
// unused atm
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -457,12 +469,16 @@ class AccountVerificationController(args: Bundle? = null) :
|
|||||||
if (!isAccountImport) {
|
if (!isAccountImport) {
|
||||||
if (internalAccountId != -1L) {
|
if (internalAccountId != -1L) {
|
||||||
userUtils.deleteUserWithId(internalAccountId).subscribe(object : CompletableObserver {
|
userUtils.deleteUserWithId(internalAccountId).subscribe(object : CompletableObserver {
|
||||||
override fun onSubscribe(d: Disposable) {}
|
override fun onSubscribe(d: Disposable) {
|
||||||
|
// unused atm
|
||||||
|
}
|
||||||
override fun onComplete() {
|
override fun onComplete() {
|
||||||
activity?.runOnUiThread { Handler().postDelayed({ router.popToRoot() }, 7500) }
|
activity?.runOnUiThread { Handler().postDelayed({ router.popToRoot() }, 7500) }
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onError(e: Throwable) {}
|
override fun onError(e: Throwable) {
|
||||||
|
// unused atm
|
||||||
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
activity?.runOnUiThread { Handler().postDelayed({ router.popToRoot() }, 7500) }
|
activity?.runOnUiThread { Handler().postDelayed({ router.popToRoot() }, 7500) }
|
||||||
|
@ -433,7 +433,9 @@ class ChatController(args: Bundle) :
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onFailureImpl(dataSource: DataSource<CloseableReference<CloseableImage>>) {}
|
override fun onFailureImpl(dataSource: DataSource<CloseableReference<CloseableImage>>) {
|
||||||
|
// unused atm
|
||||||
|
}
|
||||||
},
|
},
|
||||||
UiThreadImmediateExecutorService.getInstance()
|
UiThreadImmediateExecutorService.getInstance()
|
||||||
)
|
)
|
||||||
@ -630,6 +632,7 @@ class ChatController(args: Bundle) :
|
|||||||
|
|
||||||
binding.messageInputView.inputEditText?.addTextChangedListener(object : TextWatcher {
|
binding.messageInputView.inputEditText?.addTextChangedListener(object : TextWatcher {
|
||||||
override fun beforeTextChanged(s: CharSequence, start: Int, count: Int, after: Int) {
|
override fun beforeTextChanged(s: CharSequence, start: Int, count: Int, after: Int) {
|
||||||
|
// unused atm
|
||||||
}
|
}
|
||||||
|
|
||||||
@Suppress("Detekt.TooGenericExceptionCaught")
|
@Suppress("Detekt.TooGenericExceptionCaught")
|
||||||
@ -1602,12 +1605,7 @@ class ChatController(args: Bundle) :
|
|||||||
activity?.findViewById<View>(R.id.toolbar)?.setOnClickListener(null)
|
activity?.findViewById<View>(R.id.toolbar)?.setOnClickListener(null)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (conversationUser != null &&
|
if (conversationUser != null && isActivityNotChangingConfigurations() && isNotInCall()) {
|
||||||
activity != null &&
|
|
||||||
!activity?.isChangingConfigurations!! &&
|
|
||||||
!ApplicationWideCurrentRoomHolder.getInstance().isInCall &&
|
|
||||||
!ApplicationWideCurrentRoomHolder.getInstance().isDialing
|
|
||||||
) {
|
|
||||||
ApplicationWideCurrentRoomHolder.getInstance().clear()
|
ApplicationWideCurrentRoomHolder.getInstance().clear()
|
||||||
if (inConversation && validSessionId()) {
|
if (inConversation && validSessionId()) {
|
||||||
leaveRoom()
|
leaveRoom()
|
||||||
@ -1619,6 +1617,15 @@ class ChatController(args: Bundle) :
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun isActivityNotChangingConfigurations(): Boolean {
|
||||||
|
return activity != null && !activity?.isChangingConfigurations!!
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun isNotInCall(): Boolean {
|
||||||
|
return !ApplicationWideCurrentRoomHolder.getInstance().isInCall &&
|
||||||
|
!ApplicationWideCurrentRoomHolder.getInstance().isDialing
|
||||||
|
}
|
||||||
|
|
||||||
override val title: String
|
override val title: String
|
||||||
get() =
|
get() =
|
||||||
if (currentConversation?.displayName != null) {
|
if (currentConversation?.displayName != null) {
|
||||||
@ -2115,11 +2122,9 @@ class ChatController(args: Bundle) :
|
|||||||
|
|
||||||
for (i in chatMessageList.indices) {
|
for (i in chatMessageList.indices) {
|
||||||
if (chatMessageList.size > i + 1) {
|
if (chatMessageList.size > i + 1) {
|
||||||
if (TextUtils.isEmpty(chatMessageList[i].systemMessage) &&
|
if (isSameDayNonSystemMessages(chatMessageList[i], chatMessageList[i + 1]) &&
|
||||||
TextUtils.isEmpty(chatMessageList[i + 1].systemMessage) &&
|
|
||||||
chatMessageList[i + 1].actorId == chatMessageList[i].actorId &&
|
chatMessageList[i + 1].actorId == chatMessageList[i].actorId &&
|
||||||
countGroupedMessages < 4 &&
|
countGroupedMessages < 4
|
||||||
DateFormatter.isSameDay(chatMessageList[i].createdAt, chatMessageList[i + 1].createdAt)
|
|
||||||
) {
|
) {
|
||||||
chatMessageList[i].isGrouped = true
|
chatMessageList[i].isGrouped = true
|
||||||
countGroupedMessages++
|
countGroupedMessages++
|
||||||
@ -2251,6 +2256,12 @@ class ChatController(args: Bundle) :
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun isSameDayNonSystemMessages(messageLeft: ChatMessage, messageRight: ChatMessage): Boolean {
|
||||||
|
return TextUtils.isEmpty(messageLeft.systemMessage) &&
|
||||||
|
TextUtils.isEmpty(messageRight.systemMessage) &&
|
||||||
|
DateFormatter.isSameDay(messageLeft.createdAt, messageRight.createdAt)
|
||||||
|
}
|
||||||
|
|
||||||
override fun onLoadMore(page: Int, totalItemsCount: Int) {
|
override fun onLoadMore(page: Int, totalItemsCount: Int) {
|
||||||
if (!historyRead && inConversation) {
|
if (!historyRead && inConversation) {
|
||||||
pullChatMessages(0)
|
pullChatMessages(0)
|
||||||
|
@ -213,6 +213,7 @@ class LocationPickerController(args: Bundle) :
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Suppress("Detekt.TooGenericExceptionCaught")
|
||||||
private fun initMap() {
|
private fun initMap() {
|
||||||
binding.map.setTileSource(TileSourceFactory.MAPNIK)
|
binding.map.setTileSource(TileSourceFactory.MAPNIK)
|
||||||
binding.map.onResume()
|
binding.map.onResume()
|
||||||
|
@ -48,6 +48,7 @@ import com.nextcloud.talk.utils.AccountUtils.findAccounts
|
|||||||
import com.nextcloud.talk.utils.AccountUtils.getAppNameBasedOnPackage
|
import com.nextcloud.talk.utils.AccountUtils.getAppNameBasedOnPackage
|
||||||
import com.nextcloud.talk.utils.ApiUtils
|
import com.nextcloud.talk.utils.ApiUtils
|
||||||
import com.nextcloud.talk.utils.DisplayUtils
|
import com.nextcloud.talk.utils.DisplayUtils
|
||||||
|
import com.nextcloud.talk.utils.UriUtils
|
||||||
import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_IS_ACCOUNT_IMPORT
|
import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_IS_ACCOUNT_IMPORT
|
||||||
import com.nextcloud.talk.utils.database.user.UserUtils
|
import com.nextcloud.talk.utils.database.user.UserUtils
|
||||||
import com.nextcloud.talk.utils.singletons.ApplicationWideMessageHolder
|
import com.nextcloud.talk.utils.singletons.ApplicationWideMessageHolder
|
||||||
@ -197,7 +198,7 @@ class ServerSelectionController : NewBaseController(R.layout.controller_server_s
|
|||||||
url = url.substring(0, url.length - 1)
|
url = url.substring(0, url.length - 1)
|
||||||
}
|
}
|
||||||
val queryUrl = url + ApiUtils.getUrlPostfixForStatus()
|
val queryUrl = url + ApiUtils.getUrlPostfixForStatus()
|
||||||
if (url.startsWith("http://") || url.startsWith("https://")) {
|
if (UriUtils.hasHttpProtocollPrefixed(url)) {
|
||||||
checkServer(queryUrl, false)
|
checkServer(queryUrl, false)
|
||||||
} else {
|
} else {
|
||||||
checkServer("https://$queryUrl", true)
|
checkServer("https://$queryUrl", true)
|
||||||
@ -212,9 +213,7 @@ class ServerSelectionController : NewBaseController(R.layout.controller_server_s
|
|||||||
val productName = resources!!.getString(R.string.nc_server_product_name)
|
val productName = resources!!.getString(R.string.nc_server_product_name)
|
||||||
val versionString: String = status.getVersion().substring(0, status.getVersion().indexOf("."))
|
val versionString: String = status.getVersion().substring(0, status.getVersion().indexOf("."))
|
||||||
val version: Int = versionString.toInt()
|
val version: Int = versionString.toInt()
|
||||||
if (status.isInstalled && !status.isMaintenance &&
|
if (isServerStatusQueryable(status) && version >= 13) {
|
||||||
!status.isNeedsUpgrade && version >= 13
|
|
||||||
) {
|
|
||||||
router.pushController(
|
router.pushController(
|
||||||
RouterTransaction.with(
|
RouterTransaction.with(
|
||||||
WebViewLoginController(
|
WebViewLoginController(
|
||||||
@ -284,6 +283,10 @@ class ServerSelectionController : NewBaseController(R.layout.controller_server_s
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun isServerStatusQueryable(status: Status): Boolean {
|
||||||
|
return status.isInstalled && !status.isMaintenance && !status.isNeedsUpgrade
|
||||||
|
}
|
||||||
|
|
||||||
private fun setErrorText(text: String) {
|
private fun setErrorText(text: String) {
|
||||||
binding.errorText.text = text
|
binding.errorText.text = text
|
||||||
binding.errorText.visibility = View.VISIBLE
|
binding.errorText.visibility = View.VISIBLE
|
||||||
|
@ -94,7 +94,9 @@ class SwitchAccountController(args: Bundle? = null) :
|
|||||||
null, java.lang.Boolean.TRUE, null, userEntity.id, null, null, null
|
null, java.lang.Boolean.TRUE, null, userEntity.id, null, null, null
|
||||||
)
|
)
|
||||||
.subscribe(object : Observer<UserEntity> {
|
.subscribe(object : Observer<UserEntity> {
|
||||||
override fun onSubscribe(d: Disposable) {}
|
override fun onSubscribe(d: Disposable) {
|
||||||
|
// unused atm
|
||||||
|
}
|
||||||
override fun onNext(userEntity: UserEntity) {
|
override fun onNext(userEntity: UserEntity) {
|
||||||
cookieManager.cookieStore.removeAll()
|
cookieManager.cookieStore.removeAll()
|
||||||
userUtils.disableAllUsersWithoutId(userEntity.id)
|
userUtils.disableAllUsersWithoutId(userEntity.id)
|
||||||
@ -103,8 +105,12 @@ class SwitchAccountController(args: Bundle? = null) :
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onError(e: Throwable) {}
|
override fun onError(e: Throwable) {
|
||||||
override fun onComplete() {}
|
// unused atm
|
||||||
|
}
|
||||||
|
override fun onComplete() {
|
||||||
|
// unused atm
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
true
|
true
|
||||||
|
@ -46,10 +46,12 @@ import com.nextcloud.talk.controllers.util.viewBinding
|
|||||||
import com.nextcloud.talk.databinding.ControllerEntryMenuBinding
|
import com.nextcloud.talk.databinding.ControllerEntryMenuBinding
|
||||||
import com.nextcloud.talk.models.json.conversations.Conversation
|
import com.nextcloud.talk.models.json.conversations.Conversation
|
||||||
import com.nextcloud.talk.utils.ShareUtils
|
import com.nextcloud.talk.utils.ShareUtils
|
||||||
|
import com.nextcloud.talk.utils.UriUtils
|
||||||
import com.nextcloud.talk.utils.bundle.BundleKeys
|
import com.nextcloud.talk.utils.bundle.BundleKeys
|
||||||
import com.nextcloud.talk.utils.database.user.UserUtils
|
import com.nextcloud.talk.utils.database.user.UserUtils
|
||||||
import com.nextcloud.talk.utils.singletons.ApplicationWideMessageHolder
|
import com.nextcloud.talk.utils.singletons.ApplicationWideMessageHolder
|
||||||
import com.vanniktech.emoji.EmojiPopup
|
import com.vanniktech.emoji.EmojiPopup
|
||||||
|
import okhttp3.internal.immutableListOf
|
||||||
import org.greenrobot.eventbus.EventBus
|
import org.greenrobot.eventbus.EventBus
|
||||||
import org.parceler.Parcels
|
import org.parceler.Parcels
|
||||||
import org.parceler.Parcels.unwrap
|
import org.parceler.Parcels.unwrap
|
||||||
@ -114,8 +116,14 @@ class EntryMenuController(args: Bundle) :
|
|||||||
}
|
}
|
||||||
|
|
||||||
binding.textEdit.addTextChangedListener(object : TextWatcher {
|
binding.textEdit.addTextChangedListener(object : TextWatcher {
|
||||||
override fun beforeTextChanged(s: CharSequence, start: Int, count: Int, after: Int) {}
|
override fun beforeTextChanged(s: CharSequence, start: Int, count: Int, after: Int) {
|
||||||
override fun onTextChanged(s: CharSequence, start: Int, before: Int, count: Int) {}
|
// unused atm
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onTextChanged(s: CharSequence, start: Int, before: Int, count: Int) {
|
||||||
|
// unused atm
|
||||||
|
}
|
||||||
|
|
||||||
override fun afterTextChanged(s: Editable) {
|
override fun afterTextChanged(s: Editable) {
|
||||||
if (!TextUtils.isEmpty(s)) {
|
if (!TextUtils.isEmpty(s)) {
|
||||||
if (operation === ConversationOperationEnum.OPS_CODE_RENAME_ROOM) {
|
if (operation === ConversationOperationEnum.OPS_CODE_RENAME_ROOM) {
|
||||||
@ -139,10 +147,7 @@ class EntryMenuController(args: Bundle) :
|
|||||||
}
|
}
|
||||||
binding.textInputLayout.isErrorEnabled = false
|
binding.textInputLayout.isErrorEnabled = false
|
||||||
} else if (
|
} else if (
|
||||||
(
|
UriUtils.hasHttpProtocollPrefixed(binding.textEdit.text.toString()) &&
|
||||||
binding.textEdit.text.toString().startsWith("http://") ||
|
|
||||||
binding.textEdit.text.toString().startsWith("https://")
|
|
||||||
) &&
|
|
||||||
binding.textEdit.text.toString().contains("/call/")
|
binding.textEdit.text.toString().contains("/call/")
|
||||||
) {
|
) {
|
||||||
if (!binding.okButton.isEnabled) {
|
if (!binding.okButton.isEnabled) {
|
||||||
@ -211,15 +216,12 @@ class EntryMenuController(args: Bundle) :
|
|||||||
else -> {
|
else -> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (operation === ConversationOperationEnum.OPS_CODE_JOIN_ROOM ||
|
if (PASSWORD_ENTRY_OPERATIONS.contains(operation)) {
|
||||||
operation === ConversationOperationEnum.OPS_CODE_CHANGE_PASSWORD ||
|
|
||||||
operation === ConversationOperationEnum.OPS_CODE_SET_PASSWORD ||
|
|
||||||
operation === ConversationOperationEnum.OPS_CODE_SHARE_LINK
|
|
||||||
) {
|
|
||||||
binding.textInputLayout.endIconMode = TextInputLayout.END_ICON_PASSWORD_TOGGLE
|
binding.textInputLayout.endIconMode = TextInputLayout.END_ICON_PASSWORD_TOGGLE
|
||||||
} else {
|
} else {
|
||||||
binding.textInputLayout.endIconMode = TextInputLayout.END_ICON_NONE
|
binding.textInputLayout.endIconMode = TextInputLayout.END_ICON_NONE
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.textInputLayout.hint = labelText
|
binding.textInputLayout.hint = labelText
|
||||||
binding.textInputLayout.requestFocus()
|
binding.textInputLayout.requestFocus()
|
||||||
|
|
||||||
@ -323,4 +325,14 @@ class EntryMenuController(args: Bundle) :
|
|||||||
packageName = args.getString(BundleKeys.KEY_APP_ITEM_PACKAGE_NAME, "")
|
packageName = args.getString(BundleKeys.KEY_APP_ITEM_PACKAGE_NAME, "")
|
||||||
callUrl = args.getString(BundleKeys.KEY_CALL_URL, "")
|
callUrl = args.getString(BundleKeys.KEY_CALL_URL, "")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
private val PASSWORD_ENTRY_OPERATIONS: List<ConversationOperationEnum> =
|
||||||
|
immutableListOf(
|
||||||
|
ConversationOperationEnum.OPS_CODE_JOIN_ROOM,
|
||||||
|
ConversationOperationEnum.OPS_CODE_CHANGE_PASSWORD,
|
||||||
|
ConversationOperationEnum.OPS_CODE_SET_PASSWORD,
|
||||||
|
ConversationOperationEnum.OPS_CODE_SHARE_LINK
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -129,9 +129,11 @@ class ContactAddressBookWorker(val context: Context, workerParameters: WorkerPar
|
|||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribe(object : Observer<ContactsByNumberOverall> {
|
.subscribe(object : Observer<ContactsByNumberOverall> {
|
||||||
override fun onComplete() {
|
override fun onComplete() {
|
||||||
|
// unused atm
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onSubscribe(d: Disposable) {
|
override fun onSubscribe(d: Disposable) {
|
||||||
|
// unused atm
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onNext(foundContacts: ContactsByNumberOverall) {
|
override fun onNext(foundContacts: ContactsByNumberOverall) {
|
||||||
|
@ -99,10 +99,18 @@ class UploadAndShareFilesWorker(val context: Context, workerParameters: WorkerPa
|
|||||||
checkNotNull(roomToken)
|
checkNotNull(roomToken)
|
||||||
|
|
||||||
for (index in sourcefiles.indices) {
|
for (index in sourcefiles.indices) {
|
||||||
val sourcefileUri = Uri.parse(sourcefiles[index])
|
val sourceFileUri = Uri.parse(sourcefiles[index])
|
||||||
val filename = UriUtils.getFileName(sourcefileUri, context)
|
uploadFile(
|
||||||
val requestBody = createRequestBody(sourcefileUri)
|
currentUser!!,
|
||||||
uploadFile(currentUser, ncTargetpath, filename, roomToken, requestBody, sourcefileUri, metaData)
|
UploadItem(
|
||||||
|
sourceFileUri,
|
||||||
|
UriUtils.getFileName(sourceFileUri, context),
|
||||||
|
createRequestBody(sourceFileUri)
|
||||||
|
),
|
||||||
|
ncTargetpath,
|
||||||
|
roomToken,
|
||||||
|
metaData
|
||||||
|
)
|
||||||
}
|
}
|
||||||
} catch (e: IllegalStateException) {
|
} catch (e: IllegalStateException) {
|
||||||
Log.e(javaClass.simpleName, "Something went wrong when trying to upload file", e)
|
Log.e(javaClass.simpleName, "Something went wrong when trying to upload file", e)
|
||||||
@ -114,6 +122,7 @@ class UploadAndShareFilesWorker(val context: Context, workerParameters: WorkerPa
|
|||||||
return Result.success()
|
return Result.success()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Suppress("Detekt.TooGenericExceptionCaught")
|
||||||
private fun createRequestBody(sourcefileUri: Uri): RequestBody? {
|
private fun createRequestBody(sourcefileUri: Uri): RequestBody? {
|
||||||
var requestBody: RequestBody? = null
|
var requestBody: RequestBody? = null
|
||||||
try {
|
try {
|
||||||
@ -129,34 +138,34 @@ class UploadAndShareFilesWorker(val context: Context, workerParameters: WorkerPa
|
|||||||
|
|
||||||
private fun uploadFile(
|
private fun uploadFile(
|
||||||
currentUser: UserEntity,
|
currentUser: UserEntity,
|
||||||
ncTargetpath: String?,
|
uploadItem: UploadItem,
|
||||||
filename: String,
|
ncTargetPath: String?,
|
||||||
roomToken: String?,
|
roomToken: String?,
|
||||||
requestBody: RequestBody?,
|
|
||||||
sourcefileUri: Uri,
|
|
||||||
metaData: String?
|
metaData: String?
|
||||||
) {
|
) {
|
||||||
ncApi.uploadFile(
|
ncApi.uploadFile(
|
||||||
ApiUtils.getCredentials(currentUser.username, currentUser.token),
|
ApiUtils.getCredentials(currentUser.username, currentUser.token),
|
||||||
ApiUtils.getUrlForFileUpload(currentUser.baseUrl, currentUser.userId, ncTargetpath, filename),
|
ApiUtils.getUrlForFileUpload(currentUser.baseUrl, currentUser.userId, ncTargetPath, uploadItem.fileName),
|
||||||
requestBody
|
uploadItem.requestBody
|
||||||
)
|
)
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribe(object : Observer<Response<GenericOverall>> {
|
.subscribe(object : Observer<Response<GenericOverall>> {
|
||||||
override fun onSubscribe(d: Disposable) {
|
override fun onSubscribe(d: Disposable) {
|
||||||
|
// unused atm
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onNext(t: Response<GenericOverall>) {
|
override fun onNext(t: Response<GenericOverall>) {
|
||||||
|
// unused atm
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onError(e: Throwable) {
|
override fun onError(e: Throwable) {
|
||||||
Log.e(TAG, "failed to upload file $filename")
|
Log.e(TAG, "failed to upload file ${uploadItem.fileName}")
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onComplete() {
|
override fun onComplete() {
|
||||||
shareFile(roomToken, currentUser, ncTargetpath, filename, metaData)
|
shareFile(roomToken, currentUser, ncTargetPath, uploadItem.fileName, metaData)
|
||||||
copyFileToCache(sourcefileUri, filename)
|
copyFileToCache(uploadItem.uri, uploadItem.fileName)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -271,4 +280,10 @@ class UploadAndShareFilesWorker(val context: Context, workerParameters: WorkerPa
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private data class UploadItem(
|
||||||
|
val uri: Uri,
|
||||||
|
val fileName: String,
|
||||||
|
val requestBody: RequestBody?,
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
@ -122,6 +122,7 @@ class SetStatusDialogFragment :
|
|||||||
.subscribe(object : Observer<ResponseBody> {
|
.subscribe(object : Observer<ResponseBody> {
|
||||||
|
|
||||||
override fun onSubscribe(d: Disposable) {
|
override fun onSubscribe(d: Disposable) {
|
||||||
|
// unused atm
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onNext(responseBody: ResponseBody) {
|
override fun onNext(responseBody: ResponseBody) {
|
||||||
@ -136,9 +137,12 @@ class SetStatusDialogFragment :
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onError(e: Throwable) {
|
override fun onError(e: Throwable) {
|
||||||
|
// unused atm
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onComplete() {}
|
override fun onComplete() {
|
||||||
|
// unused atm
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -322,8 +326,12 @@ class SetStatusDialogFragment :
|
|||||||
ncApi.statusDeleteMessage(credentials, ApiUtils.getUrlForStatusMessage(currentUser?.baseUrl))
|
ncApi.statusDeleteMessage(credentials, ApiUtils.getUrlForStatusMessage(currentUser?.baseUrl))
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread()).subscribe(object : Observer<GenericOverall> {
|
.observeOn(AndroidSchedulers.mainThread()).subscribe(object : Observer<GenericOverall> {
|
||||||
override fun onSubscribe(d: Disposable) {}
|
override fun onSubscribe(d: Disposable) {
|
||||||
override fun onNext(statusOverall: GenericOverall) {}
|
// unused atm
|
||||||
|
}
|
||||||
|
override fun onNext(statusOverall: GenericOverall) {
|
||||||
|
// unused atm
|
||||||
|
}
|
||||||
override fun onError(e: Throwable) {
|
override fun onError(e: Throwable) {
|
||||||
Log.e(logTag, "Failed to clear status", e)
|
Log.e(logTag, "Failed to clear status", e)
|
||||||
}
|
}
|
||||||
@ -343,7 +351,9 @@ class SetStatusDialogFragment :
|
|||||||
.io()
|
.io()
|
||||||
)
|
)
|
||||||
.observeOn(AndroidSchedulers.mainThread()).subscribe(object : Observer<GenericOverall> {
|
.observeOn(AndroidSchedulers.mainThread()).subscribe(object : Observer<GenericOverall> {
|
||||||
override fun onSubscribe(d: Disposable) {}
|
override fun onSubscribe(d: Disposable) {
|
||||||
|
// unused atm
|
||||||
|
}
|
||||||
override fun onNext(statusOverall: GenericOverall) {
|
override fun onNext(statusOverall: GenericOverall) {
|
||||||
Log.d(logTag, "statusType successfully set")
|
Log.d(logTag, "statusType successfully set")
|
||||||
}
|
}
|
||||||
@ -353,7 +363,9 @@ class SetStatusDialogFragment :
|
|||||||
clearTopStatus()
|
clearTopStatus()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onComplete() {}
|
override fun onComplete() {
|
||||||
|
// unused atm
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -417,6 +429,7 @@ class SetStatusDialogFragment :
|
|||||||
?.subscribe(object : Observer<GenericOverall> {
|
?.subscribe(object : Observer<GenericOverall> {
|
||||||
|
|
||||||
override fun onSubscribe(d: Disposable) {
|
override fun onSubscribe(d: Disposable) {
|
||||||
|
// unused atm
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onNext(t: GenericOverall) {
|
override fun onNext(t: GenericOverall) {
|
||||||
@ -428,7 +441,9 @@ class SetStatusDialogFragment :
|
|||||||
Log.e(logTag, "failed to set CustomStatusMessage", e)
|
Log.e(logTag, "failed to set CustomStatusMessage", e)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onComplete() {}
|
override fun onComplete() {
|
||||||
|
// unused atm
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,10 +55,7 @@ object AccountUtils {
|
|||||||
internalUserEntity = userEntitiesList[i]
|
internalUserEntity = userEntitiesList[i]
|
||||||
importAccount = getInformationFromAccount(account)
|
importAccount = getInformationFromAccount(account)
|
||||||
if (importAccount.token != null) {
|
if (importAccount.token != null) {
|
||||||
if (
|
if (UriUtils.hasHttpProtocollPrefixed(importAccount.baseUrl)) {
|
||||||
importAccount.baseUrl.startsWith("http://") ||
|
|
||||||
importAccount.baseUrl.startsWith("https://")
|
|
||||||
) {
|
|
||||||
if (
|
if (
|
||||||
internalUserEntity.username == importAccount.username &&
|
internalUserEntity.username == importAccount.username &&
|
||||||
internalUserEntity.baseUrl == importAccount.baseUrl
|
internalUserEntity.baseUrl == importAccount.baseUrl
|
||||||
@ -139,6 +136,7 @@ object AccountUtils {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Suppress("Detekt.TooGenericExceptionCaught")
|
||||||
fun getInformationFromAccount(account: Account): ImportAccount {
|
fun getInformationFromAccount(account: Account): ImportAccount {
|
||||||
val lastAtPos = account.name.lastIndexOf("@")
|
val lastAtPos = account.name.lastIndexOf("@")
|
||||||
var urlString = account.name.substring(lastAtPos + 1)
|
var urlString = account.name.substring(lastAtPos + 1)
|
||||||
|
@ -43,6 +43,7 @@ class ImageEmojiEditText : EmojiEditText {
|
|||||||
constructor(context: Context) : super(context)
|
constructor(context: Context) : super(context)
|
||||||
constructor(context: Context, attrs: AttributeSet) : super(context, attrs)
|
constructor(context: Context, attrs: AttributeSet) : super(context, attrs)
|
||||||
|
|
||||||
|
@Suppress("Detekt.TooGenericExceptionCaught")
|
||||||
override fun onCreateInputConnection(editorInfo: EditorInfo): InputConnection {
|
override fun onCreateInputConnection(editorInfo: EditorInfo): InputConnection {
|
||||||
|
|
||||||
val ic: InputConnection = super.onCreateInputConnection(editorInfo)
|
val ic: InputConnection = super.onCreateInputConnection(editorInfo)
|
||||||
|
@ -2,6 +2,8 @@
|
|||||||
* Nextcloud Talk application
|
* Nextcloud Talk application
|
||||||
*
|
*
|
||||||
* @author Mario Danic
|
* @author Mario Danic
|
||||||
|
* @author Andy Scherzinger
|
||||||
|
* Copyright (C) 2021 Andy Scherzinger <info@andy-scherzinger.de>
|
||||||
* Copyright (C) 2017 Mario Danic <mario@lovelyhq.com>
|
* Copyright (C) 2017 Mario Danic <mario@lovelyhq.com>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
@ -62,9 +64,7 @@ object NotificationUtils {
|
|||||||
@TargetApi(Build.VERSION_CODES.O)
|
@TargetApi(Build.VERSION_CODES.O)
|
||||||
private fun createNotificationChannel(
|
private fun createNotificationChannel(
|
||||||
context: Context,
|
context: Context,
|
||||||
channelId: String,
|
notificationChannel: Channel,
|
||||||
channelName: String,
|
|
||||||
channelDescription: String,
|
|
||||||
sound: Uri?,
|
sound: Uri?,
|
||||||
audioAttributes: AudioAttributes
|
audioAttributes: AudioAttributes
|
||||||
) {
|
) {
|
||||||
@ -73,14 +73,14 @@ object NotificationUtils {
|
|||||||
|
|
||||||
if (
|
if (
|
||||||
Build.VERSION.SDK_INT >= Build.VERSION_CODES.O &&
|
Build.VERSION.SDK_INT >= Build.VERSION_CODES.O &&
|
||||||
notificationManager.getNotificationChannel(channelId) == null
|
notificationManager.getNotificationChannel(notificationChannel.id) == null
|
||||||
) {
|
) {
|
||||||
val channel = NotificationChannel(
|
val channel = NotificationChannel(
|
||||||
channelId, channelName,
|
notificationChannel.id, notificationChannel.name,
|
||||||
NotificationManager.IMPORTANCE_HIGH
|
NotificationManager.IMPORTANCE_HIGH
|
||||||
)
|
)
|
||||||
|
|
||||||
channel.description = channelDescription
|
channel.description = notificationChannel.description
|
||||||
channel.enableLights(true)
|
channel.enableLights(true)
|
||||||
channel.lightColor = R.color.colorPrimary
|
channel.lightColor = R.color.colorPrimary
|
||||||
channel.setSound(sound, audioAttributes)
|
channel.setSound(sound, audioAttributes)
|
||||||
@ -103,9 +103,11 @@ object NotificationUtils {
|
|||||||
|
|
||||||
createNotificationChannel(
|
createNotificationChannel(
|
||||||
context,
|
context,
|
||||||
NOTIFICATION_CHANNEL_CALLS_V4,
|
Channel(
|
||||||
context.resources.getString(R.string.nc_notification_channel_calls),
|
NOTIFICATION_CHANNEL_CALLS_V4,
|
||||||
context.resources.getString(R.string.nc_notification_channel_calls_description),
|
context.resources.getString(R.string.nc_notification_channel_calls),
|
||||||
|
context.resources.getString(R.string.nc_notification_channel_calls_description)
|
||||||
|
),
|
||||||
soundUri,
|
soundUri,
|
||||||
audioAttributes
|
audioAttributes
|
||||||
)
|
)
|
||||||
@ -124,9 +126,11 @@ object NotificationUtils {
|
|||||||
|
|
||||||
createNotificationChannel(
|
createNotificationChannel(
|
||||||
context,
|
context,
|
||||||
NOTIFICATION_CHANNEL_MESSAGES_V4,
|
Channel(
|
||||||
context.resources.getString(R.string.nc_notification_channel_messages),
|
NOTIFICATION_CHANNEL_MESSAGES_V4,
|
||||||
context.resources.getString(R.string.nc_notification_channel_messages_description),
|
context.resources.getString(R.string.nc_notification_channel_messages),
|
||||||
|
context.resources.getString(R.string.nc_notification_channel_messages_description)
|
||||||
|
),
|
||||||
soundUri,
|
soundUri,
|
||||||
audioAttributes
|
audioAttributes
|
||||||
)
|
)
|
||||||
@ -322,4 +326,10 @@ object NotificationUtils {
|
|||||||
appPreferences.messageRingtoneUri, DEFAULT_MESSAGE_RINGTONE_URI, NOTIFICATION_CHANNEL_MESSAGES_V4
|
appPreferences.messageRingtoneUri, DEFAULT_MESSAGE_RINGTONE_URI, NOTIFICATION_CHANNEL_MESSAGES_V4
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private data class Channel(
|
||||||
|
val id: String,
|
||||||
|
val name: String,
|
||||||
|
val description: String
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
* Nextcloud Talk application
|
* Nextcloud Talk application
|
||||||
*
|
*
|
||||||
|
* @author Andy Scherzinger
|
||||||
* @author Marcel Hibbe
|
* @author Marcel Hibbe
|
||||||
|
* Copyright (C) 2022 Andy Scherzinger <info@andy-scherzinger.de>
|
||||||
* Copyright (C) 2021 Marcel Hibbe <dev@mhibbe.de>
|
* Copyright (C) 2021 Marcel Hibbe <dev@mhibbe.de>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
@ -50,5 +52,9 @@ class UriUtils {
|
|||||||
}
|
}
|
||||||
return filename
|
return filename
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun hasHttpProtocollPrefixed(uri: String): Boolean {
|
||||||
|
return uri.startsWith("http://") || uri.startsWith("https://")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
build:
|
build:
|
||||||
maxIssues: 217
|
maxIssues: 149
|
||||||
weights:
|
weights:
|
||||||
# complexity: 2
|
# complexity: 2
|
||||||
# LongParameterList: 1
|
# LongParameterList: 1
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
DO NOT TOUCH; GENERATED BY DRONE
|
DO NOT TOUCH; GENERATED BY DRONE
|
||||||
<span class="mdl-layout-title">Lint Report: 1 error and 171 warnings</span>
|
<span class="mdl-layout-title">Lint Report: 1 error and 172 warnings</span>
|
||||||
|
Loading…
Reference in New Issue
Block a user