cheogram-android
created pr with
cheogram-android/jump-to-parent.1
commented
lgtm
cmds
checkout latest patchset:
ssh pr.pico.sh pull cheogram-android:jump-to-parent | git am -3checkout specific patchset revision:
ssh pr.pico.sh pull cheogram-android:jump-to-parent [rev] | git am -3add changes to patch request:
git format-patch main --stdout | ssh pr.pico.sh cheogram-android:jump-to-parentadd comment to patch request:
ssh pr.pico.sh comment cheogram-android:jump-to-parent "lgtm!"
Patchset
cheogram-android/jump-to-parent.1
Fix jump to reply parent
Stephen Paul Weber
2026-11-07T18:26:56ZSemantic diff summary
0 added,
0 modified,
0 signature changed,
0 removed
across 0 analyzed files
(2 files skipped: unsupported file type)
+15
-3
src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
#
| ... | ... | @@ -1888,6 +1888,19 @@ public class ConversationFragment extends XmppFragment | |
| 1888 | 1888 | } | |
| 1889 | 1889 | ||
| 1890 | 1890 | ||
| 1891 | + | public void jumpToMessage(final String uuid) { | |
| 1892 | + | if (uuid == null || binding == null) { | |
| 1893 | + | return; | |
| 1894 | + | } | |
| 1895 | + | final Runnable postSelectionRunnable = () -> highlightMessage(uuid); | |
| 1896 | + | updateSelection( | |
| 1897 | + | uuid, | |
| 1898 | + | binding.messagesView.getHeight() / 2, | |
| 1899 | + | postSelectionRunnable, | |
| 1900 | + | false, | |
| 1901 | + | false); | |
| 1902 | + | } | |
| 1903 | + | ||
| 1891 | 1904 | private void highlightMessage(String uuid) { | |
| 1892 | 1905 | binding.messagesView.postDelayed(() -> { | |
| 1893 | 1906 | int actualIndex = getIndexOfExtended(uuid, messageList); |
| ... | ... | @@ -4064,10 +4077,9 @@ public class ConversationFragment extends XmppFragment | |
| 4064 | 4077 | conversation.startCommand(commandFor(Jid.of("cheogram.com/CHEOGRAM%jabber:iq:register"), "jabber:iq:register"), requireXmppActivity().xmppConnectionService); | |
| 4065 | 4078 | } | |
| 4066 | 4079 | } | |
| 4067 | - | String messageUuid = extras.getString(ConversationsActivity.EXTRA_MESSAGE_UUID); | |
| 4080 | + | final String messageUuid = extras.getString(ConversationsActivity.EXTRA_MESSAGE_UUID); | |
| 4068 | 4081 | if (messageUuid != null) { | |
| 4069 | - | Runnable postSelectionRunnable = () -> highlightMessage(messageUuid); | |
| 4070 | - | updateSelection(messageUuid, binding.messagesView.getHeight() / 2, postSelectionRunnable, false, false); | |
| 4082 | + | jumpToMessage(messageUuid); | |
| 4071 | 4083 | } | |
| 4072 | 4084 | } | |
| 4073 | 4085 |
+1
-10
src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java
#
| ... | ... | @@ -1567,16 +1567,7 @@ public class MessageAdapter extends ArrayAdapter<Message> { | |
| 1567 | 1567 | final var replyToClickListener = (View.OnClickListener) (v) -> { | |
| 1568 | 1568 | final Message inReplyTo = message.getInReplyTo(); | |
| 1569 | 1569 | if (inReplyTo == null || inReplyTo.getUuid() == null) return; | |
| 1570 | - | final var replyConversation = mConversationFragment.getConversation(); | |
| 1571 | - | activity.xmppConnectionService.jumpToMessage(replyConversation, inReplyTo.getUuid(), new XmppConnectionService.JumpToMessageListener() { | |
| 1572 | - | @Override | |
| 1573 | - | public void onSuccess() { | |
| 1574 | - | activity.runOnUiThread(() -> mConversationFragment.refresh()); | |
| 1575 | - | } | |
| 1576 | - | ||
| 1577 | - | @Override | |
| 1578 | - | public void onNotFound() {} | |
| 1579 | - | }); | |
| 1570 | + | mConversationFragment.jumpToMessage(inReplyTo.getUuid()); | |
| 1580 | 1571 | }; | |
| 1581 | 1572 | viewHolder.inReplyTo().setOnClickListener(replyToClickListener); | |
| 1582 | 1573 | viewHolder.inReplyToQuote().setOnClickListener(replyToClickListener); |