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
* tapping info messages with contacts open the contact's profile
* hide superfluous "Show Classic E-mails" advanced setting for chatmail
* show profile bio/status under name in main settings screen
* 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)
{
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 int getType ();
public native int getInfoType ();
public native int getInfoContactId ();
public native int getState ();
public native int getDownloadState ();
public native int getChatId ();

View file

@ -753,12 +753,20 @@ public class ConversationFragment extends MessageSelectorFragment
}
}
else {
String self_mail = dcContext.getConfig("configured_mail_user");
if (self_mail != null && !self_mail.isEmpty()
&& messageRecord.getText().contains(self_mail)
&& getListAdapter().getChat().isDeviceTalk()) {
// This is a device message informing the user that the password is wrong
startActivity(new Intent(getActivity(), RegistrationActivity.class));
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 {
String self_mail = dcContext.getConfig("configured_mail_user");
if (self_mail != null && !self_mail.isEmpty()
&& messageRecord.getText().contains(self_mail)
&& getListAdapter().getChat().isDeviceTalk()) {
// This is a device message informing the user that the password is wrong
startActivity(new Intent(getActivity(), RegistrationActivity.class));
}
}
}
}