Refactoring

This commit is contained in:
M66B 2021-12-11 10:16:34 +01:00
parent 4d38281d64
commit fe6f50200a
3 changed files with 9 additions and 6 deletions

View File

@ -3840,9 +3840,12 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
}
if (Boolean.FALSE.equals(message.reply_domain)) {
if (sb.length() > 0)
sb.append('\n');
sb.append(message.checkReplyDomain(context));
String[] warning = message.checkReplyDomain(context);
if (warning != null) {
if (sb.length() > 0)
sb.append('\n');
sb.append(context.getString(R.string.title_reply_domain, warning[0], warning[1]));
}
}
if (message.from != null && message.from.length > 0) {

View File

@ -3795,7 +3795,7 @@ class Core {
}
if (!self) {
String warning = message.checkReplyDomain(context);
String[] warning = message.checkReplyDomain(context);
message.reply_domain = (warning == null);
}

View File

@ -307,7 +307,7 @@ public class EntityMessage implements Serializable {
return hasKeyword(MessageHelper.FLAG_FORWARDED);
}
String checkReplyDomain(Context context) {
String[] checkReplyDomain(Context context) {
if (from == null || from.length == 0)
return null;
if (reply == null || reply.length == 0)
@ -328,7 +328,7 @@ public class EntityMessage implements Serializable {
String fdomain = UriHelper.getParentDomain(context, f.substring(fat + 1));
if (!rdomain.equalsIgnoreCase(fdomain))
return context.getString(R.string.title_reply_domain, fdomain, rdomain);
return new String[]{fdomain, rdomain};
}
}