Refactor and fix invitations

-Move invitation handling into RoomPage and delete InvitationPage
-Open the new room after accepting the invitation
This commit is contained in:
Tobias Fella
2021-02-02 01:52:09 +01:00
parent 465334e23f
commit 72907a1f18
7 changed files with 66 additions and 71 deletions

View File

@@ -75,6 +75,12 @@ NeoChatRoom::NeoChatRoom(Connection *connection, QString roomId, JoinState joinS
connect(this, &Room::aboutToAddHistoricalMessages, this, &NeoChatRoom::readMarkerLoadedChanged);
connect(this, &Quotient::Room::eventsHistoryJobChanged, this, &NeoChatRoom::lastActiveTimeChanged);
connect(this, &Room::joinStateChanged, this, [=](JoinState oldState, JoinState newState) {
if(oldState == JoinState::Invite && newState != JoinState::Invite) {
Q_EMIT isInviteChanged();
}
});
}
void NeoChatRoom::uploadFile(const QUrl &url, const QString &body)
@@ -685,3 +691,8 @@ bool NeoChatRoom::readMarkerLoaded() const
const auto it = findInTimeline(readMarkerEventId());
return it != timelineEdge();
}
bool NeoChatRoom::isInvite() const
{
return joinState() == JoinState::Invite;
}