mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-20 12:09:45 +01:00
line length 1220 characters
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
f4cfc9cef3
commit
f8a8b81ef7
@ -182,7 +182,11 @@ class MagicIncomingTextMessageViewHolder(incomingView: View) : MessageHolders
|
|||||||
for (key in messageParameters.keys) {
|
for (key in messageParameters.keys) {
|
||||||
val individualHashMap = message.messageParameters[key]
|
val individualHashMap = message.messageParameters[key]
|
||||||
if (individualHashMap != null) {
|
if (individualHashMap != null) {
|
||||||
if (individualHashMap["type"] == "user" || individualHashMap["type"] == "guest" || individualHashMap["type"] == "call") {
|
if (
|
||||||
|
individualHashMap["type"] == "user" ||
|
||||||
|
individualHashMap["type"] == "guest" ||
|
||||||
|
individualHashMap["type"] == "call"
|
||||||
|
) {
|
||||||
if (individualHashMap["id"] == message.activeUser!!.userId) {
|
if (individualHashMap["id"] == message.activeUser!!.userId) {
|
||||||
messageString = DisplayUtils.searchAndReplaceWithMentionSpan(
|
messageString = DisplayUtils.searchAndReplaceWithMentionSpan(
|
||||||
messageText!!.context,
|
messageText!!.context,
|
||||||
|
@ -77,7 +77,16 @@ import java.util.concurrent.TimeUnit
|
|||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
import javax.inject.Singleton
|
import javax.inject.Singleton
|
||||||
|
|
||||||
@AutoComponent(modules = [BusModule::class, ContextModule::class, DatabaseModule::class, RestModule::class, UserModule::class, ArbitraryStorageModule::class])
|
@AutoComponent(
|
||||||
|
modules = [
|
||||||
|
BusModule::class,
|
||||||
|
ContextModule::class,
|
||||||
|
DatabaseModule::class,
|
||||||
|
RestModule::class,
|
||||||
|
UserModule::class,
|
||||||
|
ArbitraryStorageModule::class
|
||||||
|
]
|
||||||
|
)
|
||||||
@Singleton
|
@Singleton
|
||||||
@AutoInjector(NextcloudTalkApplication::class)
|
@AutoInjector(NextcloudTalkApplication::class)
|
||||||
class NextcloudTalkApplication : MultiDexApplication(), LifecycleObserver {
|
class NextcloudTalkApplication : MultiDexApplication(), LifecycleObserver {
|
||||||
|
@ -1650,7 +1650,9 @@ class ChatController(args: Bundle) :
|
|||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribe(object : Observer<RoomOverall> {
|
.subscribe(object : Observer<RoomOverall> {
|
||||||
override fun onSubscribe(d: Disposable) {}
|
override fun onSubscribe(d: Disposable) {
|
||||||
|
// unused atm
|
||||||
|
}
|
||||||
override fun onNext(roomOverall: RoomOverall) {
|
override fun onNext(roomOverall: RoomOverall) {
|
||||||
val bundle = Bundle()
|
val bundle = Bundle()
|
||||||
bundle.putParcelable(KEY_USER_ENTITY, conversationUser)
|
bundle.putParcelable(KEY_USER_ENTITY, conversationUser)
|
||||||
|
@ -241,7 +241,10 @@ class ContactAddressBookWorker(val context: Context, workerParameters: WorkerPar
|
|||||||
fun hasLinkedAccount(id: String): Boolean {
|
fun hasLinkedAccount(id: String): Boolean {
|
||||||
var hasLinkedAccount = false
|
var hasLinkedAccount = false
|
||||||
val where =
|
val where =
|
||||||
ContactsContract.Data.MIMETYPE + " = ? AND " + ContactsContract.CommonDataKinds.StructuredName.CONTACT_ID + " = ?"
|
ContactsContract.Data.MIMETYPE +
|
||||||
|
" = ? AND " +
|
||||||
|
ContactsContract.CommonDataKinds.StructuredName.CONTACT_ID +
|
||||||
|
" = ?"
|
||||||
val params = arrayOf(ContactsContract.CommonDataKinds.StructuredName.CONTENT_ITEM_TYPE, id)
|
val params = arrayOf(ContactsContract.CommonDataKinds.StructuredName.CONTENT_ITEM_TYPE, id)
|
||||||
|
|
||||||
val rawContactUri = ContactsContract.Data.CONTENT_URI
|
val rawContactUri = ContactsContract.Data.CONTENT_URI
|
||||||
@ -393,7 +396,10 @@ class ContactAddressBookWorker(val context: Context, workerParameters: WorkerPar
|
|||||||
private fun getDisplayNameFromDeviceContact(id: String?): String? {
|
private fun getDisplayNameFromDeviceContact(id: String?): String? {
|
||||||
var displayName: String? = null
|
var displayName: String? = null
|
||||||
val whereName =
|
val whereName =
|
||||||
ContactsContract.Data.MIMETYPE + " = ? AND " + ContactsContract.CommonDataKinds.StructuredName.CONTACT_ID + " = ?"
|
ContactsContract.Data.MIMETYPE +
|
||||||
|
" = ? AND " +
|
||||||
|
ContactsContract.CommonDataKinds.StructuredName.CONTACT_ID +
|
||||||
|
" = ?"
|
||||||
val whereNameParams = arrayOf(ContactsContract.CommonDataKinds.StructuredName.CONTENT_ITEM_TYPE, id)
|
val whereNameParams = arrayOf(ContactsContract.CommonDataKinds.StructuredName.CONTENT_ITEM_TYPE, id)
|
||||||
val nameCursor = context.contentResolver.query(
|
val nameCursor = context.contentResolver.query(
|
||||||
ContactsContract.Data.CONTENT_URI,
|
ContactsContract.Data.CONTENT_URI,
|
||||||
@ -405,7 +411,9 @@ class ContactAddressBookWorker(val context: Context, workerParameters: WorkerPar
|
|||||||
if (nameCursor != null) {
|
if (nameCursor != null) {
|
||||||
while (nameCursor.moveToNext()) {
|
while (nameCursor.moveToNext()) {
|
||||||
displayName =
|
displayName =
|
||||||
nameCursor.getString(nameCursor.getColumnIndex(ContactsContract.CommonDataKinds.StructuredName.DISPLAY_NAME))
|
nameCursor.getString(
|
||||||
|
nameCursor.getColumnIndex(ContactsContract.CommonDataKinds.StructuredName.DISPLAY_NAME)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
nameCursor.close()
|
nameCursor.close()
|
||||||
}
|
}
|
||||||
@ -424,7 +432,11 @@ class ContactAddressBookWorker(val context: Context, workerParameters: WorkerPar
|
|||||||
|
|
||||||
if (phonesNumbersCursor != null) {
|
if (phonesNumbersCursor != null) {
|
||||||
while (phonesNumbersCursor.moveToNext()) {
|
while (phonesNumbersCursor.moveToNext()) {
|
||||||
numbers.add(phonesNumbersCursor.getString(phonesNumbersCursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER)))
|
numbers.add(
|
||||||
|
phonesNumbersCursor.getString(
|
||||||
|
phonesNumbersCursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER)
|
||||||
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
phonesNumbersCursor.close()
|
phonesNumbersCursor.close()
|
||||||
}
|
}
|
||||||
|
@ -71,8 +71,10 @@ class PackageReplacedReceiver : BroadcastReceiver() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!appPreferences.isNotificationChannelUpgradedToV3 && packageInfo.versionCode > 51) {
|
if (!appPreferences.isNotificationChannelUpgradedToV3 && packageInfo.versionCode > 51) {
|
||||||
notificationManager.deleteNotificationChannel(NotificationUtils.NOTIFICATION_CHANNEL_MESSAGES_V2)
|
notificationManager
|
||||||
notificationManager.deleteNotificationChannel(NotificationUtils.NOTIFICATION_CHANNEL_CALLS_V2)
|
.deleteNotificationChannel(NotificationUtils.NOTIFICATION_CHANNEL_MESSAGES_V2)
|
||||||
|
notificationManager
|
||||||
|
.deleteNotificationChannel(NotificationUtils.NOTIFICATION_CHANNEL_CALLS_V2)
|
||||||
appPreferences.setNotificationChannelIsUpgradedToV3(true)
|
appPreferences.setNotificationChannelIsUpgradedToV3(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,8 +55,14 @@ object AccountUtils {
|
|||||||
internalUserEntity = userEntitiesList[i]
|
internalUserEntity = userEntitiesList[i]
|
||||||
importAccount = getInformationFromAccount(account)
|
importAccount = getInformationFromAccount(account)
|
||||||
if (importAccount.token != null) {
|
if (importAccount.token != null) {
|
||||||
if (importAccount.baseUrl.startsWith("http://") || importAccount.baseUrl.startsWith("https://")) {
|
if (
|
||||||
if (internalUserEntity.username == importAccount.username && internalUserEntity.baseUrl == importAccount.baseUrl) {
|
importAccount.baseUrl.startsWith("http://") ||
|
||||||
|
importAccount.baseUrl.startsWith("https://")
|
||||||
|
) {
|
||||||
|
if (
|
||||||
|
internalUserEntity.username == importAccount.username &&
|
||||||
|
internalUserEntity.baseUrl == importAccount.baseUrl
|
||||||
|
) {
|
||||||
accountFound = true
|
accountFound = true
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
@ -85,7 +85,10 @@ object NotificationUtils {
|
|||||||
|
|
||||||
val notificationManager = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
|
val notificationManager = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && notificationManager.getNotificationChannel(channelId) == null) {
|
if (
|
||||||
|
Build.VERSION.SDK_INT >= Build.VERSION_CODES.O &&
|
||||||
|
notificationManager.getNotificationChannel(channelId) == null
|
||||||
|
) {
|
||||||
|
|
||||||
val channel = NotificationChannel(
|
val channel = NotificationChannel(
|
||||||
channelId, channelName,
|
channelId, channelName,
|
||||||
@ -156,9 +159,9 @@ object NotificationUtils {
|
|||||||
notification = statusBarNotification.notification
|
notification = statusBarNotification.notification
|
||||||
|
|
||||||
if (notification != null && !notification.extras.isEmpty) {
|
if (notification != null && !notification.extras.isEmpty) {
|
||||||
if (conversationUser.id == notification.extras.getLong(BundleKeys.KEY_INTERNAL_USER_ID) && notificationId == notification.extras.getLong(
|
if (
|
||||||
BundleKeys.KEY_NOTIFICATION_ID
|
conversationUser.id == notification.extras.getLong(BundleKeys.KEY_INTERNAL_USER_ID) &&
|
||||||
)
|
notificationId == notification.extras.getLong(BundleKeys.KEY_NOTIFICATION_ID)
|
||||||
) {
|
) {
|
||||||
notificationManager.cancel(statusBarNotification.id)
|
notificationManager.cancel(statusBarNotification.id)
|
||||||
}
|
}
|
||||||
@ -184,9 +187,9 @@ object NotificationUtils {
|
|||||||
notification = statusBarNotification.notification
|
notification = statusBarNotification.notification
|
||||||
|
|
||||||
if (notification != null && !notification.extras.isEmpty) {
|
if (notification != null && !notification.extras.isEmpty) {
|
||||||
if (conversationUser.id == notification.extras.getLong(BundleKeys.KEY_INTERNAL_USER_ID) && roomTokenOrId == statusBarNotification.notification.extras.getString(
|
if (
|
||||||
BundleKeys.KEY_ROOM_TOKEN
|
conversationUser.id == notification.extras.getLong(BundleKeys.KEY_INTERNAL_USER_ID) &&
|
||||||
)
|
roomTokenOrId == statusBarNotification.notification.extras.getString(BundleKeys.KEY_ROOM_TOKEN)
|
||||||
) {
|
) {
|
||||||
return statusBarNotification
|
return statusBarNotification
|
||||||
}
|
}
|
||||||
@ -202,7 +205,9 @@ object NotificationUtils {
|
|||||||
conversationUser: UserEntity,
|
conversationUser: UserEntity,
|
||||||
roomTokenOrId: String
|
roomTokenOrId: String
|
||||||
) {
|
) {
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && conversationUser.id != -1L &&
|
if (
|
||||||
|
Build.VERSION.SDK_INT >= Build.VERSION_CODES.M &&
|
||||||
|
conversationUser.id != -1L &&
|
||||||
context != null
|
context != null
|
||||||
) {
|
) {
|
||||||
|
|
||||||
@ -215,9 +220,7 @@ object NotificationUtils {
|
|||||||
|
|
||||||
if (notification != null && !notification.extras.isEmpty) {
|
if (notification != null && !notification.extras.isEmpty) {
|
||||||
if (conversationUser.id == notification.extras.getLong(BundleKeys.KEY_INTERNAL_USER_ID) &&
|
if (conversationUser.id == notification.extras.getLong(BundleKeys.KEY_INTERNAL_USER_ID) &&
|
||||||
roomTokenOrId == statusBarNotification.notification.extras.getString(
|
roomTokenOrId == statusBarNotification.notification.extras.getString(BundleKeys.KEY_ROOM_TOKEN)
|
||||||
BundleKeys.KEY_ROOM_TOKEN
|
|
||||||
)
|
|
||||||
) {
|
) {
|
||||||
notificationManager.cancel(statusBarNotification.id)
|
notificationManager.cancel(statusBarNotification.id)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user