forked from blue/squawk
DONT TAKE, BROKEN! first application of delay manager in code, reception of bundles
This commit is contained in:
parent
5ba97ecc25
commit
927bdf0dab
16 changed files with 261 additions and 139 deletions
|
@ -55,6 +55,7 @@ Account::Account(const QString& p_login, const QString& p_server, const QString&
|
|||
reconnectScheduled(false),
|
||||
reconnectTimer(new QTimer),
|
||||
network(p_net),
|
||||
delay(nullptr),
|
||||
passwordType(Shared::AccountPassword::plain),
|
||||
lastError(Error::none),
|
||||
pepSupport(Shared::Support::unknown),
|
||||
|
@ -67,6 +68,12 @@ Account::Account(const QString& p_login, const QString& p_server, const QString&
|
|||
config.setPassword(p_password);
|
||||
config.setAutoAcceptSubscriptions(true);
|
||||
//config.setAutoReconnectionEnabled(false);
|
||||
delay = new DelayManager::Manager(getBareJid());
|
||||
QObject::connect(delay, &DelayManager::Manager::gotInfo, this, &Account::infoReady);
|
||||
QObject::connect(delay, &DelayManager::Manager::gotOwnInfo, this, &Account::infoReady);
|
||||
|
||||
QObject::connect(delay, &DelayManager::Manager::requestOwnVCard, vm, &QXmppVCardManager::requestClientVCard);
|
||||
QObject::connect(delay, &DelayManager::Manager::requestVCard, vm, &QXmppVCardManager::requestVCard);
|
||||
|
||||
rh->initialize();
|
||||
vh->initialize();
|
||||
|
@ -104,6 +111,9 @@ Account::Account(const QString& p_login, const QString& p_server, const QString&
|
|||
client.addExtension(psm);
|
||||
|
||||
#ifdef WITH_OMEMO
|
||||
QObject::connect(delay, &DelayManager::Manager::requestBundles, oh, &OmemoHandler::requestBundles);
|
||||
QObject::connect(delay, &DelayManager::Manager::requestOwnBundles, oh, &OmemoHandler::requestOwnBundles);
|
||||
|
||||
client.addExtension(tm);
|
||||
client.addExtension(om);
|
||||
om->setSecurityPolicy(QXmpp::Toakafa);
|
||||
|
@ -164,6 +174,7 @@ Account::~Account() {
|
|||
delete mm;
|
||||
delete am;
|
||||
delete cm;
|
||||
delete delay;
|
||||
}
|
||||
|
||||
Shared::ConnectionState Core::Account::getState() const {
|
||||
|
@ -313,7 +324,6 @@ void Core::Account::runDiscoveryService() {
|
|||
dm->requestInfo(getServer());
|
||||
}
|
||||
|
||||
|
||||
void Core::Account::onPresenceReceived(const QXmppPresence& p_presence) {
|
||||
QString id = p_presence.from();
|
||||
QStringList comps = id.split("/");
|
||||
|
@ -642,9 +652,9 @@ void Core::Account::setPepSupport(Shared::Support support) {
|
|||
|
||||
void Core::Account::handleDisconnection() {
|
||||
setPepSupport(Shared::Support::unknown);
|
||||
delay->disconnected();
|
||||
cm->setCarbonsEnabled(false);
|
||||
rh->handleOffline();
|
||||
vh->handleOffline();
|
||||
archiveQueries.clear();
|
||||
}
|
||||
|
||||
|
@ -702,7 +712,9 @@ void Core::Account::setPasswordType(Shared::AccountPassword pt) {
|
|||
passwordType = pt; }
|
||||
|
||||
void Core::Account::setLogin(const QString& p_login) {
|
||||
config.setUser(p_login);}
|
||||
config.setUser(p_login);
|
||||
delay->setOwnJid(getBareJid());
|
||||
}
|
||||
|
||||
void Core::Account::setName(const QString& p_name) {
|
||||
name = p_name;}
|
||||
|
@ -713,7 +725,9 @@ void Core::Account::setPassword(const QString& p_password) {
|
|||
}
|
||||
|
||||
void Core::Account::setServer(const QString& p_server) {
|
||||
config.setDomain(p_server);}
|
||||
config.setDomain(p_server);
|
||||
delay->setOwnJid(getBareJid());
|
||||
}
|
||||
|
||||
void Core::Account::sendMessage(const Shared::Message& data) {
|
||||
mh->sendMessage(data);}
|
||||
|
@ -730,7 +744,8 @@ void Core::Account::replaceMessage(const QString& originalId, const Shared::Mess
|
|||
void Core::Account::requestInfo(const QString& jid) {
|
||||
//TODO switch case of what kind of entity this info request is about
|
||||
//right now it could be only about myself or some contact
|
||||
vh->requestVCard(jid);
|
||||
delay->getInfo(jid);
|
||||
//vh->requestVCard(jid);
|
||||
}
|
||||
|
||||
void Core::Account::updateInfo(const Shared::Info& info) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue