Do not show geo Uri as message body

This commit is contained in:
Stephen Paul Weber 2023-10-10 18:28:52 +02:00 committed by Arne
parent 80f6537b9f
commit 382bf3d19e
3 changed files with 5 additions and 3 deletions

View file

@ -639,6 +639,8 @@ public class Message extends AbstractEntity implements AvatarService.Avatarable
if (spans.isEmpty() && getOob() != null) {
return body.toString().replace(getOob().toString(), "");
} else if (spans.isEmpty() && isGeoUri()) {
return "";
} else {
return body.toString();
}

View file

@ -101,7 +101,7 @@ public class ShareUtil {
final int resId;
if (message.isGeoUri()) {
resId = R.string.location;
url = message.getBody();
url = message.getQuoteableBody();
} else if (message.hasFileOnRemoteHost()) {
resId = R.string.file_url;
url = message.getFileParams().url;
@ -111,7 +111,7 @@ public class ShareUtil {
resId = R.string.file_url;
}
if (activity.copyTextToClipboard(url, resId)) {
ToastCompat.makeText(activity, R.string.url_copied_to_clipboard, ToastCompat.LENGTH_SHORT).show();
Toast.makeText(activity, R.string.url_copied_to_clipboard, Toast.LENGTH_SHORT).show();
}
}

View file

@ -107,7 +107,7 @@ public class GeoHelper {
final ArrayList<Intent> intents = new ArrayList<>();
final GeoPoint geoPoint;
try {
geoPoint = parseGeoPoint(message.getBody());
geoPoint = parseGeoPoint(message.getQuoteableBody());
} catch (IllegalArgumentException e) {
return intents;
}