show auto-delete state in settings-summary

This commit is contained in:
B. Petersen
2020-03-12 15:22:12 +01:00
parent bf314f57bf
commit 3ba5681a50
2 changed files with 7 additions and 3 deletions
+2 -1
View File
@@ -467,7 +467,8 @@
<string name="pref_background_custom_color">Custom color</string>
<!-- automatically delete message -->
<string name="autodel_title">Automatically delete messages</string>
<string name="autodel_title">Auto-delete messages</string>
<string name="autodel_title_short">Auto-delete</string>
<string name="autodel_device_title">Delete messages from device</string>
<string name="autodel_server_title">Delete messages from server</string>
<!-- %1$d will be replaced by the number of messages, you can assume plural/lots here. %1$s will be replaced by a timespan in italics or so. -->
@@ -117,10 +117,13 @@ public class ChatsPreferenceFragment extends ListSummaryPreferenceFragment {
}
public static CharSequence getSummary(Context context) {
DcContext dcContext = DcHelper.getContext(context);
final String onRes = context.getString(R.string.on);
final String offRes = context.getString(R.string.off);
String readReceiptState = DcHelper.getContext(context).getConfigInt("mdns_enabled")!=0? onRes : offRes;
return context.getString(R.string.pref_read_receipts) + " " + readReceiptState;
String readReceiptState = dcContext.getConfigInt("mdns_enabled")!=0? onRes : offRes;
String autodelState = (dcContext.getConfigInt("delete_device_after")!=0 || dcContext.getConfigInt("delete_server_after")!=0)? onRes : offRes;
return context.getString(R.string.pref_read_receipts) + " " + readReceiptState +
", " + context.getString(R.string.autodel_title_short) + " " + autodelState;
}
private class BlockedContactsClickListener implements Preference.OnPreferenceClickListener {