Fix pagestack after login
This commit is contained in:
@@ -581,6 +581,7 @@ bool Controller::isOnline() const
|
|||||||
return m_mgr->isOnline();
|
return m_mgr->isOnline();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: Remove in favor of RoomManager::joinRoom
|
||||||
void Controller::joinRoom(const QString &alias)
|
void Controller::joinRoom(const QString &alias)
|
||||||
{
|
{
|
||||||
if (!alias.contains(":")) {
|
if (!alias.contains(":")) {
|
||||||
@@ -589,14 +590,7 @@ void Controller::joinRoom(const QString &alias)
|
|||||||
}
|
}
|
||||||
|
|
||||||
const auto knownServer = alias.mid(alias.indexOf(":") + 1);
|
const auto knownServer = alias.mid(alias.indexOf(":") + 1);
|
||||||
auto joinRoomJob = m_connection->joinRoom(alias, QStringList{knownServer});
|
RoomManager::instance().joinRoom(m_connection, alias, QStringList{knownServer});
|
||||||
|
|
||||||
connect(joinRoomJob, &JoinRoomJob::failure, [=] {
|
|
||||||
Q_EMIT errorOccured(i18n("Server error when joining the room \"%1\": %2", joinRoomJob->errorString()));
|
|
||||||
});
|
|
||||||
connect(joinRoomJob, &JoinRoomJob::success, [this, joinRoomJob] {
|
|
||||||
Q_EMIT errorOccured(joinRoomJob->roomId());
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Controller::openOrCreateDirectChat(NeoChatUser *user)
|
void Controller::openOrCreateDirectChat(NeoChatUser *user)
|
||||||
|
|||||||
@@ -289,7 +289,6 @@ void RoomListModel::updateRoom(Room *room, Room *prev)
|
|||||||
} else {
|
} else {
|
||||||
beginInsertRows(QModelIndex(), m_rooms.count(), m_rooms.count());
|
beginInsertRows(QModelIndex(), m_rooms.count(), m_rooms.count());
|
||||||
doAddRoom(newRoom);
|
doAddRoom(newRoom);
|
||||||
RoomManager::instance().enterRoom(qobject_cast<NeoChatRoom *>(newRoom));
|
|
||||||
endInsertRows();
|
endInsertRows();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -194,9 +194,10 @@ void RoomManager::joinRoom(Quotient::Connection *account,
|
|||||||
const QString &roomAliasOrId,
|
const QString &roomAliasOrId,
|
||||||
const QStringList &viaServers)
|
const QStringList &viaServers)
|
||||||
{
|
{
|
||||||
// This should trigger a signal in Quotient once done and NeoChat will
|
|
||||||
// react to it and open the newly joined room.
|
|
||||||
account->joinRoom(QUrl::toPercentEncoding(roomAliasOrId), viaServers);
|
account->joinRoom(QUrl::toPercentEncoding(roomAliasOrId), viaServers);
|
||||||
|
connectSingleShot(account, &Quotient::Connection::newRoom, this, [=](Quotient::Room *room){
|
||||||
|
enterRoom(dynamic_cast<NeoChatRoom *>(room));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RoomManager::visitNonMatrix(const QUrl &url)
|
bool RoomManager::visitNonMatrix(const QUrl &url)
|
||||||
|
|||||||
Reference in New Issue
Block a user