@@ -105,7 +105,7 @@ ChatDocumentHandler::ChatDocumentHandler(QObject *parent)
|
|||||||
{
|
{
|
||||||
connect(this, &ChatDocumentHandler::roomChanged, this, [this]() {
|
connect(this, &ChatDocumentHandler::roomChanged, this, [this]() {
|
||||||
m_completionModel->setRoom(m_room);
|
m_completionModel->setRoom(m_room);
|
||||||
static NeoChatRoom *previousRoom = nullptr;
|
static QPointer<NeoChatRoom> previousRoom = nullptr;
|
||||||
if (previousRoom) {
|
if (previousRoom) {
|
||||||
disconnect(previousRoom, &NeoChatRoom::chatBoxTextChanged, this, nullptr);
|
disconnect(previousRoom, &NeoChatRoom::chatBoxTextChanged, this, nullptr);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
#include <QAbstractListModel>
|
#include <QAbstractListModel>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
#include <QPointer>
|
||||||
|
|
||||||
class NeoChatRoom;
|
class NeoChatRoom;
|
||||||
|
|
||||||
@@ -70,7 +71,7 @@ private Q_SLOTS:
|
|||||||
void avatarChanged(Quotient::User *user, const Quotient::Room *context);
|
void avatarChanged(Quotient::User *user, const Quotient::Room *context);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
NeoChatRoom *m_currentRoom;
|
QPointer<NeoChatRoom> m_currentRoom;
|
||||||
QList<Quotient::User *> m_users;
|
QList<Quotient::User *> m_users;
|
||||||
|
|
||||||
int findUserPos(Quotient::User *user) const;
|
int findUserPos(Quotient::User *user) const;
|
||||||
|
|||||||
Reference in New Issue
Block a user