Fix disconnects
This commit is contained in:
@@ -102,7 +102,7 @@ ChatDocumentHandler::ChatDocumentHandler(QObject *parent)
|
|||||||
m_completionModel->setRoom(m_room);
|
m_completionModel->setRoom(m_room);
|
||||||
static NeoChatRoom *previousRoom = nullptr;
|
static NeoChatRoom *previousRoom = nullptr;
|
||||||
if (previousRoom) {
|
if (previousRoom) {
|
||||||
disconnect(nullptr, &NeoChatRoom::chatBoxTextChanged, this, nullptr);
|
disconnect(previousRoom, &NeoChatRoom::chatBoxTextChanged, this, nullptr);
|
||||||
}
|
}
|
||||||
previousRoom = m_room;
|
previousRoom = m_room;
|
||||||
connect(m_room, &NeoChatRoom::chatBoxTextChanged, this, [this]() {
|
connect(m_room, &NeoChatRoom::chatBoxTextChanged, this, [this]() {
|
||||||
|
|||||||
@@ -635,7 +635,7 @@ void Controller::setActiveConnection(Connection *connection)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (m_connection != nullptr) {
|
if (m_connection != nullptr) {
|
||||||
disconnect(connection, &Connection::syncError, this, nullptr);
|
disconnect(m_connection, &Connection::syncError, this, nullptr);
|
||||||
}
|
}
|
||||||
m_connection = connection;
|
m_connection = connection;
|
||||||
if (connection != nullptr) {
|
if (connection != nullptr) {
|
||||||
|
|||||||
@@ -113,7 +113,6 @@ CustomEmojiModel::CustomEmojiModel(QObject *parent)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
CustomEmojiModel::fetchEmojis();
|
CustomEmojiModel::fetchEmojis();
|
||||||
disconnect(nullptr, &Connection::accountDataChanged, this, nullptr);
|
|
||||||
connect(Controller::instance().activeConnection(), &Connection::accountDataChanged, this, [this](const QString &id) {
|
connect(Controller::instance().activeConnection(), &Connection::accountDataChanged, this, [this](const QString &id) {
|
||||||
if (id != QStringLiteral("im.ponies.user_emotes")) {
|
if (id != QStringLiteral("im.ponies.user_emotes")) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user