paper-plane
paper-plane copied to clipboard
fix: Avoid usize overflow when inserting day dividers
If a chat does not contain any messages, then the application crashes when tag dividers are inserted into the history.
thread 'main' panicked at 'attempt to subtract with overflow', src/tdlib/chat_history.rs:180:56
This crash can be easily avoided by transforming the inequality
x < y - 1
to x + 1 < y
.
Fixes #358.