open contact in scope when tapping info messages (#3710)

* open contact in scope when tapping info messages

* update CHANGELOG

---------

Co-authored-by: adb <adb@merlinux.eu>
This commit is contained in:
bjoern 2025-04-12 00:22:24 +02:00 committed by GitHub
parent d66acbb71e
commit bc73e1a2ba
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 22 additions and 6 deletions

View file

@ -2,6 +2,7 @@
## Unreleased ## Unreleased
* tapping info messages with contacts open the contact's profile
* hide superfluous "Show Classic E-mails" advanced setting for chatmail * hide superfluous "Show Classic E-mails" advanced setting for chatmail
* show profile bio/status under name in main settings screen * show profile bio/status under name in main settings screen
* remove mostly non-telling transport addresses when referring to a contact; * remove mostly non-telling transport addresses when referring to a contact;

View file

@ -1428,6 +1428,12 @@ JNIEXPORT jint Java_com_b44t_messenger_DcMsg_getInfoType(JNIEnv *env, jobject ob
} }
JNIEXPORT jint Java_com_b44t_messenger_DcMsg_getInfoContactId(JNIEnv *env, jobject obj)
{
return dc_msg_get_info_contact_id(get_dc_msg(env, obj));
}
JNIEXPORT jint Java_com_b44t_messenger_DcMsg_getState(JNIEnv *env, jobject obj) JNIEXPORT jint Java_com_b44t_messenger_DcMsg_getState(JNIEnv *env, jobject obj)
{ {
return dc_msg_get_state(get_dc_msg(env, obj)); return dc_msg_get_state(get_dc_msg(env, obj));

View file

@ -122,6 +122,7 @@ public class DcMsg {
public native boolean hasLocation (); public native boolean hasLocation ();
public native int getType (); public native int getType ();
public native int getInfoType (); public native int getInfoType ();
public native int getInfoContactId ();
public native int getState (); public native int getState ();
public native int getDownloadState (); public native int getDownloadState ();
public native int getChatId (); public native int getChatId ();

View file

@ -752,6 +752,13 @@ public class ConversationFragment extends MessageSelectorFragment
WebxdcActivity.openWebxdcActivity(getContext(), messageRecord.getParent(), messageRecord.getWebxdcHref()); WebxdcActivity.openWebxdcActivity(getContext(), messageRecord.getParent(), messageRecord.getWebxdcHref());
} }
} }
else {
int infoContactId = messageRecord.getInfoContactId();
if (infoContactId != 0 && infoContactId != DC_CONTACT_ID_SELF) {
Intent intent = new Intent(getContext(), ProfileActivity.class);
intent.putExtra(ProfileActivity.CONTACT_ID_EXTRA, infoContactId);
startActivity(intent);
}
else { else {
String self_mail = dcContext.getConfig("configured_mail_user"); String self_mail = dcContext.getConfig("configured_mail_user");
if (self_mail != null && !self_mail.isEmpty() if (self_mail != null && !self_mail.isEmpty()
@ -762,6 +769,7 @@ public class ConversationFragment extends MessageSelectorFragment
} }
} }
} }
}
@Override @Override
public void onItemLongClick(DcMsg messageRecord, View view) { public void onItemLongClick(DcMsg messageRecord, View view) {