mirror of
https://github.com/overte-org/overte.git
synced 2025-04-23 03:53:34 +02:00
Try to load past messages with QXmppArchiveManager
This commit is contained in:
parent
620c3119b4
commit
2c35fe433d
4 changed files with 16 additions and 2 deletions
|
@ -20,11 +20,15 @@ const QString DEFAULT_CHAT_ROOM = "public@public-chat.highfidelity.io";
|
|||
|
||||
XmppClient::XmppClient() :
|
||||
_xmppClient(),
|
||||
_xmppMUCManager()
|
||||
{
|
||||
_xmppMUCManager(),
|
||||
_archiveManager()
|
||||
{
|
||||
AccountManager& accountManager = AccountManager::getInstance();
|
||||
connect(&accountManager, SIGNAL(accessTokenChanged()), this, SLOT(connectToServer()));
|
||||
connect(&accountManager, SIGNAL(logoutComplete()), this, SLOT(disconnectFromServer()));
|
||||
|
||||
_archiveManager = new QXmppArchiveManager;
|
||||
_xmppClient.addExtension(_archiveManager);
|
||||
}
|
||||
|
||||
XmppClient& XmppClient::getInstance() {
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
#include <QObject>
|
||||
#include <QXmppClient.h>
|
||||
#include <QXmppMucManager.h>
|
||||
#include "QXmppArchiveManager.h"
|
||||
|
||||
/// Generalized threaded processor for handling received inbound packets.
|
||||
class XmppClient : public QObject {
|
||||
|
@ -27,6 +28,7 @@ public:
|
|||
|
||||
QXmppClient& getXMPPClient() { return _xmppClient; }
|
||||
const QXmppMucRoom* getPublicChatRoom() const { return _publicChatRoom; }
|
||||
QXmppArchiveManager* getArchiveManager() const { return _archiveManager; }
|
||||
|
||||
private slots:
|
||||
void xmppConnected();
|
||||
|
@ -43,6 +45,7 @@ private:
|
|||
QXmppClient _xmppClient;
|
||||
QXmppMucManager _xmppMUCManager;
|
||||
QXmppMucRoom* _publicChatRoom;
|
||||
QXmppArchiveManager* _archiveManager;
|
||||
};
|
||||
|
||||
#endif // __interface__XmppClient__
|
||||
|
|
|
@ -74,6 +74,7 @@ ChatWindow::ChatWindow() :
|
|||
connect(&xmppClient, SIGNAL(connected()), this, SLOT(connected()));
|
||||
}
|
||||
connect(&xmppClient, SIGNAL(messageReceived(QXmppMessage)), this, SLOT(messageReceived(QXmppMessage)));
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -213,6 +214,7 @@ void ChatWindow::connected() {
|
|||
#ifdef HAVE_QXMPP
|
||||
const QXmppMucRoom* publicChatRoom = XmppClient::getInstance().getPublicChatRoom();
|
||||
connect(publicChatRoom, SIGNAL(participantsChanged()), this, SLOT(participantsChanged()));
|
||||
|
||||
#endif
|
||||
startTimerForTimeStamps();
|
||||
}
|
||||
|
|
|
@ -23,6 +23,10 @@
|
|||
#include <QXmppClient.h>
|
||||
#include <QXmppMessage.h>
|
||||
|
||||
class QXmppArchiveChat;
|
||||
class QXmppArchiveManager;
|
||||
class QXmppResultSetReply;
|
||||
|
||||
#endif
|
||||
|
||||
namespace Ui {
|
||||
|
@ -70,6 +74,7 @@ private slots:
|
|||
void error(QXmppClient::Error error);
|
||||
void participantsChanged();
|
||||
void messageReceived(const QXmppMessage& message);
|
||||
|
||||
#endif
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue