Skip to content

Commit

Permalink
Merge #849(nvrwhere): New Thread Signal
Browse files Browse the repository at this point in the history
  • Loading branch information
KitsuneRal authored Jan 26, 2025
2 parents 310de80 + e212384 commit 40c172a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Quotient/room.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1779,6 +1779,7 @@ void Room::Private::updateThread(const RoomEvent* event)
}

auto& thread = threads[rme->threadRootEventId()];
const auto isNew = thread.threadRootId.isEmpty();
if (thread.threadRootId.isEmpty()) {
thread.threadRootId = rme->threadRootEventId();
// If we can't find the root we assume it's a historical event and will be loaded later.
Expand All @@ -1800,6 +1801,8 @@ void Room::Private::updateThread(const RoomEvent* event)
thread.addEvent(rme,
(threadLatestIndex == eventsIndex.cend() || *eventIndexIt > *threadLatestIndex),
rme->senderId() == connection->userId());

if (isNew) { emit q->newThread(thread); }
}

const Avatar& Room::memberAvatarObject(const QString& memberId) const
Expand Down
3 changes: 3 additions & 0 deletions Quotient/room.h
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,9 @@ public Q_SLOTS:
*/
void messageSent(QString txnId, QString eventId);

//! A new thread has been created/added in the room
void newThread(const Thread& newThread);

/** A common signal for various kinds of changes in the room
* Aside from all changes in the room state
* @param changes a set of flags describing what changes occurred
Expand Down

0 comments on commit 40c172a

Please sign in to comment.