This matches the behavior in other room lists. I also tried to normalize
the constructor with SortFilterRoomTreeModel.
(cherry picked from commit 847db41fb3)
Before the fix, the upper arm _ characters in the command's output would be parsed as Markdown italic formatting around the (ツ).
(cherry picked from commit 706f1f7836)
Co-authored-by: Veres Károly <mail+kde@karcsesz.hu>
If an item is added, the corresponding code should be wrapped with
beginInsertRows() and endInsertRows(), otherwise proxy or filter models
can end up with corrupted internal state.
m_members.insert() in refreshMember() should be unnecessary because
if pos is not the same as m_members.size(), then it means there's already
a member.id() item in the member list.
This used to be a feature but kinda broke/changed when we switched to
focusing on context-aware or notable events. Basically instead of only
notable events making a room bold in the room list, it's any unread
messages now.
Use the forget function to leave a room everywhere this is both for consistency and to reduce dependencies. This way no dependency on RoomManager is required to leave a room and since in all cases they have an object they can just call the function.
Create a new module for the room info drawer QML. This also requires moving some QML to LibNeoChat common with other modules. Finally all QML in roominfo is modifed to not depend on app.
This is only called after we already get an event with lastEvent() so
doing it again is useless. Instead, we should refactor it to behave like
similar functions (e.g. isEventHighlighted.)
I'm 99% sure of the recent crashes we've been seeing are double-frees,
the QCache one me and Duha encountered must be one. The QCache is in
charge of the one in ContentProvider, so it will sometimes try to delete
or access something already destroyed by the QML engine.
While I'm at it, I also made sure to check every other Q_INVOKABLE to
ensure we don't hit this elsewhere.
CCBUG: 502747