mirror of
https://github.com/SimpleMobileTools/Simple-SMS-Messenger.git
synced 2025-01-30 17:14:55 +01:00
Add missing code
This commit is contained in:
parent
b076da3840
commit
5169539a88
@ -37,11 +37,13 @@ class DirectReplyReceiver : BroadcastReceiver() {
|
||||
}
|
||||
|
||||
ensureBackgroundThread {
|
||||
var messageId: Long = 0L
|
||||
try {
|
||||
context.sendMessageCompat(body, listOf(address), subscriptionId, emptyList())
|
||||
val message = context.getMessages(threadId, getImageResolutions = false, includeScheduledMessages = false, limit = 1).lastOrNull()
|
||||
if (message != null) {
|
||||
context.messagesDB.insertOrUpdate(message)
|
||||
messageId = message.id
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
context.showErrorToast(e)
|
||||
@ -50,7 +52,7 @@ class DirectReplyReceiver : BroadcastReceiver() {
|
||||
val photoUri = SimpleContactsHelper(context).getPhotoUriFromPhoneNumber(address)
|
||||
val bitmap = context.getNotificationBitmap(photoUri)
|
||||
Handler(Looper.getMainLooper()).post {
|
||||
context.notificationHelper.showMessageNotification(address, body, threadId, bitmap, sender = null, alertOnlyOnce = true)
|
||||
context.notificationHelper.showMessageNotification(messageId, address, body, threadId, bitmap, sender = null, alertOnlyOnce = true)
|
||||
}
|
||||
|
||||
context.markThreadMessagesRead(threadId)
|
||||
|
@ -38,7 +38,7 @@ class MmsReceiver : com.klinker.android.send_message.MmsReceivedReceiver() {
|
||||
}
|
||||
|
||||
Handler(Looper.getMainLooper()).post {
|
||||
context.showReceivedMessageNotification(address, mms.body, mms.threadId, glideBitmap)
|
||||
context.showReceivedMessageNotification(mms.id, address, mms.body, mms.threadId, glideBitmap)
|
||||
val conversation = context.getConversations(mms.threadId).firstOrNull() ?: return@post
|
||||
ensureBackgroundThread {
|
||||
context.insertOrUpdateConversation(conversation)
|
||||
|
@ -86,9 +86,9 @@ class SmsReceiver : BroadcastReceiver() {
|
||||
Message(newMessageId, body, type, status, participants, messageDate, false, threadId, false, null, senderName, photoUri, subscriptionId)
|
||||
context.messagesDB.insertOrUpdate(message)
|
||||
refreshMessages()
|
||||
context.showReceivedMessageNotification(newMessageId, address, body, threadId, bitmap)
|
||||
}
|
||||
|
||||
context.showReceivedMessageNotification(address, body, threadId, bitmap)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -59,7 +59,6 @@
|
||||
<item quantity="one">%d conversation</item>
|
||||
<item quantity="other">%d conversations</item>
|
||||
</plurals>
|
||||
<string name="delete_messages">Delete message</string>
|
||||
<!-- Are you sure you want to delete 5 messages? -->
|
||||
<plurals name="delete_messages">
|
||||
<item quantity="one">%d message</item>
|
||||
|
@ -52,6 +52,7 @@
|
||||
<string name="mark_as_read">Mark as Read</string>
|
||||
<string name="mark_as_unread">Mark as Unread</string>
|
||||
<string name="me">Me</string>
|
||||
<string name="delete_messages">Delete message</string>
|
||||
<!-- Confirmation dialog -->
|
||||
<string name="delete_whole_conversation_confirmation">Are you sure you want to delete all messages of this conversation?</string>
|
||||
<!-- Are you sure you want to delete 5 conversations? -->
|
||||
|
Loading…
x
Reference in New Issue
Block a user