basic conversation window binding

This commit is contained in:
Blue 2019-04-09 18:04:08 +03:00
parent 1cbcad44af
commit 4775c7b700
16 changed files with 333 additions and 80 deletions

View file

@ -1,5 +1,6 @@
#include "account.h"
#include <qxmpp/QXmppRosterManager.h>
#include <qxmpp/QXmppMessage.h>
#include <QDateTime>
using namespace Core;
@ -20,6 +21,7 @@ Account::Account(const QString& p_login, const QString& p_server, const QString&
QObject::connect(&client, SIGNAL(connected()), this, SLOT(onClientConnected()));
QObject::connect(&client, SIGNAL(disconnected()), this, SLOT(onClientDisconnected()));
QObject::connect(&client, SIGNAL(presenceReceived(const QXmppPresence&)), this, SLOT(onPresenceReceived(const QXmppPresence&)));
QObject::connect(&client, SIGNAL(messageReceived(const QXmppMessage&)), this, SLOT(onMessageReceived(const QXmppMessage&)));
QXmppRosterManager& rm = client.rosterManager();
@ -330,3 +332,21 @@ void Core::Account::setResource(const QString& p_resource)
{
config.setResource(p_resource);
}
void Core::Account::onMessageReceived(const QXmppMessage& message)
{
qDebug() << "Message received: ";
qDebug() << "- from: " << message.from();
qDebug() << "- to: " << message.to();
qDebug() << "- body: " << message.body();
qDebug() << "- type: " << message.type();
qDebug() << "- state: " << message.state();
qDebug() << "- stamp: " << message.stamp();
qDebug() << "- id: " << message.id();
qDebug() << "- isAttentionRequested: " << message.isAttentionRequested();
qDebug() << "- isReceiptRequested: " << message.isReceiptRequested();
qDebug() << "- receiptId: " << message.receiptId();
qDebug() << "- subject: " << message.subject();
qDebug() << "- thread: " << message.thread();
qDebug() << "- isMarkable: " << message.isMarkable();
}

View file

@ -65,6 +65,7 @@ private slots:
void onRosterItemRemoved(const QString& bareJid);
void onRosterPresenceChanged(const QString& bareJid, const QString& resource);
void onPresenceReceived(const QXmppPresence& presence);
void onMessageReceived(const QXmppMessage& message);
private:
void addedAccount(const QString &bareJid);