forked from mirror/monocles_chat
Put profile links through our normal link handler
(cherry picked from commit e8adb13ecb449455285aed9e69422c655ac45ee3)
This commit is contained in:
parent
ff4bc65eda
commit
90a7ec8b0c
1 changed files with 2 additions and 11 deletions
|
@ -79,6 +79,7 @@ import eu.siacs.conversations.services.XmppConnectionService.OnAccountUpdate;
|
||||||
import eu.siacs.conversations.services.XmppConnectionService.OnRosterUpdate;
|
import eu.siacs.conversations.services.XmppConnectionService.OnRosterUpdate;
|
||||||
import eu.siacs.conversations.ui.adapter.MediaAdapter;
|
import eu.siacs.conversations.ui.adapter.MediaAdapter;
|
||||||
import eu.siacs.conversations.ui.interfaces.OnMediaLoaded;
|
import eu.siacs.conversations.ui.interfaces.OnMediaLoaded;
|
||||||
|
import eu.siacs.conversations.ui.text.FixedURLSpan;
|
||||||
import eu.siacs.conversations.ui.util.Attachment;
|
import eu.siacs.conversations.ui.util.Attachment;
|
||||||
import eu.siacs.conversations.ui.util.AvatarWorkerTask;
|
import eu.siacs.conversations.ui.util.AvatarWorkerTask;
|
||||||
import eu.siacs.conversations.ui.util.GridManager;
|
import eu.siacs.conversations.ui.util.GridManager;
|
||||||
|
@ -746,17 +747,7 @@ public class ContactDetailsActivity extends OmemoActivity implements OnAccountUp
|
||||||
binding.profileItems.setOnItemClickListener((a0, v, pos, a3) -> {
|
binding.profileItems.setOnItemClickListener((a0, v, pos, a3) -> {
|
||||||
final Uri uri = items.getUri(pos);
|
final Uri uri = items.getUri(pos);
|
||||||
if (uri == null) return;
|
if (uri == null) return;
|
||||||
|
new FixedURLSpan(uri.toString()).onClick(v);
|
||||||
if ("xmpp".equals(uri.getScheme())) {
|
|
||||||
switchToConversation(xmppConnectionService.findOrCreateConversation(account, Jid.of(uri.getSchemeSpecificPart()), false, true));
|
|
||||||
} else {
|
|
||||||
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
|
|
||||||
try {
|
|
||||||
startActivity(intent);
|
|
||||||
} catch (ActivityNotFoundException e) {
|
|
||||||
Toast.makeText(this, R.string.no_application_found_to_open_link, Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
binding.profileItems.setOnItemLongClickListener((a0, v, pos, a3) -> {
|
binding.profileItems.setOnItemLongClickListener((a0, v, pos, a3) -> {
|
||||||
String toCopy = null;
|
String toCopy = null;
|
||||||
|
|
Loading…
Reference in a new issue