quik icon indicating copy to clipboard operation
quik copied to clipboard

:lady_beetle: [BUG] Phone call from Conversation view should call recipient from whom most recent message was received

Open e-t-l opened this issue 1 year ago • 1 comments

Describe the bug Pressing the phone call button from the conversation view of a group text appears to dial the first recipient in the list of recipients. Instead, it should call whichever recipient you have most recently received a message from.

To Reproduce

  1. Make a group conversation
  2. Receive some texts
  3. Press the phone call button
  4. Observe which recipient is dialed.

Expected behavior The call should dial whichever recipient sent the most recent message (ignoring outgoing messages, obviously)

Actual behavior In the list of group text members, "Person A, Person B, Person C, etc," pressing the call button always dials Person A, even if the most recently received text in the conversation was from Person C.

Smartphone (please complete the following information):

  • Device: Pixel 7
  • OS: GrapheneOS 14
  • App Version: alpha (or QKSMS v3.9.4)

Screenshots N/A

Additional context I'm not sure if, in the 95ish commits you have ahead of QKSMS, you've fixed any outstanding QKSMS bugs. This is an issue I had opened in that repo a few years back. I haven't had a chance to install the newest Quik and try reproducing all the old QKSMS bugs to see which are present, so I apologize if this issue has already been addressed.

In that original issue (https://github.com/moezbhatti/qksms/issues/1948), I poropsed this solution, which I didn't put into a PR because I'm pretty new at development and it was beyond my ability to feasibly test and debug. I'm directly copying and pasting it below, so the line # references might be a little different between the two repos, but the general solution (I'm hoping) will still be useful: . . . I believe it would just involve modifying the following 3 files that handle phone calls: presentation/src/main/java/com/moez/QKSMS/feature/main/MainViewModel.kt presentation/src/main/java/com/moez/QKSMS/feature/qkreply/QkReplyViewModel.kt presentation/src/main/java/com/moez/QKSMS/feature/compose/ComposeViewModel.kt

Adding something along the lines of

    val conversation = conversationRepo.getConversation(threadId)
    val lastMessage = conversation.lastMessage
    val lastRecipient = when {
        conversation.recipients.size == 1 || lastMessage == null -> conversation.recipients.firstOrNull()
        else -> conversation.recipients.find { recipient ->
            phoneNumberUtils.compare(recipient.address, lastMessage.address)
        }
    }

(mostly from presentation/src/main/java/com/moez/QKSMS/feature/conversations/ConversationsAdapter.kt#L96)

If other files would have to be edited I don't know what they would be.

e-t-l avatar Feb 11 '24 14:02 e-t-l

@e-t-l welcome to dev! i'm also new as far as Kotlin, so I'm learning as I go. if you want to make a PR, I can test it for you, or I can help you setup a dev environment to test yourself.

I'll take a poke around those files and see what I can do

octoshrimpy avatar Feb 12 '24 22:02 octoshrimpy