Definition of '(non-)passive' thread window:
Thread windows can be either 'passive' or 'active'
(default: 'active').
- When opening a thread window in 'active' mode, the messages
are marked as read, and the focus is on the thread window.
- When opening a thread window in 'passive' mode, the messages
are not marked as read and there is no focus on the thread
window. Messages are kept unread until the user interacts with
the thread window (e.g. by clicking on composer).
When the user intentionally opens a thread window, it should
be open in active mode. However, when a thread window is open
without any user iteractions, it should open in passive mode.
The later case is useful in some cases. For instance, when
receiving a new message from a DM conversation, it should
automatically open the corresponding thread window. However,
it should not automatically mark messages as read.
This commit contains 2 bug fixes:
1. When receiving a new message on an active thread window,
it no longer increments the unread counter.
(When the focus is on the composer of the thread window,
the user is immediately reading newly received messages.)
2. When receiving a new message from an unpinned DM conversation,
the newly open thread window is always passive.
(This was not the case before, so when receiving new messages,
it did not increment the unread counter.)