dtransform mute chat to use relative durations

instead of absolute timestamps
This commit is contained in:
Simon Laux
2020-02-08 12:45:06 +01:00
parent 07d698f8dc
commit 6d80b3675a
5 changed files with 46 additions and 14 deletions

View File

@@ -1938,7 +1938,13 @@ impl MuteDuration {
match value {
0 => MuteDuration::NotMuted,
-1 => MuteDuration::Forever,
_ => MuteDuration::MutedUntilTimestamp(value),
_ => {
if value <= time() {
MuteDuration::NotMuted
} else {
MuteDuration::MutedUntilTimestamp(value)
}
}
}
}
}