mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-19 19:49:33 +01:00
Reformat code
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
d1221aa435
commit
825354881e
@ -107,10 +107,13 @@ open class BaseActivity : AppCompatActivity() {
|
|||||||
issuedFor = cert.subjectDN.name
|
issuedFor = cert.subjectDN.name
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressLint("StringFormatMatches") val dialogText = String.format(
|
@SuppressLint("StringFormatMatches")
|
||||||
resources
|
val dialogText = String.format(
|
||||||
.getString(R.string.nc_certificate_dialog_text),
|
resources.getString(R.string.nc_certificate_dialog_text),
|
||||||
issuedBy, issuedFor, validFrom, validUntil
|
issuedBy,
|
||||||
|
issuedFor,
|
||||||
|
validFrom,
|
||||||
|
validUntil
|
||||||
)
|
)
|
||||||
|
|
||||||
val dialogBuilder = MaterialAlertDialogBuilder(this)
|
val dialogBuilder = MaterialAlertDialogBuilder(this)
|
||||||
|
@ -195,7 +195,8 @@ class CallNotificationActivity : CallBaseActivity() {
|
|||||||
userBeingCalled,
|
userBeingCalled,
|
||||||
intArrayOf(
|
intArrayOf(
|
||||||
ApiUtils.APIv4,
|
ApiUtils.APIv4,
|
||||||
ApiUtils.APIv3, 1
|
ApiUtils.APIv3,
|
||||||
|
1
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
ncApi!!.getRoom(credentials, ApiUtils.getUrlForRoom(apiVersion, userBeingCalled!!.baseUrl, roomToken))
|
ncApi!!.getRoom(credentials, ApiUtils.getUrlForRoom(apiVersion, userBeingCalled!!.baseUrl, roomToken))
|
||||||
|
@ -210,7 +210,6 @@ class MainActivity : BaseActivity(), ActionBarProvider {
|
|||||||
|
|
||||||
private fun handleActionFromContact(intent: Intent) {
|
private fun handleActionFromContact(intent: Intent) {
|
||||||
if (intent.action == Intent.ACTION_VIEW && intent.data != null) {
|
if (intent.action == Intent.ACTION_VIEW && intent.data != null) {
|
||||||
|
|
||||||
val cursor = contentResolver.query(intent.data!!, null, null, null, null)
|
val cursor = contentResolver.query(intent.data!!, null, null, null, null)
|
||||||
|
|
||||||
var userId = ""
|
var userId = ""
|
||||||
@ -250,13 +249,18 @@ class MainActivity : BaseActivity(), ActionBarProvider {
|
|||||||
val apiVersion = ApiUtils.getConversationApiVersion(currentUser, intArrayOf(ApiUtils.APIv4, 1))
|
val apiVersion = ApiUtils.getConversationApiVersion(currentUser, intArrayOf(ApiUtils.APIv4, 1))
|
||||||
val credentials = ApiUtils.getCredentials(currentUser?.username, currentUser?.token)
|
val credentials = ApiUtils.getCredentials(currentUser?.username, currentUser?.token)
|
||||||
val retrofitBucket = ApiUtils.getRetrofitBucketForCreateRoom(
|
val retrofitBucket = ApiUtils.getRetrofitBucketForCreateRoom(
|
||||||
apiVersion, currentUser?.baseUrl, roomType,
|
apiVersion,
|
||||||
null, userId, null
|
currentUser?.baseUrl,
|
||||||
|
roomType,
|
||||||
|
null,
|
||||||
|
userId,
|
||||||
|
null
|
||||||
)
|
)
|
||||||
|
|
||||||
ncApi.createRoom(
|
ncApi.createRoom(
|
||||||
credentials,
|
credentials,
|
||||||
retrofitBucket.url, retrofitBucket.queryMap
|
retrofitBucket.url,
|
||||||
|
retrofitBucket.queryMap
|
||||||
)
|
)
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
@ -293,8 +297,11 @@ class MainActivity : BaseActivity(), ActionBarProvider {
|
|||||||
Parcels.wrap(roomOverall.ocs!!.data)
|
Parcels.wrap(roomOverall.ocs!!.data)
|
||||||
)
|
)
|
||||||
remapChatController(
|
remapChatController(
|
||||||
router!!, currentUser!!.id!!,
|
router!!,
|
||||||
roomOverall.ocs!!.data!!.token!!, bundle, true
|
currentUser!!.id!!,
|
||||||
|
roomOverall.ocs!!.data!!.token!!,
|
||||||
|
bundle,
|
||||||
|
true
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -122,7 +122,8 @@ class ConversationItem(
|
|||||||
if (adapter.hasFilter()) {
|
if (adapter.hasFilter()) {
|
||||||
viewThemeUtils.platform.highlightText(
|
viewThemeUtils.platform.highlightText(
|
||||||
holder.binding.dialogName,
|
holder.binding.dialogName,
|
||||||
model.displayName!!, adapter.getFilter(String::class.java).toString()
|
model.displayName!!,
|
||||||
|
adapter.getFilter(String::class.java).toString()
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
holder.binding.dialogName.text = model.displayName
|
holder.binding.dialogName.text = model.displayName
|
||||||
|
@ -184,8 +184,11 @@ class IncomingTextMessageViewHolder(itemView: View, payload: Any) : MessageHolde
|
|||||||
} ?: run {
|
} ?: run {
|
||||||
binding.messageQuote.quotedMessageImage.visibility = View.GONE
|
binding.messageQuote.quotedMessageImage.visibility = View.GONE
|
||||||
}
|
}
|
||||||
binding.messageQuote.quotedMessageAuthor.text = if (parentChatMessage.actorDisplayName.isNullOrEmpty())
|
binding.messageQuote.quotedMessageAuthor.text = if (parentChatMessage.actorDisplayName.isNullOrEmpty()) {
|
||||||
context!!.getText(R.string.nc_nick_guest) else parentChatMessage.actorDisplayName
|
context!!.getText(R.string.nc_nick_guest)
|
||||||
|
} else {
|
||||||
|
parentChatMessage.actorDisplayName
|
||||||
|
}
|
||||||
binding.messageQuote.quotedMessage.text = parentChatMessage.text
|
binding.messageQuote.quotedMessage.text = parentChatMessage.text
|
||||||
|
|
||||||
if (parentChatMessage.actorId?.equals(message.activeUser!!.userId) == true) {
|
if (parentChatMessage.actorId?.equals(message.activeUser!!.userId) == true) {
|
||||||
|
@ -102,7 +102,8 @@ class OutcomingLinkPreviewMessageViewHolder(outcomingView: View, payload: Any) :
|
|||||||
AppCompatResources.getDrawable(context, drawableInt)?.let {
|
AppCompatResources.getDrawable(context, drawableInt)?.let {
|
||||||
binding.checkMark.setImageDrawable(it)
|
binding.checkMark.setImageDrawable(it)
|
||||||
binding.checkMark.setColorFilter(
|
binding.checkMark.setColorFilter(
|
||||||
viewThemeUtils.getScheme(binding.checkMark.context).onSurfaceVariant, PorterDuff.Mode.SRC_ATOP
|
viewThemeUtils.getScheme(binding.checkMark.context).onSurfaceVariant,
|
||||||
|
PorterDuff.Mode.SRC_ATOP
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -115,7 +115,8 @@ class OutcomingLocationMessageViewHolder(incomingView: View) : MessageHolders
|
|||||||
AppCompatResources.getDrawable(context!!, drawableInt)?.let {
|
AppCompatResources.getDrawable(context!!, drawableInt)?.let {
|
||||||
binding.checkMark.setImageDrawable(it)
|
binding.checkMark.setImageDrawable(it)
|
||||||
binding.checkMark.setColorFilter(
|
binding.checkMark.setColorFilter(
|
||||||
viewThemeUtils.getScheme(binding.checkMark.context).onSurfaceVariant, PorterDuff.Mode.SRC_ATOP
|
viewThemeUtils.getScheme(binding.checkMark.context).onSurfaceVariant,
|
||||||
|
PorterDuff.Mode.SRC_ATOP
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -102,7 +102,8 @@ class OutcomingPollMessageViewHolder(outcomingView: View, payload: Any) : Messag
|
|||||||
AppCompatResources.getDrawable(context, drawableInt)?.let {
|
AppCompatResources.getDrawable(context, drawableInt)?.let {
|
||||||
binding.checkMark.setImageDrawable(it)
|
binding.checkMark.setImageDrawable(it)
|
||||||
binding.checkMark.setColorFilter(
|
binding.checkMark.setColorFilter(
|
||||||
viewThemeUtils.getScheme(binding.checkMark.context).onSurfaceVariant, PorterDuff.Mode.SRC_ATOP
|
viewThemeUtils.getScheme(binding.checkMark.context).onSurfaceVariant,
|
||||||
|
PorterDuff.Mode.SRC_ATOP
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -118,7 +118,8 @@ class OutcomingTextMessageViewHolder(itemView: View) : OutcomingTextMessageViewH
|
|||||||
ResourcesCompat.getDrawable(context!!.resources, drawableInt, null)?.let {
|
ResourcesCompat.getDrawable(context!!.resources, drawableInt, null)?.let {
|
||||||
binding.checkMark.setImageDrawable(it)
|
binding.checkMark.setImageDrawable(it)
|
||||||
binding.checkMark.setColorFilter(
|
binding.checkMark.setColorFilter(
|
||||||
viewThemeUtils.getScheme(binding.messageText.context).onSurfaceVariant, PorterDuff.Mode.SRC_ATOP
|
viewThemeUtils.getScheme(binding.messageText.context).onSurfaceVariant,
|
||||||
|
PorterDuff.Mode.SRC_ATOP
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -136,7 +136,8 @@ class OutcomingVoiceMessageViewHolder(outcomingView: View) : MessageHolders
|
|||||||
AppCompatResources.getDrawable(context!!, drawableInt)?.let {
|
AppCompatResources.getDrawable(context!!, drawableInt)?.let {
|
||||||
binding.checkMark.setImageDrawable(it)
|
binding.checkMark.setImageDrawable(it)
|
||||||
binding.checkMark.setColorFilter(
|
binding.checkMark.setColorFilter(
|
||||||
viewThemeUtils.getScheme(binding.checkMark.context).onSurfaceVariant, PorterDuff.Mode.SRC_ATOP
|
viewThemeUtils.getScheme(binding.checkMark.context).onSurfaceVariant,
|
||||||
|
PorterDuff.Mode.SRC_ATOP
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -263,7 +263,10 @@ abstract class PreviewMessageViewHolder(itemView: View?, payload: Any?) :
|
|||||||
)
|
)
|
||||||
drawable = Drawable.createFromResourceStream(
|
drawable = Drawable.createFromResourceStream(
|
||||||
context!!.resources,
|
context!!.resources,
|
||||||
null, inputStream, null, null
|
null,
|
||||||
|
inputStream,
|
||||||
|
null,
|
||||||
|
null
|
||||||
)
|
)
|
||||||
try {
|
try {
|
||||||
inputStream.close()
|
inputStream.close()
|
||||||
|
@ -80,7 +80,7 @@ class Reaction {
|
|||||||
viewThemeUtils,
|
viewThemeUtils,
|
||||||
isOutgoingMessage,
|
isOutgoingMessage,
|
||||||
isSelfReaction
|
isSelfReaction
|
||||||
),
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
emojiWithAmountWrapper.setOnClickListener {
|
emojiWithAmountWrapper.setOnClickListener {
|
||||||
|
@ -179,7 +179,8 @@ class NextcloudTalkApplication : MultiDexApplication(), LifecycleObserver {
|
|||||||
val accountRemovalWork = OneTimeWorkRequest.Builder(AccountRemovalWorker::class.java).build()
|
val accountRemovalWork = OneTimeWorkRequest.Builder(AccountRemovalWorker::class.java).build()
|
||||||
val periodicCapabilitiesUpdateWork = PeriodicWorkRequest.Builder(
|
val periodicCapabilitiesUpdateWork = PeriodicWorkRequest.Builder(
|
||||||
CapabilitiesWorker::class.java,
|
CapabilitiesWorker::class.java,
|
||||||
HALF_DAY, TimeUnit.HOURS
|
HALF_DAY,
|
||||||
|
TimeUnit.HOURS
|
||||||
).build()
|
).build()
|
||||||
val capabilitiesUpdateWork = OneTimeWorkRequest.Builder(CapabilitiesWorker::class.java).build()
|
val capabilitiesUpdateWork = OneTimeWorkRequest.Builder(CapabilitiesWorker::class.java).build()
|
||||||
val signalingSettingsWork = OneTimeWorkRequest.Builder(SignalingSettingsWorker::class.java).build()
|
val signalingSettingsWork = OneTimeWorkRequest.Builder(SignalingSettingsWorker::class.java).build()
|
||||||
|
@ -459,7 +459,6 @@ class ChatController(args: Bundle) :
|
|||||||
|
|
||||||
private fun loadAvatarForStatusBar() {
|
private fun loadAvatarForStatusBar() {
|
||||||
if (isOneToOneConversation() && activity != null) {
|
if (isOneToOneConversation() && activity != null) {
|
||||||
|
|
||||||
val url = ApiUtils.getUrlForAvatar(
|
val url = ApiUtils.getUrlForAvatar(
|
||||||
conversationUser!!.baseUrl,
|
conversationUser!!.baseUrl,
|
||||||
currentConversation!!.name,
|
currentConversation!!.name,
|
||||||
@ -468,7 +467,6 @@ class ChatController(args: Bundle) :
|
|||||||
val target = object : Target {
|
val target = object : Target {
|
||||||
|
|
||||||
private fun setIcon(drawable: Drawable?) {
|
private fun setIcon(drawable: Drawable?) {
|
||||||
|
|
||||||
actionBar?.let {
|
actionBar?.let {
|
||||||
val avatarSize = (it.height / TOOLBAR_AVATAR_RATIO).roundToInt()
|
val avatarSize = (it.height / TOOLBAR_AVATAR_RATIO).roundToInt()
|
||||||
|
|
||||||
@ -689,7 +687,6 @@ class ChatController(args: Bundle) :
|
|||||||
super.onScrollStateChanged(recyclerView, newState)
|
super.onScrollStateChanged(recyclerView, newState)
|
||||||
|
|
||||||
if (newState == AbsListView.OnScrollListener.SCROLL_STATE_IDLE) {
|
if (newState == AbsListView.OnScrollListener.SCROLL_STATE_IDLE) {
|
||||||
|
|
||||||
if (layoutManager!!.findFirstCompletelyVisibleItemPosition() > 0) {
|
if (layoutManager!!.findFirstCompletelyVisibleItemPosition() > 0) {
|
||||||
binding?.scrollDownButton?.visibility = View.VISIBLE
|
binding?.scrollDownButton?.visibility = View.VISIBLE
|
||||||
} else {
|
} else {
|
||||||
@ -2086,11 +2083,11 @@ class ChatController(args: Bundle) :
|
|||||||
val replyMessageId: Int? = view?.findViewById<RelativeLayout>(R.id.quotedChatMessageView)?.tag as Int?
|
val replyMessageId: Int? = view?.findViewById<RelativeLayout>(R.id.quotedChatMessageView)?.tag as Int?
|
||||||
sendMessage(
|
sendMessage(
|
||||||
editable,
|
editable,
|
||||||
if (
|
if (view?.findViewById<RelativeLayout>(R.id.quotedChatMessageView)?.visibility == View.VISIBLE) {
|
||||||
view
|
replyMessageId
|
||||||
?.findViewById<RelativeLayout>(R.id.quotedChatMessageView)
|
} else {
|
||||||
?.visibility == View.VISIBLE
|
null
|
||||||
) replyMessageId else null,
|
},
|
||||||
sendWithoutNotification
|
sendWithoutNotification
|
||||||
)
|
)
|
||||||
cancelReply()
|
cancelReply()
|
||||||
@ -2321,7 +2318,6 @@ class ChatController(args: Bundle) :
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun processMessagesResponse(response: Response<*>, isFromTheFuture: Boolean) {
|
private fun processMessagesResponse(response: Response<*>, isFromTheFuture: Boolean) {
|
||||||
|
|
||||||
val xChatLastCommonRead = response.headers()["X-Chat-Last-Common-Read"]?.let {
|
val xChatLastCommonRead = response.headers()["X-Chat-Last-Common-Read"]?.let {
|
||||||
Integer.parseInt(it)
|
Integer.parseInt(it)
|
||||||
}
|
}
|
||||||
@ -2408,7 +2404,6 @@ class ChatController(args: Bundle) :
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun processMessagesFromTheFuture(chatMessageList: List<ChatMessage>) {
|
private fun processMessagesFromTheFuture(chatMessageList: List<ChatMessage>) {
|
||||||
|
|
||||||
val shouldAddNewMessagesNotice = (adapter?.itemCount ?: 0) > 0 && chatMessageList.isNotEmpty()
|
val shouldAddNewMessagesNotice = (adapter?.itemCount ?: 0) > 0 && chatMessageList.isNotEmpty()
|
||||||
|
|
||||||
if (shouldAddNewMessagesNotice) {
|
if (shouldAddNewMessagesNotice) {
|
||||||
@ -2592,11 +2587,13 @@ class ChatController(args: Bundle) :
|
|||||||
|
|
||||||
binding?.messageInputView?.context?.let {
|
binding?.messageInputView?.context?.let {
|
||||||
viewThemeUtils.platform.colorToolbarMenuIcon(
|
viewThemeUtils.platform.colorToolbarMenuIcon(
|
||||||
it, menu.findItem(R.id.conversation_voice_call)
|
it,
|
||||||
|
menu.findItem(R.id.conversation_voice_call)
|
||||||
)
|
)
|
||||||
|
|
||||||
viewThemeUtils.platform.colorToolbarMenuIcon(
|
viewThemeUtils.platform.colorToolbarMenuIcon(
|
||||||
it, menu.findItem(R.id.conversation_video_call)
|
it,
|
||||||
|
menu.findItem(R.id.conversation_video_call)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -248,7 +248,8 @@ class ContactsController(args: Bundle) :
|
|||||||
)
|
)
|
||||||
ncApi.createRoom(
|
ncApi.createRoom(
|
||||||
credentials,
|
credentials,
|
||||||
retrofitBucket.url, retrofitBucket.queryMap
|
retrofitBucket.url,
|
||||||
|
retrofitBucket.queryMap
|
||||||
)
|
)
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
@ -267,7 +268,8 @@ class ContactsController(args: Bundle) :
|
|||||||
ncApi.getRoom(
|
ncApi.getRoom(
|
||||||
credentials,
|
credentials,
|
||||||
ApiUtils.getUrlForRoom(
|
ApiUtils.getUrlForRoom(
|
||||||
apiVersion, currentUser!!.baseUrl,
|
apiVersion,
|
||||||
|
currentUser!!.baseUrl,
|
||||||
roomOverall.ocs!!.data!!.token
|
roomOverall.ocs!!.data!!.token
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@ -428,7 +430,9 @@ class ContactsController(args: Bundle) :
|
|||||||
modifiedQueryMap.put("shareTypes[]", shareTypesList)
|
modifiedQueryMap.put("shareTypes[]", shareTypesList)
|
||||||
ncApi.getContactsWithSearchParam(
|
ncApi.getContactsWithSearchParam(
|
||||||
credentials,
|
credentials,
|
||||||
retrofitBucket.url, shareTypesList, modifiedQueryMap
|
retrofitBucket.url,
|
||||||
|
shareTypesList,
|
||||||
|
modifiedQueryMap
|
||||||
)
|
)
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
@ -799,10 +803,7 @@ class ContactsController(args: Bundle) :
|
|||||||
contactItem.model.calculatedActorId,
|
contactItem.model.calculatedActorId,
|
||||||
null
|
null
|
||||||
)
|
)
|
||||||
ncApi.createRoom(
|
ncApi.createRoom(credentials, retrofitBucket.url, retrofitBucket.queryMap)
|
||||||
credentials,
|
|
||||||
retrofitBucket.url, retrofitBucket.queryMap
|
|
||||||
)
|
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribe(object : Observer<RoomOverall> {
|
.subscribe(object : Observer<RoomOverall> {
|
||||||
|
@ -305,8 +305,11 @@ class ConversationInfoController(args: Bundle) :
|
|||||||
conversation!!.lobbyTimer = 0
|
conversation!!.lobbyTimer = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
conversation!!.lobbyState = if (isChecked) Conversation.LobbyState
|
conversation!!.lobbyState = if (isChecked) {
|
||||||
.LOBBY_STATE_MODERATORS_ONLY else Conversation.LobbyState.LOBBY_STATE_ALL_PARTICIPANTS
|
Conversation.LobbyState.LOBBY_STATE_MODERATORS_ONLY
|
||||||
|
} else {
|
||||||
|
Conversation.LobbyState.LOBBY_STATE_ALL_PARTICIPANTS
|
||||||
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
conversation!!.lobbyTimer != null &&
|
conversation!!.lobbyTimer != null &&
|
||||||
@ -315,7 +318,7 @@ class ConversationInfoController(args: Bundle) :
|
|||||||
) {
|
) {
|
||||||
binding?.webinarInfoView?.startTimePreferences?.setSummary(
|
binding?.webinarInfoView?.startTimePreferences?.setSummary(
|
||||||
dateUtils.getLocalDateTimeStringFromTimestamp(
|
dateUtils.getLocalDateTimeStringFromTimestamp(
|
||||||
conversation!!.lobbyTimer!! * DateConstants.SECOND_DIVIDER,
|
conversation!!.lobbyTimer!! * DateConstants.SECOND_DIVIDER
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
@ -333,7 +336,11 @@ class ConversationInfoController(args: Bundle) :
|
|||||||
val state = if (
|
val state = if (
|
||||||
(binding?.webinarInfoView?.conversationInfoLobby?.findViewById<View>(R.id.mp_checkable) as SwitchCompat)
|
(binding?.webinarInfoView?.conversationInfoLobby?.findViewById<View>(R.id.mp_checkable) as SwitchCompat)
|
||||||
.isChecked
|
.isChecked
|
||||||
) 1 else 0
|
) {
|
||||||
|
1
|
||||||
|
} else {
|
||||||
|
0
|
||||||
|
}
|
||||||
|
|
||||||
val apiVersion = ApiUtils.getConversationApiVersion(conversationUser, intArrayOf(ApiUtils.APIv4, 1))
|
val apiVersion = ApiUtils.getConversationApiVersion(conversationUser, intArrayOf(ApiUtils.APIv4, 1))
|
||||||
|
|
||||||
@ -380,7 +387,8 @@ class ConversationInfoController(args: Bundle) :
|
|||||||
val dialogBuilder = MaterialAlertDialogBuilder(it.context)
|
val dialogBuilder = MaterialAlertDialogBuilder(it.context)
|
||||||
.setIcon(
|
.setIcon(
|
||||||
viewThemeUtils.dialog.colorMaterialAlertDialogIcon(
|
viewThemeUtils.dialog.colorMaterialAlertDialogIcon(
|
||||||
context, R.drawable.ic_delete_black_24dp
|
context,
|
||||||
|
R.drawable.ic_delete_black_24dp
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
.setTitle(R.string.nc_delete_call)
|
.setTitle(R.string.nc_delete_call)
|
||||||
@ -553,7 +561,8 @@ class ConversationInfoController(args: Bundle) :
|
|||||||
val dialogBuilder = MaterialAlertDialogBuilder(it)
|
val dialogBuilder = MaterialAlertDialogBuilder(it)
|
||||||
.setIcon(
|
.setIcon(
|
||||||
viewThemeUtils.dialog.colorMaterialAlertDialogIcon(
|
viewThemeUtils.dialog.colorMaterialAlertDialogIcon(
|
||||||
context, R.drawable.ic_delete_black_24dp
|
context,
|
||||||
|
R.drawable.ic_delete_black_24dp
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
.setTitle(R.string.nc_clear_history)
|
.setTitle(R.string.nc_clear_history)
|
||||||
|
@ -237,7 +237,6 @@ class ConversationsListController(bundle: Bundle) :
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun loadUserAvatar(button: MaterialButton) {
|
private fun loadUserAvatar(button: MaterialButton) {
|
||||||
|
|
||||||
val target = object : Target {
|
val target = object : Target {
|
||||||
override fun onStart(placeholder: Drawable?) {
|
override fun onStart(placeholder: Drawable?) {
|
||||||
button.icon = placeholder
|
button.icon = placeholder
|
||||||
@ -448,7 +447,9 @@ class ConversationsListController(bundle: Bundle) :
|
|||||||
private fun hasActivityActionSendIntent(): Boolean {
|
private fun hasActivityActionSendIntent(): Boolean {
|
||||||
return if (activity != null) {
|
return if (activity != null) {
|
||||||
Intent.ACTION_SEND == activity!!.intent.action || Intent.ACTION_SEND_MULTIPLE == activity!!.intent.action
|
Intent.ACTION_SEND == activity!!.intent.action || Intent.ACTION_SEND_MULTIPLE == activity!!.intent.action
|
||||||
} else false
|
} else {
|
||||||
|
false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun showSearchOrToolbar() {
|
override fun showSearchOrToolbar() {
|
||||||
@ -579,7 +580,7 @@ class ConversationsListController(bundle: Bundle) :
|
|||||||
.setIcon(
|
.setIcon(
|
||||||
viewThemeUtils.dialog.colorMaterialAlertDialogIcon(
|
viewThemeUtils.dialog.colorMaterialAlertDialogIcon(
|
||||||
context,
|
context,
|
||||||
R.drawable.ic_baseline_error_outline_24dp,
|
R.drawable.ic_baseline_error_outline_24dp
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
.setTitle(R.string.error_loading_chats)
|
.setTitle(R.string.error_loading_chats)
|
||||||
@ -1199,7 +1200,8 @@ class ConversationsListController(bundle: Bundle) :
|
|||||||
val dialogBuilder = MaterialAlertDialogBuilder(it.context)
|
val dialogBuilder = MaterialAlertDialogBuilder(it.context)
|
||||||
.setIcon(
|
.setIcon(
|
||||||
viewThemeUtils.dialog.colorMaterialAlertDialogIcon(
|
viewThemeUtils.dialog.colorMaterialAlertDialogIcon(
|
||||||
context, R.drawable.ic_delete_black_24dp
|
context,
|
||||||
|
R.drawable.ic_delete_black_24dp
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
.setTitle(R.string.nc_dialog_invalid_password)
|
.setTitle(R.string.nc_dialog_invalid_password)
|
||||||
|
@ -318,7 +318,8 @@ class LocationPickerController(args: Bundle) :
|
|||||||
override fun onZoom(event: ZoomEvent): Boolean {
|
override fun onZoom(event: ZoomEvent): Boolean {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
|
)
|
||||||
|
|
||||||
@Suppress("Detekt.TooGenericExceptionCaught")
|
@Suppress("Detekt.TooGenericExceptionCaught")
|
||||||
private fun requestLocationUpdates() {
|
private fun requestLocationUpdates() {
|
||||||
@ -383,7 +384,6 @@ class LocationPickerController(args: Bundle) :
|
|||||||
|
|
||||||
private fun shareLocation(selectedLat: Double?, selectedLon: Double?, locationName: String?) {
|
private fun shareLocation(selectedLat: Double?, selectedLon: Double?, locationName: String?) {
|
||||||
if (selectedLat != null || selectedLon != null) {
|
if (selectedLat != null || selectedLon != null) {
|
||||||
|
|
||||||
val name = locationName
|
val name = locationName
|
||||||
if (name.isNullOrEmpty()) {
|
if (name.isNullOrEmpty()) {
|
||||||
initGeocoder()
|
initGeocoder()
|
||||||
|
@ -104,7 +104,8 @@ class LockedController : BaseController(R.layout.controller_locked) {
|
|||||||
.build()
|
.build()
|
||||||
val executor: Executor = Executors.newSingleThreadExecutor()
|
val executor: Executor = Executors.newSingleThreadExecutor()
|
||||||
val biometricPrompt = BiometricPrompt(
|
val biometricPrompt = BiometricPrompt(
|
||||||
(context as FragmentActivity?)!!, executor,
|
(context as FragmentActivity?)!!,
|
||||||
|
executor,
|
||||||
object : BiometricPrompt.AuthenticationCallback() {
|
object : BiometricPrompt.AuthenticationCallback() {
|
||||||
override fun onAuthenticationSucceeded(result: BiometricPrompt.AuthenticationResult) {
|
override fun onAuthenticationSucceeded(result: BiometricPrompt.AuthenticationResult) {
|
||||||
super.onAuthenticationSucceeded(result)
|
super.onAuthenticationSucceeded(result)
|
||||||
|
@ -84,7 +84,11 @@ class ServerSelectionController :
|
|||||||
}
|
}
|
||||||
setCertTextView()
|
setCertTextView()
|
||||||
},
|
},
|
||||||
arrayOf("RSA", "EC"), null, null, -1, null
|
arrayOf("RSA", "EC"),
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
-1,
|
||||||
|
null
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -238,7 +242,8 @@ class ServerSelectionController :
|
|||||||
} else if (!status.installed) {
|
} else if (!status.installed) {
|
||||||
setErrorText(
|
setErrorText(
|
||||||
String.format(
|
String.format(
|
||||||
resources!!.getString(R.string.nc_server_not_installed), productName
|
resources!!.getString(R.string.nc_server_not_installed),
|
||||||
|
productName
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
} else if (status.needsUpgrade) {
|
} else if (status.needsUpgrade) {
|
||||||
|
@ -225,7 +225,8 @@ class WebViewLoginController(args: Bundle? = null) : BaseController(
|
|||||||
try {
|
try {
|
||||||
val privateKey = KeyChain.getPrivateKey(activity!!, finalAlias!!)
|
val privateKey = KeyChain.getPrivateKey(activity!!, finalAlias!!)
|
||||||
val certificates = KeyChain.getCertificateChain(
|
val certificates = KeyChain.getCertificateChain(
|
||||||
activity!!, finalAlias
|
activity!!,
|
||||||
|
finalAlias
|
||||||
)
|
)
|
||||||
if (privateKey != null && certificates != null) {
|
if (privateKey != null && certificates != null) {
|
||||||
request.proceed(privateKey, certificates)
|
request.proceed(privateKey, certificates)
|
||||||
@ -249,7 +250,8 @@ class WebViewLoginController(args: Bundle? = null) : BaseController(
|
|||||||
try {
|
try {
|
||||||
privateKey = KeyChain.getPrivateKey(activity!!, chosenAlias)
|
privateKey = KeyChain.getPrivateKey(activity!!, chosenAlias)
|
||||||
val certificates = KeyChain.getCertificateChain(
|
val certificates = KeyChain.getCertificateChain(
|
||||||
activity!!, chosenAlias
|
activity!!,
|
||||||
|
chosenAlias
|
||||||
)
|
)
|
||||||
if (privateKey != null && certificates != null) {
|
if (privateKey != null && certificates != null) {
|
||||||
request.proceed(privateKey, certificates)
|
request.proceed(privateKey, certificates)
|
||||||
|
@ -366,7 +366,8 @@ class OperationsMenuController(args: Bundle) : BaseController(
|
|||||||
ncApi.getRoom(
|
ncApi.getRoom(
|
||||||
credentials,
|
credentials,
|
||||||
ApiUtils.getUrlForRoom(
|
ApiUtils.getUrlForRoom(
|
||||||
apiVersion, currentUser!!.baseUrl,
|
apiVersion,
|
||||||
|
currentUser!!.baseUrl,
|
||||||
conversation!!.token
|
conversation!!.token
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
@ -37,7 +37,6 @@ fun <IT : ListItemWithImage> MaterialDialog.listItemsWithImage(
|
|||||||
waitForPositiveButton: Boolean = true,
|
waitForPositiveButton: Boolean = true,
|
||||||
selection: ListItemListener<IT> = null
|
selection: ListItemListener<IT> = null
|
||||||
): MaterialDialog {
|
): MaterialDialog {
|
||||||
|
|
||||||
if (getListAdapter() != null) {
|
if (getListAdapter() != null) {
|
||||||
return updateListItemsWithImage(
|
return updateListItemsWithImage(
|
||||||
items = items,
|
items = items,
|
||||||
|
@ -36,7 +36,6 @@ class GuestAccessHelper(
|
|||||||
private val context = controller.context
|
private val context = controller.context
|
||||||
|
|
||||||
fun setupGuestAccess() {
|
fun setupGuestAccess() {
|
||||||
|
|
||||||
val guestAccessAllowSwitch = (
|
val guestAccessAllowSwitch = (
|
||||||
binding.guestAccessView.guestAccessAllowSwitch.findViewById<View>(R.id.mp_checkable)
|
binding.guestAccessView.guestAccessAllowSwitch.findViewById<View>(R.id.mp_checkable)
|
||||||
as SwitchCompat
|
as SwitchCompat
|
||||||
@ -71,7 +70,6 @@ class GuestAccessHelper(
|
|||||||
}
|
}
|
||||||
|
|
||||||
binding.guestAccessView.guestAccessPasswordSwitch.setOnClickListener {
|
binding.guestAccessView.guestAccessPasswordSwitch.setOnClickListener {
|
||||||
|
|
||||||
if (guestAccessPasswordSwitch.isChecked) {
|
if (guestAccessPasswordSwitch.isChecked) {
|
||||||
conversationsRepository.password("", conversation.token!!).subscribeOn(Schedulers.io())
|
conversationsRepository.password("", conversation.token!!).subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread()).subscribe(PasswordResultObserver(false))
|
.observeOn(AndroidSchedulers.mainThread()).subscribe(PasswordResultObserver(false))
|
||||||
|
@ -103,7 +103,8 @@ abstract class TalkDatabase : RoomDatabase() {
|
|||||||
super.onOpen(db)
|
super.onOpen(db)
|
||||||
db.execSQL("PRAGMA defer_foreign_keys = 1")
|
db.execSQL("PRAGMA defer_foreign_keys = 1")
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
|
)
|
||||||
.build()
|
.build()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,8 +29,16 @@ import kotlinx.parcelize.Parcelize
|
|||||||
@Parcelize
|
@Parcelize
|
||||||
@Entity(tableName = "ArbitraryStorage")
|
@Entity(tableName = "ArbitraryStorage")
|
||||||
data class ArbitraryStorageEntity(
|
data class ArbitraryStorageEntity(
|
||||||
@PrimaryKey @ColumnInfo(name = "accountIdentifier") var accountIdentifier: Long = 0,
|
@PrimaryKey
|
||||||
@ColumnInfo(name = "key") var key: String? = null,
|
@ColumnInfo(name = "accountIdentifier")
|
||||||
@ColumnInfo(name = "object") var storageObject: String? = null,
|
var accountIdentifier: Long = 0,
|
||||||
@ColumnInfo(name = "value") var value: String? = null
|
|
||||||
|
@ColumnInfo(name = "key")
|
||||||
|
var key: String? = null,
|
||||||
|
|
||||||
|
@ColumnInfo(name = "object")
|
||||||
|
var storageObject: String? = null,
|
||||||
|
|
||||||
|
@ColumnInfo(name = "value")
|
||||||
|
var value: String? = null
|
||||||
) : Parcelable
|
) : Parcelable
|
||||||
|
@ -729,7 +729,6 @@ class NotificationWorker(context: Context, workerParams: WorkerParameters) : Wor
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onComplete() {
|
override fun onComplete() {
|
||||||
|
|
||||||
if (isCallNotificationVisible) {
|
if (isCallNotificationVisible) {
|
||||||
// this state can be reached when call timeout is reached.
|
// this state can be reached when call timeout is reached.
|
||||||
showMissedCallNotification()
|
showMissedCallNotification()
|
||||||
@ -751,13 +750,15 @@ class NotificationWorker(context: Context, workerParams: WorkerParameters) : Wor
|
|||||||
signatureVerification.user,
|
signatureVerification.user,
|
||||||
intArrayOf(
|
intArrayOf(
|
||||||
ApiUtils.APIv4,
|
ApiUtils.APIv4,
|
||||||
ApiUtils.APIv3, 1
|
ApiUtils.APIv3,
|
||||||
|
1
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
ncApi.getRoom(
|
ncApi.getRoom(
|
||||||
credentials,
|
credentials,
|
||||||
ApiUtils.getUrlForRoom(
|
ApiUtils.getUrlForRoom(
|
||||||
apiVersion, signatureVerification.user?.baseUrl,
|
apiVersion,
|
||||||
|
signatureVerification.user?.baseUrl,
|
||||||
pushMessage.id
|
pushMessage.id
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
@ -407,7 +407,9 @@ data class ChatMessage(
|
|||||||
override fun getName(): String {
|
override fun getName(): String {
|
||||||
return if (!TextUtils.isEmpty(actorDisplayName)) {
|
return if (!TextUtils.isEmpty(actorDisplayName)) {
|
||||||
actorDisplayName!!
|
actorDisplayName!!
|
||||||
} else sharedApplication!!.getString(R.string.nc_guest)
|
} else {
|
||||||
|
sharedApplication!!.getString(R.string.nc_guest)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getAvatar(): String? {
|
override fun getAvatar(): String? {
|
||||||
|
@ -128,7 +128,7 @@ class PollRepositoryImpl(private val ncApi: NcApi, private val currentUserProvid
|
|||||||
pollDetailsResponse.actorType,
|
pollDetailsResponse.actorType,
|
||||||
pollDetailsResponse.actorId,
|
pollDetailsResponse.actorId,
|
||||||
pollDetailsResponse.actorDisplayName,
|
pollDetailsResponse.actorDisplayName,
|
||||||
pollDetailsResponse.optionId,
|
pollDetailsResponse.optionId
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -54,7 +54,6 @@ abstract class SharedItemsViewHolder(
|
|||||||
abstract val progressBar: ProgressBar
|
abstract val progressBar: ProgressBar
|
||||||
|
|
||||||
open fun onBind(item: SharedFileItem) {
|
open fun onBind(item: SharedFileItem) {
|
||||||
|
|
||||||
val placeholder = viewThemeUtils.talk.getPlaceholderImage(image.context, item.mimeType)
|
val placeholder = viewThemeUtils.talk.getPlaceholderImage(image.context, item.mimeType)
|
||||||
if (item.previewAvailable) {
|
if (item.previewAvailable) {
|
||||||
image.loadImage(
|
image.loadImage(
|
||||||
|
@ -76,7 +76,6 @@ class SharedItemsRepositoryImpl @Inject constructor(private val ncApi: NcApi, pr
|
|||||||
parameters: SharedItemsRepository.Parameters,
|
parameters: SharedItemsRepository.Parameters,
|
||||||
type: SharedItemType
|
type: SharedItemType
|
||||||
): SharedItems {
|
): SharedItems {
|
||||||
|
|
||||||
var chatLastGiven: Int? = null
|
var chatLastGiven: Int? = null
|
||||||
val items = mutableMapOf<String, SharedItem>()
|
val items = mutableMapOf<String, SharedItem>()
|
||||||
|
|
||||||
|
@ -115,7 +115,6 @@ class MessageSwipeCallback(private val context: Context, private val messageSwip
|
|||||||
actionState: Int,
|
actionState: Int,
|
||||||
isCurrentlyActive: Boolean
|
isCurrentlyActive: Boolean
|
||||||
) {
|
) {
|
||||||
|
|
||||||
if (actionState == ACTION_STATE_SWIPE) {
|
if (actionState == ACTION_STATE_SWIPE) {
|
||||||
setTouchListener(recyclerView, viewHolder)
|
setTouchListener(recyclerView, viewHolder)
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,6 @@ object ShareUtils {
|
|||||||
user: User,
|
user: User,
|
||||||
conversation: Conversation?
|
conversation: Conversation?
|
||||||
): String {
|
): String {
|
||||||
|
|
||||||
return String.format(
|
return String.format(
|
||||||
context.resources.getString(R.string.nc_share_text),
|
context.resources.getString(R.string.nc_share_text),
|
||||||
user.baseUrl,
|
user.baseUrl,
|
||||||
|
Loading…
Reference in New Issue
Block a user