requestDirectChat

Use Quotient::connection::requestDirectChat directly as it can already handle all the conditions.
This commit is contained in:
James Graham
2024-10-04 16:52:05 +00:00
parent a314e56425
commit e26392ce94
7 changed files with 15 additions and 43 deletions

View File

@@ -437,7 +437,19 @@ void RoomManager::setConnection(NeoChatConnection *connection)
if (m_connection == connection) {
return;
}
if (m_connection != nullptr) {
m_connection->disconnect(this);
}
m_connection = connection;
if (m_connection != nullptr) {
connect(m_connection, &NeoChatConnection::directChatAvailable, this, [this](Quotient::Room *directChat) {
resolveResource(directChat->id());
});
}
Q_EMIT connectionChanged();
}