mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-21 17:05:39 +03:00
ktlint: fix (no-empty-first-line-in-method-block) issues
This commit is contained in:
parent
e5779d425a
commit
fbb23dfb66
63 changed files with 1 additions and 81 deletions
|
@ -29,3 +29,4 @@ disabled_rules=no-wildcard-imports,no-multi-spaces,colon-spacing,chain-wrapping,
|
|||
# no-semi
|
||||
# no-empty-class-body
|
||||
# experimental:multiline-if-else
|
||||
# experimental:no-empty-first-line-in-method-block
|
||||
|
|
|
@ -98,7 +98,6 @@ internal class DefaultAuthenticator @Inject constructor(@Unauthenticated
|
|||
private suspend fun authenticate(homeServerConnectionConfig: HomeServerConnectionConfig,
|
||||
login: String,
|
||||
password: String) = withContext(coroutineDispatchers.io) {
|
||||
|
||||
val authAPI = buildAuthAPI(homeServerConnectionConfig)
|
||||
val loginParams = if (Patterns.EMAIL_ADDRESS.matcher(login).matches()) {
|
||||
PasswordLoginParams.thirdPartyIdentifier(ThreePidMedium.EMAIL, login, password, "Mobile")
|
||||
|
|
|
@ -234,7 +234,6 @@ internal class MXOlmDevice @Inject constructor(
|
|||
* @return {{payload: string, session_id: string}} decrypted payload, and session id of new session.
|
||||
*/
|
||||
fun createInboundSession(theirDeviceIdentityKey: String, messageType: Int, ciphertext: String): Map<String, String>? {
|
||||
|
||||
Timber.v("## createInboundSession() : theirIdentityKey: $theirDeviceIdentityKey")
|
||||
|
||||
var olmSession: OlmSession? = null
|
||||
|
@ -555,7 +554,6 @@ internal class MXOlmDevice @Inject constructor(
|
|||
val sessions = ArrayList<OlmInboundGroupSessionWrapper>(megolmSessionsData.size)
|
||||
|
||||
for (megolmSessionData in megolmSessionsData) {
|
||||
|
||||
val sessionId = megolmSessionData.sessionId
|
||||
val senderKey = megolmSessionData.senderKey
|
||||
val roomId = megolmSessionData.roomId
|
||||
|
|
|
@ -982,7 +982,6 @@ internal class KeysBackup @Inject constructor(
|
|||
keysBackupStateManager.state = KeysBackupState.Disabled
|
||||
} else {
|
||||
getKeysBackupTrust(keyBackupVersion, object : MatrixCallback<KeysBackupVersionTrust> {
|
||||
|
||||
override fun onSuccess(data: KeysBackupVersionTrust) {
|
||||
val versionInStore = cryptoStore.getKeyBackupVersion()
|
||||
|
||||
|
|
|
@ -111,7 +111,6 @@ internal fun ChunkEntity.add(roomId: String,
|
|||
direction: PaginationDirection,
|
||||
stateIndexOffset: Int = 0,
|
||||
isUnlinked: Boolean = false) {
|
||||
|
||||
assertIsManaged()
|
||||
if (event.eventId != null && timelineEvents.find(event.eventId) != null) {
|
||||
return
|
||||
|
|
|
@ -24,7 +24,6 @@ import im.vector.matrix.android.internal.session.pushers.JsonPusher
|
|||
internal object PushersMapper {
|
||||
|
||||
fun map(pushEntity: PusherEntity): Pusher {
|
||||
|
||||
return Pusher(
|
||||
pushKey = pushEntity.pushKey,
|
||||
kind = pushEntity.kind ?: "",
|
||||
|
|
|
@ -63,7 +63,6 @@ internal fun TimelineEventEntity.Companion.latestEvent(realm: Realm,
|
|||
includesSending: Boolean,
|
||||
includedTypes: List<String> = emptyList(),
|
||||
excludedTypes: List<String> = emptyList()): TimelineEventEntity? {
|
||||
|
||||
val roomEntity = RoomEntity.where(realm, roomId).findFirst() ?: return null
|
||||
val eventList = if (includesSending && roomEntity.sendingTimelineEvents.isNotEmpty()) {
|
||||
roomEntity.sendingTimelineEvents
|
||||
|
@ -117,7 +116,6 @@ internal fun TimelineEventEntity.Companion.findAllInRoomWithSendStates(realm: Re
|
|||
roomId: String,
|
||||
sendStates: List<SendState>)
|
||||
: RealmResults<TimelineEventEntity> {
|
||||
|
||||
val sendStatesStr = sendStates.map { it.name }.toTypedArray()
|
||||
return realm.where<TimelineEventEntity>()
|
||||
.equalTo(TimelineEventEntityFields.ROOM_ID, roomId)
|
||||
|
|
|
@ -58,7 +58,6 @@ internal class DefaultContentUrlResolver @Inject constructor(private val homeSer
|
|||
contentUrl: String,
|
||||
prefix: String,
|
||||
params: String? = null): String? {
|
||||
|
||||
var serverAndMediaId = contentUrl.removePrefix(MATRIX_CONTENT_URI_SCHEME)
|
||||
val fragmentOffset = serverAndMediaId.indexOf("#")
|
||||
var fragment = ""
|
||||
|
|
|
@ -55,7 +55,6 @@ internal object FilterUtil {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
filterBody.room?.let { room ->
|
||||
room.ephemeral?.types?.remove("m.receipt")
|
||||
if (room.ephemeral?.types?.isEmpty() == true) {
|
||||
|
|
|
@ -44,7 +44,6 @@ internal class AddHttpPusherWorker(context: Context, params: WorkerParameters)
|
|||
@Inject lateinit var monarchy: Monarchy
|
||||
|
||||
override suspend fun doWork(): Result {
|
||||
|
||||
val params = WorkerParamsFactory.fromData<Params>(inputData)
|
||||
?: return Result.failure()
|
||||
|
||||
|
|
|
@ -54,7 +54,6 @@ internal class DefaultPusherService @Inject constructor(private val context: Con
|
|||
lang: String, appDisplayName: String, deviceDisplayName: String,
|
||||
url: String, append: Boolean, withEventIdOnly: Boolean)
|
||||
: UUID {
|
||||
|
||||
val pusher = JsonPusher(
|
||||
pushKey = pushkey,
|
||||
kind = "http",
|
||||
|
|
|
@ -278,7 +278,6 @@ internal class DefaultEventRelationsAggregationTask @Inject constructor(
|
|||
} else {
|
||||
// is this a known event (is possible? pagination?)
|
||||
if (!sum.sourceEvents.contains(reactionEventId)) {
|
||||
|
||||
// check if it's not the sync of a local echo
|
||||
if (!isLocalEcho && sum.sourceLocalEcho.contains(txId)) {
|
||||
// ok it has already been counted, just sync the list, do not touch count
|
||||
|
|
|
@ -101,7 +101,6 @@ internal class DefaultReadService @AssistedInject constructor(@Assisted private
|
|||
}
|
||||
|
||||
override fun getEventReadReceiptsLive(eventId: String): LiveData<List<ReadReceipt>> {
|
||||
|
||||
val liveRealmData = monarchy.findAllMappedWithChanges(
|
||||
{ ReadReceiptsSummaryEntity.where(it, eventId) },
|
||||
{ readReceiptsSummaryMapper.map(it) }
|
||||
|
|
|
@ -76,7 +76,6 @@ internal class DefaultRelationService @AssistedInject constructor(@Assisted priv
|
|||
}
|
||||
|
||||
override fun undoReaction(reaction: String, targetEventId: String, myUserId: String)/*: Cancelable*/ {
|
||||
|
||||
val params = FindReactionEventForUndoTask.Params(
|
||||
roomId,
|
||||
targetEventId,
|
||||
|
|
|
@ -107,7 +107,6 @@ internal class TokenChunkEventPersistor @Inject constructor(private val monarchy
|
|||
suspend fun insertInDb(receivedChunk: TokenChunkEvent,
|
||||
roomId: String,
|
||||
direction: PaginationDirection): Result {
|
||||
|
||||
monarchy
|
||||
.awaitTransaction { realm ->
|
||||
Timber.v("Start persisting ${receivedChunk.events.size} events in $roomId towards $direction")
|
||||
|
@ -194,7 +193,6 @@ internal class TokenChunkEventPersistor @Inject constructor(private val monarchy
|
|||
direction: PaginationDirection,
|
||||
currentChunk: ChunkEntity,
|
||||
otherChunk: ChunkEntity): ChunkEntity {
|
||||
|
||||
// We always merge the bottom chunk into top chunk, so we are always merging backwards
|
||||
Timber.v("Merge ${currentChunk.prevToken} | ${currentChunk.nextToken} with ${otherChunk.prevToken} | ${otherChunk.nextToken}")
|
||||
return if (direction == PaginationDirection.BACKWARDS && !otherChunk.isLastForward) {
|
||||
|
|
|
@ -261,7 +261,6 @@ internal class SecretStoringUtils @Inject constructor(private val context: Conte
|
|||
}
|
||||
|
||||
private fun decryptForOldDevicesNotGood(data: ByteArray, keyAlias: String): String? {
|
||||
|
||||
val (salt, iv, encrypted) = format2Extract(ByteArrayInputStream(data))
|
||||
val factory = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA256")
|
||||
val spec = PBEKeySpec(keyAlias.toCharArray(), salt, 10_000, 128)
|
||||
|
@ -280,7 +279,6 @@ internal class SecretStoringUtils @Inject constructor(private val context: Conte
|
|||
|
||||
@RequiresApi(Build.VERSION_CODES.KITKAT)
|
||||
private fun decryptStringK(data: ByteArray, keyAlias: String): String? {
|
||||
|
||||
val (encryptedKey, iv, encrypted) = format1Extract(ByteArrayInputStream(data))
|
||||
|
||||
// we need to decrypt the key
|
||||
|
@ -411,7 +409,6 @@ internal class SecretStoringUtils @Inject constructor(private val context: Conte
|
|||
@RequiresApi(Build.VERSION_CODES.KITKAT)
|
||||
@Throws(IOException::class)
|
||||
private fun <T> loadSecureObjectK(keyAlias: String, inputStream: InputStream): T? {
|
||||
|
||||
val (encryptedKey, iv, encrypted) = format1Extract(inputStream)
|
||||
|
||||
// we need to decrypt the key
|
||||
|
|
|
@ -92,7 +92,6 @@ internal class RoomSyncHandler @Inject constructor(private val monarchy: Monarch
|
|||
// PRIVATE METHODS *****************************************************************************
|
||||
|
||||
private fun handleRoomSync(realm: Realm, handlingStrategy: HandlingStrategy, isInitialSync: Boolean, reporter: DefaultInitialSyncProgressService?) {
|
||||
|
||||
val rooms = when (handlingStrategy) {
|
||||
is HandlingStrategy.JOINED ->
|
||||
handlingStrategy.data.mapWithProgress(reporter, R.string.initial_sync_start_importing_account_joined_rooms, 0.6f) {
|
||||
|
@ -116,7 +115,6 @@ internal class RoomSyncHandler @Inject constructor(private val monarchy: Monarch
|
|||
roomId: String,
|
||||
roomSync: RoomSync,
|
||||
isInitialSync: Boolean): RoomEntity {
|
||||
|
||||
Timber.v("Handle join sync for room $roomId")
|
||||
|
||||
if (roomSync.ephemeral != null && roomSync.ephemeral.events.isNotEmpty()) {
|
||||
|
@ -194,7 +192,6 @@ internal class RoomSyncHandler @Inject constructor(private val monarchy: Monarch
|
|||
eventList: List<Event>,
|
||||
prevToken: String? = null,
|
||||
isLimited: Boolean = true): ChunkEntity {
|
||||
|
||||
val lastChunk = ChunkEntity.findLastLiveChunkFromRoom(realm, roomEntity.roomId)
|
||||
var stateIndexOffset = 0
|
||||
val chunkEntity = if (!isLimited && lastChunk != null) {
|
||||
|
|
|
@ -129,7 +129,6 @@ internal class SyncThread @Inject constructor(private val syncTask: SyncTask,
|
|||
this.callbackThread = TaskThread.SYNC
|
||||
this.executionThread = TaskThread.SYNC
|
||||
this.callback = object : MatrixCallback<Unit> {
|
||||
|
||||
override fun onSuccess(data: Unit) {
|
||||
Timber.v("onSuccess")
|
||||
latch.countDown()
|
||||
|
|
|
@ -34,7 +34,6 @@ internal class TaskExecutor @Inject constructor(private val coroutineDispatchers
|
|||
private val executorScope = CoroutineScope(SupervisorJob())
|
||||
|
||||
fun <PARAMS, RESULT> execute(task: ConfigurableTask<PARAMS, RESULT>): Cancelable {
|
||||
|
||||
val job = executorScope.launch(task.callbackThread.toDispatcher()) {
|
||||
val resultOrFailure = runCatching {
|
||||
withContext(task.executionThread.toDispatcher()) {
|
||||
|
@ -66,7 +65,6 @@ internal class TaskExecutor @Inject constructor(private val coroutineDispatchers
|
|||
maxDelay: Long = 10_000, // 10 second
|
||||
factor: Double = 2.0,
|
||||
block: suspend () -> T): T {
|
||||
|
||||
var currentDelay = initialDelay
|
||||
repeat(times - 1) {
|
||||
try {
|
||||
|
|
|
@ -240,7 +240,6 @@ object CompatUtil {
|
|||
KeyStoreException::class,
|
||||
IllegalBlockSizeException::class)
|
||||
fun createCipherOutputStream(out: OutputStream, context: Context): OutputStream? {
|
||||
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) {
|
||||
return out
|
||||
}
|
||||
|
|
|
@ -24,7 +24,6 @@ object LiveDataUtils {
|
|||
fun <FIRST, SECOND, OUT> combine(firstSource: LiveData<FIRST>,
|
||||
secondSource: LiveData<SECOND>,
|
||||
mapper: (FIRST, SECOND) -> OUT): LiveData<OUT> {
|
||||
|
||||
return MediatorLiveData<OUT>().apply {
|
||||
var firstValue: FIRST? = null
|
||||
var secondValue: SECOND? = null
|
||||
|
|
|
@ -128,7 +128,6 @@ class PushrulesConditionTest {
|
|||
|
||||
@Test
|
||||
fun test_roommember_condition() {
|
||||
|
||||
val conditionEqual3 = RoomMemberCountCondition("3")
|
||||
val conditionEqual3Bis = RoomMemberCountCondition("==3")
|
||||
val conditionLessThan3 = RoomMemberCountCondition("<3")
|
||||
|
|
|
@ -26,7 +26,6 @@ import im.vector.riotx.features.settings.troubleshoot.TroubleshootTest
|
|||
class TestBatteryOptimization(val fragment: Fragment) : TroubleshootTest(R.string.settings_troubleshoot_test_battery_title) {
|
||||
|
||||
override fun perform() {
|
||||
|
||||
if (fragment.context != null && isIgnoringBatteryOptimizations(fragment.context!!)) {
|
||||
description = fragment.getString(R.string.settings_troubleshoot_test_battery_success)
|
||||
status = TestStatus.SUCCESS
|
||||
|
|
|
@ -31,7 +31,6 @@ import timber.log.Timber
|
|||
class AlarmSyncBroadcastReceiver : BroadcastReceiver() {
|
||||
|
||||
override fun onReceive(context: Context, intent: Intent) {
|
||||
|
||||
// Aquire a lock to give enough time for the sync :/
|
||||
(context.getSystemService(Context.POWER_SERVICE) as PowerManager).run {
|
||||
newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "riotx:fdroidSynclock").apply {
|
||||
|
|
|
@ -174,7 +174,6 @@ class VectorFirebaseMessagingService : FirebaseMessagingService() {
|
|||
}
|
||||
|
||||
private fun handleNotificationWithoutSyncingMode(data: Map<String, String>, session: Session?) {
|
||||
|
||||
if (session == null) {
|
||||
Timber.e("## handleNotificationWithoutSyncingMode cannot find session")
|
||||
return
|
||||
|
|
|
@ -29,7 +29,6 @@ class EmojiCompatWrapper @Inject constructor(private val context: Context) {
|
|||
private var initialized = false
|
||||
|
||||
fun init(fontRequest: FontRequest) {
|
||||
|
||||
// Use emoji compat for the benefit of emoji spans
|
||||
val config = FontRequestEmojiCompatConfig(context, fontRequest)
|
||||
// we want to replace all emojis with selected font
|
||||
|
|
|
@ -119,7 +119,6 @@ class VectorApplication : Application(), HasVectorInjector, MatrixConfiguration.
|
|||
lastAuthenticatedSession.configureAndStart(pushRuleTriggerListener, sessionListener)
|
||||
}
|
||||
ProcessLifecycleOwner.get().lifecycle.addObserver(object : LifecycleObserver {
|
||||
|
||||
@OnLifecycleEvent(Lifecycle.Event.ON_RESUME)
|
||||
fun entersForeground() {
|
||||
FcmHelper.onEnterForeground(appContext)
|
||||
|
|
|
@ -28,7 +28,6 @@ import im.vector.riotx.core.platform.SimpleTextWatcher
|
|||
|
||||
fun EditText.setupAsSearch(@DrawableRes searchIconRes: Int = R.drawable.ic_filter,
|
||||
@DrawableRes clearIconRes: Int = R.drawable.ic_x_green) {
|
||||
|
||||
addTextChangedListener(object : SimpleTextWatcher() {
|
||||
override fun afterTextChanged(s: Editable) {
|
||||
val clearIcon = if (s.isNotEmpty()) clearIconRes else 0
|
||||
|
|
|
@ -42,7 +42,6 @@ abstract class GenericFooterItem : VectorEpoxyModel<GenericFooterItem.Holder>()
|
|||
var itemClickAction: GenericItem.Action? = null
|
||||
|
||||
override fun bind(holder: Holder) {
|
||||
|
||||
holder.text.setTextOrHide(text)
|
||||
when (style) {
|
||||
GenericItem.STYLE.BIG_TEXT -> holder.text.textSize = 18f
|
||||
|
|
|
@ -237,7 +237,6 @@ fun openMedia(activity: Activity, savedMediaPath: String, mimeType: String) {
|
|||
}
|
||||
|
||||
fun shareMedia(context: Context, file: File, mediaMimeType: String?) {
|
||||
|
||||
var mediaUri: Uri? = null
|
||||
try {
|
||||
mediaUri = FileProvider.getUriForFile(context, BuildConfig.APPLICATION_ID + ".fileProvider", file)
|
||||
|
|
|
@ -37,7 +37,6 @@ class KeysExporter(private val session: Session) {
|
|||
*/
|
||||
fun export(context: Context, password: String, callback: MatrixCallback<String>) {
|
||||
session.exportRoomKeys(password, object : MatrixCallback<ByteArray> {
|
||||
|
||||
override fun onSuccess(data: ByteArray) {
|
||||
GlobalScope.launch(Dispatchers.Main) {
|
||||
withContext(Dispatchers.IO) {
|
||||
|
|
|
@ -102,7 +102,6 @@ class KeysBackupRestoreFromKeyViewModel @Inject constructor() : ViewModel() {
|
|||
private fun trustOnDecrypt(keysBackup: KeysBackupService, keysVersionResult: KeysVersionResult) {
|
||||
keysBackup.trustKeysBackupVersion(keysVersionResult, true,
|
||||
object : MatrixCallback<Unit> {
|
||||
|
||||
override fun onSuccess(data: Unit) {
|
||||
Timber.v("##### trustKeysBackupVersion onSuccess")
|
||||
}
|
||||
|
|
|
@ -109,7 +109,6 @@ class KeysBackupRestoreFromPassphraseViewModel @Inject constructor() : ViewModel
|
|||
private fun trustOnDecrypt(keysBackup: KeysBackupService, keysVersionResult: KeysVersionResult) {
|
||||
keysBackup.trustKeysBackupVersion(keysVersionResult, true,
|
||||
object : MatrixCallback<Unit> {
|
||||
|
||||
override fun onSuccess(data: Unit) {
|
||||
Timber.v("##### trustKeysBackupVersion onSuccess")
|
||||
}
|
||||
|
|
|
@ -139,7 +139,6 @@ class KeysBackupSetupActivity : SimpleFragmentActivity() {
|
|||
.export(this@KeysBackupSetupActivity,
|
||||
passphrase,
|
||||
object : MatrixCallback<String> {
|
||||
|
||||
override fun onSuccess(data: String) {
|
||||
hideWaitingView()
|
||||
|
||||
|
|
|
@ -303,7 +303,6 @@ class RoomDetailFragment :
|
|||
|
||||
private fun setupNotificationView() {
|
||||
notificationAreaView.delegate = object : NotificationAreaView.Delegate {
|
||||
|
||||
override fun onTombstoneEventClicked(tombstoneEvent: Event) {
|
||||
roomDetailViewModel.process(RoomDetailActions.HandleTombstoneEvent(tombstoneEvent))
|
||||
}
|
||||
|
@ -453,7 +452,6 @@ class RoomDetailFragment :
|
|||
}
|
||||
recyclerView.setController(timelineEventController)
|
||||
recyclerView.addOnScrollListener(object : RecyclerView.OnScrollListener() {
|
||||
|
||||
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
|
||||
if (recyclerView.scrollState == RecyclerView.SCROLL_STATE_IDLE) {
|
||||
updateJumpToBottomViewVisibility()
|
||||
|
@ -702,7 +700,6 @@ class RoomDetailFragment :
|
|||
|
||||
private fun renderRoomSummary(state: RoomDetailViewState) {
|
||||
state.asyncRoomSummary()?.let {
|
||||
|
||||
if (it.membership.isLeft()) {
|
||||
Timber.w("The room has been left")
|
||||
activity?.finish()
|
||||
|
|
|
@ -74,7 +74,6 @@ class TextComposerView @JvmOverloads constructor(context: Context, attrs: Attrib
|
|||
val transition = AutoTransition()
|
||||
transition.duration = animationDuration
|
||||
transition.addListener(object : Transition.TransitionListener {
|
||||
|
||||
override fun onTransitionEnd(transition: Transition) {
|
||||
transitionComplete?.invoke()
|
||||
}
|
||||
|
@ -106,7 +105,6 @@ class TextComposerView @JvmOverloads constructor(context: Context, attrs: Attrib
|
|||
val transition = AutoTransition()
|
||||
transition.duration = animationDuration
|
||||
transition.addListener(object : Transition.TransitionListener {
|
||||
|
||||
override fun onTransitionEnd(transition: Transition) {
|
||||
transitionComplete?.invoke()
|
||||
}
|
||||
|
|
|
@ -102,7 +102,6 @@ class MessageActionsBottomSheet : VectorBaseBottomSheetDialogFragment() {
|
|||
.commit()
|
||||
}
|
||||
quickReactionFragment.interactionListener = object : QuickReactionFragment.InteractionListener {
|
||||
|
||||
override fun didQuickReactWith(clickedOn: String, add: Boolean, eventId: String) {
|
||||
actionHandlerModel.fireAction(SimpleAction.QuickReact(eventId, clickedOn, add))
|
||||
dismiss()
|
||||
|
|
|
@ -172,7 +172,6 @@ class MessageMenuViewModel @AssistedInject constructor(@Assisted initialState: M
|
|||
}
|
||||
|
||||
if (event.root.sendState == SendState.SENT) {
|
||||
|
||||
// TODO Can be redacted
|
||||
|
||||
// TODO sent by me or sufficient power level
|
||||
|
|
|
@ -34,7 +34,6 @@ class DefaultItemFactory @Inject constructor(private val avatarSizeProvider: Ava
|
|||
informationData: MessageInformationData,
|
||||
highlight: Boolean,
|
||||
callback: TimelineEventController.Callback?): DefaultItem {
|
||||
|
||||
return DefaultItem_()
|
||||
.leftGuideline(avatarSizeProvider.leftGuideline)
|
||||
.highlighted(highlight)
|
||||
|
|
|
@ -41,7 +41,6 @@ class EncryptionItemFactory @Inject constructor(private val stringProvider: Stri
|
|||
fun create(event: TimelineEvent,
|
||||
highlight: Boolean,
|
||||
callback: TimelineEventController.Callback?): NoticeItem? {
|
||||
|
||||
val text = buildNoticeText(event.root, event.senderName) ?: return null
|
||||
val informationData = MessageInformationData(
|
||||
eventId = event.root.eventId ?: "?",
|
||||
|
|
|
@ -42,7 +42,6 @@ class MergedHeaderItemFactory @Inject constructor(private val sessionHolder: Act
|
|||
callback: TimelineEventController.Callback?,
|
||||
requestModelBuild: () -> Unit)
|
||||
: MergedHeaderItem? {
|
||||
|
||||
return if (!event.canBeMerged() || (nextEvent?.root?.getClearType() == event.root.getClearType() && !addDaySeparator)) {
|
||||
null
|
||||
} else {
|
||||
|
|
|
@ -166,7 +166,6 @@ class MessageItemFactory @Inject constructor(
|
|||
highlight: Boolean,
|
||||
callback: TimelineEventController.Callback?,
|
||||
attributes: AbsMessageItem.Attributes): MessageImageVideoItem? {
|
||||
|
||||
val (maxWidth, maxHeight) = timelineMediaSizeProvider.getMaxSize()
|
||||
val data = ImageContentRenderer.Data(
|
||||
filename = messageContent.body,
|
||||
|
@ -196,7 +195,6 @@ class MessageItemFactory @Inject constructor(
|
|||
highlight: Boolean,
|
||||
callback: TimelineEventController.Callback?,
|
||||
attributes: AbsMessageItem.Attributes): MessageImageVideoItem? {
|
||||
|
||||
val (maxWidth, maxHeight) = timelineMediaSizeProvider.getMaxSize()
|
||||
val thumbnailData = ImageContentRenderer.Data(
|
||||
filename = messageContent.body,
|
||||
|
@ -233,7 +231,6 @@ class MessageItemFactory @Inject constructor(
|
|||
highlight: Boolean,
|
||||
callback: TimelineEventController.Callback?,
|
||||
attributes: AbsMessageItem.Attributes): MessageTextItem? {
|
||||
|
||||
val isFormatted = messageContent.formattedBody.isNullOrBlank().not()
|
||||
val bodyToUse = messageContent.formattedBody?.let {
|
||||
htmlRenderer.get().render(it.trim())
|
||||
|
@ -296,7 +293,6 @@ class MessageItemFactory @Inject constructor(
|
|||
highlight: Boolean,
|
||||
callback: TimelineEventController.Callback?,
|
||||
attributes: AbsMessageItem.Attributes): MessageTextItem? {
|
||||
|
||||
val message = messageContent.body.let {
|
||||
val formattedBody = span {
|
||||
text = it
|
||||
|
@ -318,7 +314,6 @@ class MessageItemFactory @Inject constructor(
|
|||
highlight: Boolean,
|
||||
callback: TimelineEventController.Callback?,
|
||||
attributes: AbsMessageItem.Attributes): MessageTextItem? {
|
||||
|
||||
val message = messageContent.body.let {
|
||||
val formattedBody = "* ${informationData.memberName} $it"
|
||||
linkifyBody(formattedBody, callback)
|
||||
|
|
|
@ -36,7 +36,6 @@ class NoticeItemFactory @Inject constructor(private val eventFormatter: NoticeEv
|
|||
highlight: Boolean,
|
||||
readMarkerVisible: Boolean,
|
||||
callback: TimelineEventController.Callback?): NoticeItem? {
|
||||
|
||||
val formattedText = eventFormatter.format(event) ?: return null
|
||||
val informationData = informationDataFactory.create(event, null, readMarkerVisible)
|
||||
val attributes = NoticeItem.Attributes(
|
||||
|
|
|
@ -35,7 +35,6 @@ class TimelineItemFactory @Inject constructor(private val messageItemFactory: Me
|
|||
eventIdToHighlight: String?,
|
||||
readMarkerVisible: Boolean,
|
||||
callback: TimelineEventController.Callback?): VectorEpoxyModel<*> {
|
||||
|
||||
val highlight = event.root.eventId == eventIdToHighlight
|
||||
|
||||
val computedModel = try {
|
||||
|
|
|
@ -40,7 +40,6 @@ class ContentUploadStateTrackerBinder @Inject constructor(private val activeSess
|
|||
fun bind(eventId: String,
|
||||
isLocalFile: Boolean,
|
||||
progressLayout: ViewGroup) {
|
||||
|
||||
activeSessionHolder.getActiveSession().also { session ->
|
||||
val uploadStateTracker = session.contentUploadProgressTracker()
|
||||
val updateListener = ContentMediaProgressUpdater(progressLayout, isLocalFile, colorProvider, errorFormatter)
|
||||
|
|
|
@ -37,7 +37,6 @@ class MessageItemAttributesFactory @Inject constructor(
|
|||
fun create(messageContent: MessageContent?,
|
||||
informationData: MessageInformationData,
|
||||
callback: TimelineEventController.Callback?): AbsMessageItem.Attributes {
|
||||
|
||||
return AbsMessageItem.Attributes(
|
||||
avatarSize = avatarSizeProvider.avatarSize,
|
||||
informationData = informationData,
|
||||
|
|
|
@ -271,7 +271,6 @@ class LoginSsoFallbackFragment : VectorBaseFragment(), OnBackPressed {
|
|||
if (parameters.containsKey("homeServer")
|
||||
&& parameters.containsKey("userId")
|
||||
&& parameters.containsKey("accessToken")) {
|
||||
|
||||
// We cannot parse Credentials here because of https://github.com/matrix-org/synapse/issues/4756
|
||||
// Build on object manually
|
||||
val credentials = Credentials(
|
||||
|
|
|
@ -89,7 +89,6 @@ class VideoContentRenderer @Inject constructor(private val activeSessionHolder:
|
|||
})
|
||||
}
|
||||
} else {
|
||||
|
||||
val resolvedUrl = contentUrlResolver.resolveFullSize(data.url)
|
||||
|
||||
if (resolvedUrl == null) {
|
||||
|
@ -98,7 +97,6 @@ class VideoContentRenderer @Inject constructor(private val activeSessionHolder:
|
|||
errorView.isVisible = true
|
||||
errorView.setText(R.string.unknown_error)
|
||||
} else {
|
||||
|
||||
// Temporary code, some remote videos are not played by videoview setVideoUri
|
||||
// So for now we download them then play
|
||||
thumbnailView.isVisible = true
|
||||
|
|
|
@ -64,7 +64,6 @@ class NotifiableEventResolver @Inject constructor(private val stringProvider: St
|
|||
return resolveStateRoomEvent(event, session)
|
||||
}
|
||||
else -> {
|
||||
|
||||
// If the event can be displayed, display it as is
|
||||
Timber.w("NotifiableEventResolver Received an unsupported event matching a bing rule")
|
||||
// TODO Better event text display
|
||||
|
@ -85,7 +84,6 @@ class NotifiableEventResolver @Inject constructor(private val stringProvider: St
|
|||
}
|
||||
|
||||
private fun resolveMessageEvent(event: TimelineEvent, session: Session): NotifiableEvent? {
|
||||
|
||||
// The event only contains an eventId, and roomId (type is m.room.*) , we need to get the displayable content (names, avatar, text, etc...)
|
||||
val room = session.getRoom(event.root.roomId!! /*roomID cannot be null*/)
|
||||
|
||||
|
|
|
@ -109,7 +109,6 @@ class NotificationBroadcastReceiver : BroadcastReceiver() {
|
|||
}
|
||||
|
||||
private fun sendMatrixEvent(message: String, session: Session, room: Room, context: Context?) {
|
||||
|
||||
room.sendTextMessage(message)
|
||||
|
||||
// Create a new event to be displayed in the notification drawer, right now
|
||||
|
|
|
@ -207,7 +207,6 @@ class NotificationDrawerManager @Inject constructor(private val context: Context
|
|||
val myUserDisplayName = user?.displayName?.takeIf { it.isNotBlank() } ?: session.myUserId
|
||||
val myUserAvatarUrl = session.contentUrlResolver().resolveThumbnail(user?.avatarUrl, avatarSize, avatarSize, ContentUrlResolver.ThumbnailMethod.SCALE)
|
||||
synchronized(eventList) {
|
||||
|
||||
Timber.v("%%%%%%%% REFRESH NOTIFICATION DRAWER ")
|
||||
// TMP code
|
||||
var hasNewEvent = false
|
||||
|
|
|
@ -322,7 +322,6 @@ class NotificationUtils @Inject constructor(private val context: Context,
|
|||
roomId: String,
|
||||
matrixId: String,
|
||||
callId: String): Notification {
|
||||
|
||||
val builder = NotificationCompat.Builder(context, CALL_NOTIFICATION_CHANNEL_ID)
|
||||
.setContentTitle(ensureTitleNotEmpty(roomName))
|
||||
.apply {
|
||||
|
|
|
@ -166,7 +166,6 @@ object PopupAlertManager {
|
|||
.setTitle(alert.title)
|
||||
.setText(alert.description)
|
||||
.apply {
|
||||
|
||||
if (!animate) {
|
||||
setEnterAnimation(R.anim.anim_alerter_no_anim)
|
||||
}
|
||||
|
|
|
@ -149,7 +149,6 @@ class BugReporter @Inject constructor(private val activeSessionHolder: ActiveSes
|
|||
theBugDescription: String,
|
||||
listener: IMXBugReportListener?) {
|
||||
object : AsyncTask<Void, Int, String>() {
|
||||
|
||||
// enumerate files to delete
|
||||
val mBugReportFiles: MutableList<File> = ArrayList()
|
||||
|
||||
|
|
|
@ -138,7 +138,6 @@ class EmojiReactionPickerActivity : VectorBaseActivity(), EmojiCompatFontProvide
|
|||
|
||||
val searchItem = menu.findItem(R.id.search)
|
||||
(searchItem.actionView as? SearchView)?.let {
|
||||
|
||||
searchItem.setOnActionExpandListener(object : MenuItem.OnActionExpandListener {
|
||||
override fun onMenuItemActionExpand(p0: MenuItem?): Boolean {
|
||||
it.isIconified = false
|
||||
|
|
|
@ -160,7 +160,6 @@ class ReactionButton @JvmOverloads constructor(context: Context, attrs: Attribut
|
|||
* @param v
|
||||
*/
|
||||
override fun onClick(v: View) {
|
||||
|
||||
if (!isEnabled) {
|
||||
return
|
||||
}
|
||||
|
|
|
@ -45,7 +45,6 @@ class VectorSettingsHelpAboutFragment : VectorSettingsBaseFragment() {
|
|||
// preference to start the App info screen, to facilitate App permissions access
|
||||
findPreference<VectorPreference>(APP_INFO_LINK_PREFERENCE_KEY)!!
|
||||
.onPreferenceClickListener = Preference.OnPreferenceClickListener {
|
||||
|
||||
activity?.let {
|
||||
val intent = Intent().apply {
|
||||
action = Settings.ACTION_APPLICATION_DETAILS_SETTINGS
|
||||
|
|
|
@ -67,7 +67,6 @@ class VectorSettingsNotificationPreferenceFragment : VectorSettingsBaseFragment(
|
|||
}
|
||||
|
||||
override fun onPreferenceTreeClick(preference: Preference?): Boolean {
|
||||
|
||||
return when (preference?.key) {
|
||||
VectorPreferences.SETTINGS_ENABLE_THIS_DEVICE_PREFERENCE_KEY -> {
|
||||
updateEnabledForDevice(preference)
|
||||
|
@ -119,7 +118,6 @@ class VectorSettingsNotificationPreferenceFragment : VectorSettingsBaseFragment(
|
|||
it,
|
||||
!switchPref.isChecked,
|
||||
object : MatrixCallback<Unit> {
|
||||
|
||||
override fun onSuccess(data: Unit) {
|
||||
// Push rules will be updated form the sync
|
||||
}
|
||||
|
|
|
@ -87,7 +87,6 @@ class VectorSettingsNotificationsTroubleshootFragment : VectorBaseFragment() {
|
|||
}
|
||||
|
||||
private fun startUI() {
|
||||
|
||||
mSummaryDescription.text = getString(R.string.settings_troubleshoot_diagnostic_running_status,
|
||||
0, 0)
|
||||
testManager = testManagerFactory.create(this)
|
||||
|
|
|
@ -560,9 +560,7 @@ class VectorSettingsSecurityPrivacyFragment : VectorSettingsBaseFragment() {
|
|||
* @param aDeviceInfo the device information
|
||||
*/
|
||||
private fun displayDeviceDetailsDialog(aDeviceInfo: DeviceInfo) {
|
||||
|
||||
activity?.let {
|
||||
|
||||
val builder = AlertDialog.Builder(it)
|
||||
val inflater = it.layoutInflater
|
||||
val layout = inflater.inflate(R.layout.dialog_device_details, null)
|
||||
|
|
|
@ -66,7 +66,6 @@ class NotificationTroubleshootRecyclerViewAdapter(val tests: ArrayList<Troublesh
|
|||
}
|
||||
|
||||
fun bind(test: TroubleshootTest) {
|
||||
|
||||
val context = itemView.context
|
||||
titleText.setTextColor(ThemeUtils.getColor(context, R.attr.riotx_text_primary))
|
||||
descriptionText.setTextColor(ThemeUtils.getColor(context, R.attr.riotx_text_secondary))
|
||||
|
|
|
@ -48,7 +48,6 @@ class TestAccountSettings @Inject constructor(private val stringProvider: String
|
|||
|
||||
session.updatePushRuleEnableStatus(RuleKind.OVERRIDE, defaultRule, !defaultRule.enabled,
|
||||
object : MatrixCallback<Unit> {
|
||||
|
||||
override fun onSuccess(data: Unit) {
|
||||
manager?.retry()
|
||||
}
|
||||
|
|
|
@ -28,7 +28,6 @@ class TestDeviceSettings @Inject constructor(private val vectorPreferences: Vect
|
|||
: TroubleshootTest(R.string.settings_troubleshoot_test_device_settings_title) {
|
||||
|
||||
override fun perform() {
|
||||
|
||||
if (vectorPreferences.areNotificationEnabledForDevice()) {
|
||||
description = stringProvider.getString(R.string.settings_troubleshoot_test_device_settings_success)
|
||||
quickFix = null
|
||||
|
|
Loading…
Reference in a new issue