mirror of
https://github.com/quik-sms/quik.git
synced 2026-11-23 06:08:52 +01:00
Merge branch 'octoshrimpy:master' into send_immediately_35
This commit is contained in:
@@ -1,5 +1,36 @@
|
|||||||
|
|
||||||
[ {
|
[
|
||||||
|
{
|
||||||
|
"versionCode": 2226,
|
||||||
|
"versionName": "4.0.9",
|
||||||
|
"added": [
|
||||||
|
"Basic speech to text for compose (and qkreply)",
|
||||||
|
"Text to speech",
|
||||||
|
"Add 'super' font size setting",
|
||||||
|
"Basic speech to text for compose (and qkreply) take 2",
|
||||||
|
"Make unread conversations float at the top of conversation lists",
|
||||||
|
"Select and copy a text part",
|
||||||
|
"Add 'super' font size setting - take 2",
|
||||||
|
"Main widget launch appropriate app activities",
|
||||||
|
"Change convo name from main convo activity",
|
||||||
|
"Play audio attachments",
|
||||||
|
"Select all on conversations and compose screens. New compose 'show status' option",
|
||||||
|
"Build on pull request",
|
||||||
|
"Update French translation",
|
||||||
|
"Changes to allow attaching *any* type of file",
|
||||||
|
"Update French translation"
|
||||||
|
],
|
||||||
|
"fixed": [
|
||||||
|
"Bug fix for motion events being used after recycled",
|
||||||
|
"Disable reply ability to non-replyable messages/conversations",
|
||||||
|
"Sort blocked messages by lastmessage.date desc",
|
||||||
|
"Fix fr strings from pr 226. Fixes build",
|
||||||
|
"Fix pr 225 render issue",
|
||||||
|
"Fix unblock number bug",
|
||||||
|
"Silent notifications if no recipients are a contact"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
"versionCode": 2225,
|
"versionCode": 2225,
|
||||||
"versionName": "4.0.8",
|
"versionName": "4.0.8",
|
||||||
"fixed": [
|
"fixed": [
|
||||||
|
|||||||
@@ -82,6 +82,15 @@ class ContactRepositoryImpl @Inject constructor(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun getUnmanagedAllContacts(): List<Contact> {
|
||||||
|
val realm = Realm.getDefaultInstance()
|
||||||
|
|
||||||
|
return realm
|
||||||
|
.where(Contact::class.java)
|
||||||
|
.findAll()
|
||||||
|
.map { realm.copyFromRealm(it) }
|
||||||
|
}
|
||||||
|
|
||||||
override fun getUnmanagedContacts(starred: Boolean): Observable<List<Contact>> {
|
override fun getUnmanagedContacts(starred: Boolean): Observable<List<Contact>> {
|
||||||
val realm = Realm.getDefaultInstance()
|
val realm = Realm.getDefaultInstance()
|
||||||
|
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ class Attachment(
|
|||||||
if (resourceBytes != null)
|
if (resourceBytes != null)
|
||||||
return resourceBytes!!
|
return resourceBytes!!
|
||||||
|
|
||||||
resourceBytes = ByteArray(0)
|
resourceBytes = ByteArray(0)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
context.contentResolver.openInputStream(getUri())?.use {
|
context.contentResolver.openInputStream(getUri())?.use {
|
||||||
|
|||||||
@@ -33,6 +33,8 @@ interface ContactRepository {
|
|||||||
|
|
||||||
fun getUnmanagedContact(lookupKey: String): Contact?
|
fun getUnmanagedContact(lookupKey: String): Contact?
|
||||||
|
|
||||||
|
fun getUnmanagedAllContacts(): List<Contact>
|
||||||
|
|
||||||
fun getUnmanagedContacts(starred: Boolean = false): Observable<List<Contact>>
|
fun getUnmanagedContacts(starred: Boolean = false): Observable<List<Contact>>
|
||||||
|
|
||||||
fun getUnmanagedContactGroups(): Observable<List<ContactGroup>>
|
fun getUnmanagedContactGroups(): Observable<List<ContactGroup>>
|
||||||
|
|||||||
@@ -107,6 +107,7 @@ class Preferences @Inject constructor(
|
|||||||
val textSize = rxPrefs.getInteger("textSize", TEXT_SIZE_NORMAL)
|
val textSize = rxPrefs.getInteger("textSize", TEXT_SIZE_NORMAL)
|
||||||
val blockingManager = rxPrefs.getInteger("blockingManager", BLOCKING_MANAGER_QKSMS)
|
val blockingManager = rxPrefs.getInteger("blockingManager", BLOCKING_MANAGER_QKSMS)
|
||||||
val drop = rxPrefs.getBoolean("drop", false)
|
val drop = rxPrefs.getBoolean("drop", false)
|
||||||
|
val silentNotContact = rxPrefs.getBoolean("silentNotContact", false)
|
||||||
val notifAction1 = rxPrefs.getInteger("notifAction1", NOTIFICATION_ACTION_READ)
|
val notifAction1 = rxPrefs.getInteger("notifAction1", NOTIFICATION_ACTION_READ)
|
||||||
val notifAction2 = rxPrefs.getInteger("notifAction2", NOTIFICATION_ACTION_REPLY)
|
val notifAction2 = rxPrefs.getInteger("notifAction2", NOTIFICATION_ACTION_REPLY)
|
||||||
val notifAction3 = rxPrefs.getInteger("notifAction3", NOTIFICATION_ACTION_NONE)
|
val notifAction3 = rxPrefs.getInteger("notifAction3", NOTIFICATION_ACTION_NONE)
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
Remplacement open source de l'application SMS d'origine d'Android. Renaissance de QKSMS.
|
Remplacement open source de l'appli SMS Android. Renaissance de QKSMS.
|
||||||
|
|||||||
@@ -30,13 +30,13 @@ android {
|
|||||||
applicationId 'dev.octoshrimpy.quik'
|
applicationId 'dev.octoshrimpy.quik'
|
||||||
minSdkVersion 23
|
minSdkVersion 23
|
||||||
targetSdkVersion 33
|
targetSdkVersion 33
|
||||||
versionCode 2225
|
versionCode 2226
|
||||||
versionName '4.0.8'
|
versionName '4.0.9'
|
||||||
setProperty("archivesBaseName", "QUIK-v${versionName}")
|
setProperty("archivesBaseName", "QUIK-v${versionName}")
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
|
|
||||||
setProperty("archivesBaseName", "QUIK-v${versionName}")
|
setProperty("archivesBaseName", "QUIK-v${versionName}")
|
||||||
versionNameSuffix '-alpha'
|
versionNameSuffix '-beta'
|
||||||
}
|
}
|
||||||
|
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ import dev.octoshrimpy.quik.receiver.MarkReadReceiver
|
|||||||
import dev.octoshrimpy.quik.receiver.MarkSeenReceiver
|
import dev.octoshrimpy.quik.receiver.MarkSeenReceiver
|
||||||
import dev.octoshrimpy.quik.receiver.RemoteMessagingReceiver
|
import dev.octoshrimpy.quik.receiver.RemoteMessagingReceiver
|
||||||
import dev.octoshrimpy.quik.receiver.SpeakThreadsReceiver
|
import dev.octoshrimpy.quik.receiver.SpeakThreadsReceiver
|
||||||
|
import dev.octoshrimpy.quik.repository.ContactRepository
|
||||||
import dev.octoshrimpy.quik.repository.ConversationRepository
|
import dev.octoshrimpy.quik.repository.ConversationRepository
|
||||||
import dev.octoshrimpy.quik.repository.MessageRepository
|
import dev.octoshrimpy.quik.repository.MessageRepository
|
||||||
import dev.octoshrimpy.quik.util.GlideApp
|
import dev.octoshrimpy.quik.util.GlideApp
|
||||||
@@ -70,7 +71,8 @@ class NotificationManagerImpl @Inject constructor(
|
|||||||
private val prefs: Preferences,
|
private val prefs: Preferences,
|
||||||
private val messageRepo: MessageRepository,
|
private val messageRepo: MessageRepository,
|
||||||
private val permissions: PermissionManager,
|
private val permissions: PermissionManager,
|
||||||
private val phoneNumberUtils: PhoneNumberUtils
|
private val phoneNumberUtils: PhoneNumberUtils,
|
||||||
|
private val contactRepo: ContactRepository,
|
||||||
) : dev.octoshrimpy.quik.manager.NotificationManager {
|
) : dev.octoshrimpy.quik.manager.NotificationManager {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
@@ -145,12 +147,28 @@ class NotificationManagerImpl @Inject constructor(
|
|||||||
.setAutoCancel(true)
|
.setAutoCancel(true)
|
||||||
.setContentIntent(contentPI)
|
.setContentIntent(contentPI)
|
||||||
.setDeleteIntent(seenPI)
|
.setDeleteIntent(seenPI)
|
||||||
.setSound(ringtone)
|
|
||||||
.setLights(Color.WHITE, 500, 2000)
|
.setLights(Color.WHITE, 500, 2000)
|
||||||
.setWhen(conversation.lastMessage?.date ?: System.currentTimeMillis())
|
.setWhen(conversation.lastMessage?.date ?: System.currentTimeMillis())
|
||||||
.setVibrate(if (prefs.vibration(threadId).get()) VIBRATE_PATTERN else longArrayOf(0))
|
.setVibrate(if (prefs.vibration(threadId).get()) VIBRATE_PATTERN else longArrayOf(0))
|
||||||
|
|
||||||
// Tell the notification if it's a group message
|
// if preference set to silence notifications if no recipients in contacts
|
||||||
|
if (prefs.silentNotContact.get() && run {
|
||||||
|
val msgRecipientNumbers = conversation.recipients.map { it.address }
|
||||||
|
|
||||||
|
// true if any message recipients are in device's contacts
|
||||||
|
!contactRepo
|
||||||
|
.getUnmanagedAllContacts()
|
||||||
|
.flatMap { it.numbers }
|
||||||
|
.map { it.address }
|
||||||
|
.any { contactNumber ->
|
||||||
|
msgRecipientNumbers.any { phoneNumberUtils.compare(contactNumber, it) }
|
||||||
|
}
|
||||||
|
})
|
||||||
|
notification.setSilent(true)
|
||||||
|
else
|
||||||
|
notification.setSound(ringtone)
|
||||||
|
|
||||||
|
// Tell the notification if it's a group message
|
||||||
val messagingStyle = NotificationCompat.MessagingStyle("Me")
|
val messagingStyle = NotificationCompat.MessagingStyle("Me")
|
||||||
if (conversation.recipients.size >= 2) {
|
if (conversation.recipients.size >= 2) {
|
||||||
messagingStyle.isGroupConversation = true
|
messagingStyle.isGroupConversation = true
|
||||||
|
|||||||
+16
-14
@@ -39,24 +39,26 @@ class BlockedNumbersPresenter @Inject constructor(
|
|||||||
super.bindIntents(view)
|
super.bindIntents(view)
|
||||||
|
|
||||||
view.unblockAddress()
|
view.unblockAddress()
|
||||||
.doOnNext { id ->
|
.observeOn(Schedulers.io())
|
||||||
blockingRepo.getBlockedNumber(id)?.address
|
.doOnNext { id ->
|
||||||
?.let(conversationRepo::getThreadId)
|
blockingRepo.getBlockedNumber(id)?.address
|
||||||
?.let { threadId -> markUnblocked.execute(listOf(threadId)) }
|
?.let(conversationRepo::getThreadId)
|
||||||
}
|
?.let { threadId -> markUnblocked.execute(listOf(threadId)) }
|
||||||
.doOnNext(blockingRepo::unblockNumber)
|
}
|
||||||
.subscribeOn(Schedulers.io())
|
.doOnNext(blockingRepo::unblockNumber)
|
||||||
.autoDisposable(view.scope())
|
.subscribeOn(Schedulers.io())
|
||||||
.subscribe()
|
.autoDisposable(view.scope())
|
||||||
|
.subscribe()
|
||||||
|
|
||||||
view.addAddress()
|
view.addAddress()
|
||||||
.autoDisposable(view.scope())
|
.autoDisposable(view.scope())
|
||||||
.subscribe { view.showAddDialog() }
|
.subscribe { view.showAddDialog() }
|
||||||
|
|
||||||
view.saveAddress()
|
view.saveAddress()
|
||||||
.subscribeOn(Schedulers.io())
|
.observeOn(Schedulers.io())
|
||||||
.autoDisposable(view.scope())
|
.subscribeOn(Schedulers.io())
|
||||||
.subscribe { address -> blockingRepo.blockNumber(address) }
|
.autoDisposable(view.scope())
|
||||||
|
.subscribe { address -> blockingRepo.blockNumber(address) }
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+2
@@ -99,6 +99,8 @@ class NotificationPrefsActivity : QkThemedActivity(), NotificationPrefsView {
|
|||||||
previews.summary = state.previewSummary
|
previews.summary = state.previewSummary
|
||||||
previewModeDialog.adapter.selectedItem = state.previewId
|
previewModeDialog.adapter.selectedItem = state.previewId
|
||||||
wake.checkbox.isChecked = state.wakeEnabled
|
wake.checkbox.isChecked = state.wakeEnabled
|
||||||
|
silentNotContact.checkbox.isChecked = state.silentNotContact
|
||||||
|
silentNotContact.isVisible = state.threadId == 0L
|
||||||
vibration.checkbox.isChecked = state.vibrationEnabled
|
vibration.checkbox.isChecked = state.vibrationEnabled
|
||||||
ringtone.summary = state.ringtoneName
|
ringtone.summary = state.ringtoneName
|
||||||
|
|
||||||
|
|||||||
+1
@@ -28,6 +28,7 @@ data class NotificationPrefsState(
|
|||||||
val previewSummary: String = "",
|
val previewSummary: String = "",
|
||||||
val previewId: Int = Preferences.NOTIFICATION_PREVIEWS_ALL,
|
val previewId: Int = Preferences.NOTIFICATION_PREVIEWS_ALL,
|
||||||
val wakeEnabled: Boolean = false,
|
val wakeEnabled: Boolean = false,
|
||||||
|
val silentNotContact: Boolean = false,
|
||||||
val action1Summary: String = "",
|
val action1Summary: String = "",
|
||||||
val action2Summary: String = "",
|
val action2Summary: String = "",
|
||||||
val action3Summary: String = "",
|
val action3Summary: String = "",
|
||||||
|
|||||||
+5
@@ -79,6 +79,9 @@ class NotificationPrefsViewModel @Inject constructor(
|
|||||||
disposables += wake.asObservable()
|
disposables += wake.asObservable()
|
||||||
.subscribe { enabled -> newState { copy(wakeEnabled = enabled) } }
|
.subscribe { enabled -> newState { copy(wakeEnabled = enabled) } }
|
||||||
|
|
||||||
|
disposables += prefs.silentNotContact.asObservable()
|
||||||
|
.subscribe { enabled -> newState { copy(silentNotContact = enabled) } }
|
||||||
|
|
||||||
disposables += vibration.asObservable()
|
disposables += vibration.asObservable()
|
||||||
.subscribe { enabled -> newState { copy(vibrationEnabled = enabled) } }
|
.subscribe { enabled -> newState { copy(vibrationEnabled = enabled) } }
|
||||||
|
|
||||||
@@ -113,6 +116,8 @@ class NotificationPrefsViewModel @Inject constructor(
|
|||||||
|
|
||||||
R.id.wake -> wake.set(!wake.get())
|
R.id.wake -> wake.set(!wake.get())
|
||||||
|
|
||||||
|
R.id.silentNotContact -> prefs.silentNotContact.set(!prefs.silentNotContact.get())
|
||||||
|
|
||||||
R.id.vibration -> vibration.set(!vibration.get())
|
R.id.vibration -> vibration.set(!vibration.get())
|
||||||
|
|
||||||
R.id.ringtone -> view.showRingtonePicker(ringtone.get().takeIf { it.isNotEmpty() }?.let(Uri::parse))
|
R.id.ringtone -> view.showRingtonePicker(ringtone.get().takeIf { it.isNotEmpty() }?.let(Uri::parse))
|
||||||
|
|||||||
@@ -70,7 +70,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:title="@string/settings_notification_previews_title"
|
app:title="@string/settings_notification_previews_title"
|
||||||
tools:summary="Show name and message" />
|
tools:summary="@string/settings_notification_previews_summary" />
|
||||||
|
|
||||||
<dev.octoshrimpy.quik.common.widget.PreferenceView
|
<dev.octoshrimpy.quik.common.widget.PreferenceView
|
||||||
android:id="@+id/wake"
|
android:id="@+id/wake"
|
||||||
@@ -79,6 +79,14 @@
|
|||||||
app:title="@string/settings_notification_wake_title"
|
app:title="@string/settings_notification_wake_title"
|
||||||
app:widget="@layout/settings_switch_widget" />
|
app:widget="@layout/settings_switch_widget" />
|
||||||
|
|
||||||
|
<dev.octoshrimpy.quik.common.widget.PreferenceView
|
||||||
|
android:id="@+id/silentNotContact"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:title="@string/settings_notification_silent_title"
|
||||||
|
app:summary="@string/settings_notification_silent_summary"
|
||||||
|
app:widget="@layout/settings_switch_widget" />
|
||||||
|
|
||||||
<dev.octoshrimpy.quik.common.widget.PreferenceView
|
<dev.octoshrimpy.quik.common.widget.PreferenceView
|
||||||
android:id="@+id/vibration"
|
android:id="@+id/vibration"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|||||||
@@ -245,7 +245,10 @@
|
|||||||
<string name="settings_notification_action_2">Button 2</string>
|
<string name="settings_notification_action_2">Button 2</string>
|
||||||
<string name="settings_notification_action_3">Button 3</string>
|
<string name="settings_notification_action_3">Button 3</string>
|
||||||
<string name="settings_notification_previews_title">Notification previews</string>
|
<string name="settings_notification_previews_title">Notification previews</string>
|
||||||
|
<string name="settings_notification_previews_summary">Show name and message</string>
|
||||||
<string name="settings_notification_wake_title">Wake screen</string>
|
<string name="settings_notification_wake_title">Wake screen</string>
|
||||||
|
<string name="settings_notification_silent_title">Silent if not a contact</string>
|
||||||
|
<string name="settings_notification_silent_summary">Silences notifications for messages without recipients in your contacts</string>
|
||||||
<string name="settings_vibration_title">Vibration</string>
|
<string name="settings_vibration_title">Vibration</string>
|
||||||
<string name="settings_ringtone_title">Sound</string>
|
<string name="settings_ringtone_title">Sound</string>
|
||||||
<string name="settings_ringtone_none">None</string>
|
<string name="settings_ringtone_none">None</string>
|
||||||
|
|||||||
Reference in New Issue
Block a user