Add new message action to pin and unpin messages in rooms

Self-explanatory, now you can manage pinned messages in NeoChat alone.
This commit is contained in:
Joshua Goins
2025-02-21 18:11:20 -05:00
parent 9811c0d97a
commit 2861eb9c60
5 changed files with 48 additions and 0 deletions

View File

@@ -1751,4 +1751,23 @@ ThreadModel *NeoChatRoom::modelForThread(const QString &threadRootId)
return m_threadModels[threadRootId].get();
}
void NeoChatRoom::pinEvent(const QString &eventId)
{
auto eventIds = pinnedEventIds();
eventIds.push_back(eventId);
setPinnedEvents(eventIds);
}
void NeoChatRoom::unpinEvent(const QString &eventId)
{
auto eventIds = pinnedEventIds();
eventIds.removeAll(eventId);
setPinnedEvents(eventIds);
}
bool NeoChatRoom::isEventPinned(const QString &eventId) const
{
return pinnedEventIds().contains(eventId);
}
#include "moc_neochatroom.cpp"