Skip to content

Commit b110c1f

Browse files
authored
Merge pull request #3467 from deltachat/adb/issue-3437
add "After 1 year" option to disappearing messages
2 parents 57a557a + e53a1f0 commit b110c1f

File tree

5 files changed

+13
-2
lines changed

5 files changed

+13
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22

33
## Unreleased
44

5-
* allow to clone email chats
5+
* add "After 1 year" option to disappearing messages
66
* improve image quality when setting group avatars
77
* add Estonian translation, update other translations
8+
* allow to clone email chats
89
* fix some small bugs
910
* update to core 2.11.0
1011

src/main/java/org/thoughtcrime/securesms/EphemeralMessagesDialog.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ public static void show(final Context context, int currentSelectedTime, final @N
6767
case 5: burnAfter = TimeUnit.DAYS.toSeconds(1); break;
6868
case 6: burnAfter = TimeUnit.DAYS.toSeconds(7); break;
6969
case 7: burnAfter = TimeUnit.DAYS.toSeconds(35); break;
70+
case 8: burnAfter = TimeUnit.DAYS.toSeconds(365); break;
7071
default: burnAfter = 0; break;
7172
}
7273
listener.onTimeSelected(burnAfter);
@@ -103,7 +104,10 @@ private static int getPreselection(int timespan) {
103104
if (timespan < TimeUnit.DAYS.toSeconds(35)) {
104105
return 6; // 1 week
105106
}
106-
return 7; // 5 weeks
107+
if (timespan < TimeUnit.DAYS.toSeconds(365)) {
108+
return 7; // 5 weeks
109+
}
110+
return 8; // 1 year
107111
}
108112

109113
}

src/main/java/org/thoughtcrime/securesms/connect/DcHelper.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,8 @@ public static void setStockTranslations(Context context) {
226226
dcContext.setStockTranslation(155, context.getString(R.string.ephemeral_timer_days_by_other));
227227
dcContext.setStockTranslation(156, context.getString(R.string.ephemeral_timer_weeks_by_you));
228228
dcContext.setStockTranslation(157, context.getString(R.string.ephemeral_timer_weeks_by_other));
229+
dcContext.setStockTranslation(158, context.getString(R.string.ephemeral_timer_1_year_by_you));
230+
dcContext.setStockTranslation(159, context.getString(R.string.ephemeral_timer_1_year_by_other));
229231

230232
// HACK: svg does not handle entities correctly and shows `&quot;` as the text `quot;`.
231233
// until that is fixed, we fix the most obvious errors (core uses encode_minimal, so this does not affect so many characters)

src/main/res/values/arrays.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
<!-- 5 --> <item>@string/autodel_after_1_day</item>
5757
<!-- 6 --> <item>@string/autodel_after_1_week</item>
5858
<!-- 7 --> <item>@string/after_5_weeks</item>
59+
<!-- 8 --> <item>@string/autodel_after_1_year</item>
5960
</string-array>
6061

6162
<string-array name="mute_durations">

src/main/res/values/strings.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -956,6 +956,9 @@
956956
<string name="ephemeral_timer_1_week_by_you">You set disappearing messages timer to 1 week.</string>
957957
<!-- %1$s will be replaced by name and address of the contact -->
958958
<string name="ephemeral_timer_1_week_by_other">Disappearing messages timer set to 1 week by %1$s.</string>
959+
<string name="ephemeral_timer_1_year_by_you">You set disappearing messages timer to 1 year.</string>
960+
<!-- %1$s will be replaced by name of the contact -->
961+
<string name="ephemeral_timer_1_year_by_other">Disappearing messages timer set to 1 year by %1$s.</string>
959962
<!-- %1$s will be replaced by the number of minutes (always >1) the timer is set to -->
960963
<string name="ephemeral_timer_minutes_by_you">You set disappearing messages timer to %1$s minutes.</string>
961964
<!-- %1$s will be replaced by the number of minutes (always >1) the timer is set to, %2$s will be replaced by name and address of the contact -->

0 commit comments

Comments
 (0)