RoomManger connection
RoomManger should just get it's connection from Controller, no need to involve QML
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include "roommanager.h"
|
||||
|
||||
#include "chatbarcache.h"
|
||||
#include "controller.h"
|
||||
#include "eventhandler.h"
|
||||
#include "messagecomponenttype.h"
|
||||
#include "models/timelinemodel.h"
|
||||
@@ -42,6 +43,10 @@ RoomManager::RoomManager(QObject *parent)
|
||||
connect(this, &RoomManager::currentRoomChanged, this, [this]() {
|
||||
m_timelineModel->setRoom(m_currentRoom);
|
||||
});
|
||||
|
||||
connect(&Controller::instance(), &Controller::activeConnectionChanged, this, [this](NeoChatConnection *connection) {
|
||||
setConnection(connection);
|
||||
});
|
||||
}
|
||||
|
||||
RoomManager::~RoomManager()
|
||||
@@ -397,11 +402,6 @@ void RoomManager::setChatDocumentHandler(ChatDocumentHandler *handler)
|
||||
Q_EMIT chatDocumentHandlerChanged();
|
||||
}
|
||||
|
||||
NeoChatConnection *RoomManager::connection() const
|
||||
{
|
||||
return m_connection;
|
||||
}
|
||||
|
||||
void RoomManager::setConnection(NeoChatConnection *connection)
|
||||
{
|
||||
if (m_connection == connection) {
|
||||
|
||||
Reference in New Issue
Block a user