mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
fix: Lookup key contacts by addr when clicking on a link
Companion PR to https://github.com/chatmail/core/pull/7073
This commit is contained in:
@@ -58,7 +58,12 @@ public class LongClickCopySpan extends ClickableSpan {
|
||||
String addr = prepareUrl(url);
|
||||
Activity activity = (Activity) widget.getContext();
|
||||
DcContext dcContext = DcHelper.getContext(activity);
|
||||
DcContact contact = dcContext.getContact(dcContext.createContact(null, addr));
|
||||
|
||||
int contactId = dcContext.lookupContactIdByAddr(addr);
|
||||
if (contactId == 0 && dcContext.mayBeValidAddr(addr)) {
|
||||
contactId = dcContext.createContact(null, addr);
|
||||
}
|
||||
DcContact contact = dcContext.getContact(contactId);
|
||||
if (contact.getId() != 0 && !contact.isBlocked() && dcContext.getChatIdByContactId(contact.getId()) != 0) {
|
||||
openChat(activity, contact);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user