Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Thread Signal #849

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Quotient/room.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1777,6 +1777,7 @@ void Room::Private::updateThread(const RoomEvent* event)
}

auto& thread = threads[rme->threadRootEventId()];
const auto isNew = thread.threadRpotId.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 @@ -1798,6 +1799,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 @@ -870,6 +870,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
Loading