hopefully end of refactoring of vcard to Info widget
This commit is contained in:
parent
bf11d8a74e
commit
e4a2728ef8
20 changed files with 268 additions and 1717 deletions
112
core/account.cpp
112
core/account.cpp
|
@ -138,8 +138,7 @@ Account::Account(const QString& p_login, const QString& p_server, const QString&
|
|||
}
|
||||
}
|
||||
|
||||
Account::~Account()
|
||||
{
|
||||
Account::~Account() {
|
||||
if (reconnectScheduled) {
|
||||
reconnectScheduled = false;
|
||||
reconnectTimer->stop();
|
||||
|
@ -166,13 +165,10 @@ Account::~Account()
|
|||
delete cm;
|
||||
}
|
||||
|
||||
Shared::ConnectionState Core::Account::getState() const
|
||||
{
|
||||
return state;
|
||||
}
|
||||
Shared::ConnectionState Core::Account::getState() const {
|
||||
return state;}
|
||||
|
||||
void Core::Account::connect()
|
||||
{
|
||||
void Core::Account::connect() {
|
||||
if (reconnectScheduled) {
|
||||
reconnectScheduled = false;
|
||||
reconnectTimer->stop();
|
||||
|
@ -194,16 +190,14 @@ void Core::Account::connect()
|
|||
}
|
||||
}
|
||||
|
||||
void Core::Account::onReconnectTimer()
|
||||
{
|
||||
void Core::Account::onReconnectTimer() {
|
||||
if (reconnectScheduled) {
|
||||
reconnectScheduled = false;
|
||||
connect();
|
||||
}
|
||||
}
|
||||
|
||||
void Core::Account::disconnect()
|
||||
{
|
||||
void Core::Account::disconnect() {
|
||||
if (reconnectScheduled) {
|
||||
reconnectScheduled = false;
|
||||
reconnectTimer->stop();
|
||||
|
@ -219,8 +213,7 @@ void Core::Account::disconnect()
|
|||
}
|
||||
}
|
||||
|
||||
void Core::Account::onClientStateChange(QXmppClient::State st)
|
||||
{
|
||||
void Core::Account::onClientStateChange(QXmppClient::State st) {
|
||||
switch (st) {
|
||||
case QXmppClient::ConnectedState: {
|
||||
if (state != Shared::ConnectionState::connected) {
|
||||
|
@ -279,8 +272,7 @@ void Core::Account::onClientStateChange(QXmppClient::State st)
|
|||
}
|
||||
}
|
||||
|
||||
void Core::Account::reconnect()
|
||||
{
|
||||
void Core::Account::reconnect() {
|
||||
if (!reconnectScheduled) { //TODO define behavior if It was connection or disconnecting
|
||||
if (state == Shared::ConnectionState::connected) {
|
||||
reconnectScheduled = true;
|
||||
|
@ -292,8 +284,7 @@ void Core::Account::reconnect()
|
|||
}
|
||||
}
|
||||
|
||||
Shared::Availability Core::Account::getAvailability() const
|
||||
{
|
||||
Shared::Availability Core::Account::getAvailability() const {
|
||||
if (state == Shared::ConnectionState::connected) {
|
||||
QXmppPresence::AvailableStatusType pres = presence.availableStatusType();
|
||||
return static_cast<Shared::Availability>(pres); //they are compatible;
|
||||
|
@ -302,8 +293,7 @@ Shared::Availability Core::Account::getAvailability() const
|
|||
}
|
||||
}
|
||||
|
||||
void Core::Account::setAvailability(Shared::Availability avail)
|
||||
{
|
||||
void Core::Account::setAvailability(Shared::Availability avail) {
|
||||
if (avail == Shared::Availability::offline) {
|
||||
disconnect(); //TODO not sure how to do here - changing state may cause connection or disconnection
|
||||
} else {
|
||||
|
@ -323,23 +313,21 @@ void Core::Account::runDiscoveryService() {
|
|||
}
|
||||
|
||||
|
||||
void Core::Account::onPresenceReceived(const QXmppPresence& p_presence)
|
||||
{
|
||||
void Core::Account::onPresenceReceived(const QXmppPresence& p_presence) {
|
||||
QString id = p_presence.from();
|
||||
QStringList comps = id.split("/");
|
||||
QString jid = comps.front().toLower();
|
||||
QString resource = comps.back();
|
||||
|
||||
if (jid == getBareJid()) {
|
||||
if (resource == getResource()) {
|
||||
if (resource == getResource())
|
||||
emit availabilityChanged(static_cast<Shared::Availability>(p_presence.availableStatusType()));
|
||||
}
|
||||
|
||||
vh->handlePresenceOfMyAccountChange(p_presence);
|
||||
} else {
|
||||
RosterItem* item = rh->getRosterItem(jid);
|
||||
if (item != 0) {
|
||||
if (item != 0)
|
||||
item->handlePresence(p_presence);
|
||||
}
|
||||
}
|
||||
|
||||
switch (p_presence.type()) {
|
||||
|
@ -382,8 +370,7 @@ void Core::Account::onPresenceReceived(const QXmppPresence& p_presence)
|
|||
}
|
||||
}
|
||||
|
||||
void Core::Account::onMamMessageReceived(const QString& queryId, const QXmppMessage& msg)
|
||||
{
|
||||
void Core::Account::onMamMessageReceived(const QString& queryId, const QXmppMessage& msg) {
|
||||
if (msg.id().size() > 0 && (msg.body().size() > 0 || msg.outOfBandUrl().size() > 0)) {
|
||||
std::map<QString, QString>::const_iterator itr = archiveQueries.find(queryId);
|
||||
if (itr != archiveQueries.end()) {
|
||||
|
@ -395,17 +382,15 @@ void Core::Account::onMamMessageReceived(const QString& queryId, const QXmppMess
|
|||
sMsg.setState(Shared::Message::State::sent);
|
||||
|
||||
QString oId = msg.replaceId();
|
||||
if (oId.size() > 0) {
|
||||
if (oId.size() > 0)
|
||||
item->correctMessageInArchive(oId, sMsg);
|
||||
} else {
|
||||
else
|
||||
item->addMessageToArchive(sMsg);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Core::Account::requestArchive(const QString& jid, int count, const QString& before)
|
||||
{
|
||||
void Core::Account::requestArchive(const QString& jid, int count, const QString& before) {
|
||||
qDebug() << "An archive request for " << jid << ", before " << before;
|
||||
RosterItem* contact = rh->getRosterItem(jid);
|
||||
|
||||
|
@ -423,8 +408,7 @@ void Core::Account::requestArchive(const QString& jid, int count, const QString&
|
|||
contact->requestHistory(count, before);
|
||||
}
|
||||
|
||||
void Core::Account::onContactNeedHistory(const QString& before, const QString& after, const QDateTime& at)
|
||||
{
|
||||
void Core::Account::onContactNeedHistory(const QString& before, const QString& after, const QDateTime& at) {
|
||||
RosterItem* contact = static_cast<RosterItem*>(sender());
|
||||
|
||||
QString to;
|
||||
|
@ -468,8 +452,7 @@ void Core::Account::onContactNeedHistory(const QString& before, const QString& a
|
|||
archiveQueries.insert(std::make_pair(q, contact->jid));
|
||||
}
|
||||
|
||||
void Core::Account::onMamResultsReceived(const QString& queryId, const QXmppResultSetReply& resultSetReply, bool complete)
|
||||
{
|
||||
void Core::Account::onMamResultsReceived(const QString& queryId, const QXmppResultSetReply& resultSetReply, bool complete) {
|
||||
std::map<QString, QString>::const_iterator itr = archiveQueries.find(queryId);
|
||||
if (itr != archiveQueries.end()) {
|
||||
QString jid = itr->second;
|
||||
|
@ -484,14 +467,12 @@ void Core::Account::onMamResultsReceived(const QString& queryId, const QXmppResu
|
|||
}
|
||||
}
|
||||
|
||||
void Core::Account::onMamLog(QXmppLogger::MessageType type, const QString& msg)
|
||||
{
|
||||
void Core::Account::onMamLog(QXmppLogger::MessageType type, const QString& msg) {
|
||||
qDebug() << "MAM MESSAGE LOG::";
|
||||
qDebug() << msg;
|
||||
}
|
||||
|
||||
void Core::Account::onClientError(QXmppClient::Error err)
|
||||
{
|
||||
void Core::Account::onClientError(QXmppClient::Error err) {
|
||||
qDebug() << "Error";
|
||||
QString errorText;
|
||||
QString errorType;
|
||||
|
@ -601,22 +582,18 @@ void Core::Account::onClientError(QXmppClient::Error err)
|
|||
emit error(errorText);
|
||||
}
|
||||
|
||||
void Core::Account::subscribeToContact(const QString& jid, const QString& reason)
|
||||
{
|
||||
if (state == Shared::ConnectionState::connected) {
|
||||
void Core::Account::subscribeToContact(const QString& jid, const QString& reason) {
|
||||
if (state == Shared::ConnectionState::connected)
|
||||
rm->subscribe(jid, reason);
|
||||
} else {
|
||||
else
|
||||
qDebug() << "An attempt to subscribe account " << name << " to contact " << jid << " but the account is not in the connected state, skipping";
|
||||
}
|
||||
}
|
||||
|
||||
void Core::Account::unsubscribeFromContact(const QString& jid, const QString& reason)
|
||||
{
|
||||
if (state == Shared::ConnectionState::connected) {
|
||||
void Core::Account::unsubscribeFromContact(const QString& jid, const QString& reason) {
|
||||
if (state == Shared::ConnectionState::connected)
|
||||
rm->unsubscribe(jid, reason);
|
||||
} else {
|
||||
else
|
||||
qDebug() << "An attempt to unsubscribe account " << name << " from contact " << jid << " but the account is not in the connected state, skipping";
|
||||
}
|
||||
}
|
||||
|
||||
void Core::Account::removeContactRequest(const QString& jid) {
|
||||
|
@ -625,8 +602,7 @@ void Core::Account::removeContactRequest(const QString& jid) {
|
|||
void Core::Account::addContactRequest(const QString& jid, const QString& name, const QSet<QString>& groups) {
|
||||
rh->addContactRequest(jid, name, groups);}
|
||||
|
||||
void Core::Account::setRoomAutoJoin(const QString& jid, bool joined)
|
||||
{
|
||||
void Core::Account::setRoomAutoJoin(const QString& jid, bool joined) {
|
||||
Conference* conf = rh->getConference(jid);
|
||||
if (conf == 0) {
|
||||
qDebug() << "An attempt to set auto join to the non existing room" << jid << "of the account" << getName() << ", skipping";
|
||||
|
@ -636,8 +612,7 @@ void Core::Account::setRoomAutoJoin(const QString& jid, bool joined)
|
|||
conf->setAutoJoin(joined);
|
||||
}
|
||||
|
||||
void Core::Account::setRoomJoined(const QString& jid, bool joined)
|
||||
{
|
||||
void Core::Account::setRoomJoined(const QString& jid, bool joined) {
|
||||
Conference* conf = rh->getConference(jid);
|
||||
if (conf == 0) {
|
||||
qDebug() << "An attempt to set joined to the non existing room" << jid << "of the account" << getName() << ", skipping";
|
||||
|
@ -657,16 +632,14 @@ void Core::Account::discoverInfo(const QString& address, const QString& node) {
|
|||
}
|
||||
}
|
||||
|
||||
void Core::Account::setPepSupport(Shared::Support support)
|
||||
{
|
||||
void Core::Account::setPepSupport(Shared::Support support) {
|
||||
if (support != pepSupport) {
|
||||
pepSupport = support;
|
||||
emit pepSupportChanged(pepSupport);
|
||||
}
|
||||
}
|
||||
|
||||
void Core::Account::handleDisconnection()
|
||||
{
|
||||
void Core::Account::handleDisconnection() {
|
||||
setPepSupport(Shared::Support::unknown);
|
||||
cm->setCarbonsEnabled(false);
|
||||
rh->handleOffline();
|
||||
|
@ -674,14 +647,13 @@ void Core::Account::handleDisconnection()
|
|||
archiveQueries.clear();
|
||||
}
|
||||
|
||||
void Core::Account::onContactHistoryResponse(const std::list<Shared::Message>& list, bool last)
|
||||
{
|
||||
void Core::Account::onContactHistoryResponse(const std::list<Shared::Message>& list, bool last) {
|
||||
RosterItem* contact = static_cast<RosterItem*>(sender());
|
||||
|
||||
qDebug() << "Collected history for contact " << contact->jid << list.size() << "elements";
|
||||
if (last) {
|
||||
if (last)
|
||||
qDebug() << "The response contains the first accounted message";
|
||||
}
|
||||
|
||||
emit responseArchive(contact->jid, list, last);
|
||||
}
|
||||
|
||||
|
@ -754,11 +726,17 @@ void Core::Account::resendMessage(const QString& jid, const QString& id) {
|
|||
void Core::Account::replaceMessage(const QString& originalId, const Shared::Message& data) {
|
||||
mh->sendMessage(data, false, originalId);}
|
||||
|
||||
void Core::Account::requestVCard(const QString& jid) {
|
||||
vh->requestVCard(jid);}
|
||||
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);
|
||||
}
|
||||
|
||||
void Core::Account::uploadVCard(const Shared::VCard& card) {
|
||||
vh->uploadVCard(card);}
|
||||
void Core::Account::updateInfo(const Shared::Info& info) {
|
||||
//TODO switch case of what kind of entity this info update is about
|
||||
//right now it could be only about myself
|
||||
vh->uploadVCard(info.vcard);
|
||||
}
|
||||
|
||||
QString Core::Account::getAvatarPath() const {
|
||||
return vh->getAvatarPath();}
|
||||
|
|
|
@ -46,6 +46,7 @@
|
|||
|
||||
#include <shared/shared.h>
|
||||
#include <shared/identity.h>
|
||||
#include <shared/info.h>
|
||||
#include "contact.h"
|
||||
#include "conference.h"
|
||||
#include <core/components/networkaccess.h>
|
||||
|
@ -126,7 +127,7 @@ public:
|
|||
void setRoomAutoJoin(const QString& jid, bool joined);
|
||||
void removeRoomRequest(const QString& jid);
|
||||
void addRoomRequest(const QString& jid, const QString& nick, const QString& password, bool autoJoin);
|
||||
void uploadVCard(const Shared::VCard& card);
|
||||
void updateInfo(const Shared::Info& info);
|
||||
void resendMessage(const QString& jid, const QString& id);
|
||||
void replaceMessage(const QString& originalId, const Shared::Message& data);
|
||||
void invalidatePassword();
|
||||
|
@ -137,7 +138,7 @@ public slots:
|
|||
void connect();
|
||||
void disconnect();
|
||||
void reconnect();
|
||||
void requestVCard(const QString& jid);
|
||||
void requestInfo(const QString& jid);
|
||||
|
||||
signals:
|
||||
void changed(const QMap<QString, QVariant>& data);
|
||||
|
@ -161,7 +162,7 @@ signals:
|
|||
void addRoomParticipant(const QString& jid, const QString& nickName, const QMap<QString, QVariant>& data);
|
||||
void changeRoomParticipant(const QString& jid, const QString& nickName, const QMap<QString, QVariant>& data);
|
||||
void removeRoomParticipant(const QString& jid, const QString& nickName);
|
||||
void receivedVCard(const QString& jid, const Shared::VCard& card);
|
||||
void infoReady(const Shared::Info& info);
|
||||
void uploadFile(const QFileInfo& file, const QUrl& set, const QUrl& get, QMap<QString, QString> headers);
|
||||
void uploadFileError(const QString& jid, const QString& messageId, const QString& error);
|
||||
void needPassword();
|
||||
|
|
|
@ -170,7 +170,7 @@ void Core::Conference::onRoomParticipantAdded(const QString& p_name)
|
|||
} else {
|
||||
cData.insert("avatarState", static_cast<uint>(Shared::Avatar::empty));
|
||||
cData.insert("avatarPath", "");
|
||||
requestVCard(p_name);
|
||||
emit requestVCard(p_name);
|
||||
}
|
||||
|
||||
emit addParticipant(resource, cData);
|
||||
|
|
|
@ -156,7 +156,7 @@ void Core::RosterHandler::careAboutAvatar(Core::RosterItem* item, QMap<QString,
|
|||
} else {
|
||||
data.insert("avatarState", QVariant::fromValue(Shared::Avatar::empty));
|
||||
data.insert("avatarPath", "");
|
||||
acc->requestVCard(item->jid);
|
||||
acc->vh->requestVCard(item->jid);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -197,7 +197,7 @@ void Core::RosterHandler::handleNewRosterItem(Core::RosterItem* contact)
|
|||
connect(contact, &RosterItem::historyResponse, this->acc, &Account::onContactHistoryResponse);
|
||||
connect(contact, &RosterItem::nameChanged, this, &RosterHandler::onContactNameChanged);
|
||||
connect(contact, &RosterItem::avatarChanged, this, &RosterHandler::onContactAvatarChanged);
|
||||
connect(contact, &RosterItem::requestVCard, this->acc, &Account::requestVCard);
|
||||
connect(contact, &RosterItem::requestVCard, this->acc->vh, &VCardHandler::requestVCard);
|
||||
}
|
||||
|
||||
void Core::RosterHandler::handleNewContact(Core::Contact* contact)
|
||||
|
|
|
@ -80,9 +80,7 @@ void Core::VCardHandler::initialize() {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void Core::VCardHandler::onVCardReceived(const QXmppVCardIq& card)
|
||||
{
|
||||
void Core::VCardHandler::onVCardReceived(const QXmppVCardIq& card) {
|
||||
QString id = card.from();
|
||||
QStringList comps = id.split("/");
|
||||
QString jid = comps.front().toLower();
|
||||
|
@ -102,13 +100,13 @@ void Core::VCardHandler::onVCardReceived(const QXmppVCardIq& card)
|
|||
return;
|
||||
}
|
||||
|
||||
Shared::VCard vCard = item->handleResponseVCard(card, resource);
|
||||
Shared::Info info(jid, Shared::EntryType::contact);
|
||||
info.vcard = item->handleResponseVCard(card, resource);
|
||||
|
||||
emit acc->receivedVCard(jid, vCard);
|
||||
emit acc->infoReady(info);
|
||||
}
|
||||
|
||||
void Core::VCardHandler::onOwnVCardReceived(const QXmppVCardIq& card)
|
||||
{
|
||||
void Core::VCardHandler::onOwnVCardReceived(const QXmppVCardIq& card) {
|
||||
QByteArray ava = card.photo();
|
||||
bool avaChanged = false;
|
||||
QString path = QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + "/" + acc->name + "/";
|
||||
|
@ -189,32 +187,30 @@ void Core::VCardHandler::onOwnVCardReceived(const QXmppVCardIq& card)
|
|||
|
||||
ownVCardRequestInProgress = false;
|
||||
|
||||
Shared::VCard vCard;
|
||||
initializeVCard(vCard, card);
|
||||
Shared::Info info(acc->getBareJid(), Shared::EntryType::contact, true);
|
||||
initializeVCard(info.vcard, card);
|
||||
|
||||
if (avatarType.size() > 0) {
|
||||
vCard.setAvatarType(Shared::Avatar::valid);
|
||||
vCard.setAvatarPath(path + "avatar." + avatarType);
|
||||
info.vcard.setAvatarType(Shared::Avatar::valid);
|
||||
info.vcard.setAvatarPath(path + "avatar." + avatarType);
|
||||
} else {
|
||||
vCard.setAvatarType(Shared::Avatar::empty);
|
||||
info.vcard.setAvatarType(Shared::Avatar::empty);
|
||||
}
|
||||
|
||||
emit acc->receivedVCard(acc->getBareJid(), vCard);
|
||||
emit acc->infoReady(info);
|
||||
}
|
||||
|
||||
void Core::VCardHandler::handleOffline()
|
||||
{
|
||||
void Core::VCardHandler::handleOffline() {
|
||||
pendingVCardRequests.clear();
|
||||
Shared::VCard vCard; //just to show, that there is now more pending request
|
||||
for (const QString& jid : pendingVCardRequests) {
|
||||
emit acc->receivedVCard(jid, vCard); //need to show it better in the future, like with an error
|
||||
Shared::Info info(jid, Shared::EntryType::contact);
|
||||
emit acc->infoReady(info); //need to show it better in the future, like with an error
|
||||
}
|
||||
pendingVCardRequests.clear();
|
||||
ownVCardRequestInProgress = false;
|
||||
}
|
||||
|
||||
void Core::VCardHandler::requestVCard(const QString& jid)
|
||||
{
|
||||
void Core::VCardHandler::requestVCard(const QString& jid) {
|
||||
if (pendingVCardRequests.find(jid) == pendingVCardRequests.end()) {
|
||||
qDebug() << "requesting vCard" << jid;
|
||||
if (jid == acc->getBareJid()) {
|
||||
|
@ -229,8 +225,7 @@ void Core::VCardHandler::requestVCard(const QString& jid)
|
|||
}
|
||||
}
|
||||
|
||||
void Core::VCardHandler::handlePresenceOfMyAccountChange(const QXmppPresence& p_presence)
|
||||
{
|
||||
void Core::VCardHandler::handlePresenceOfMyAccountChange(const QXmppPresence& p_presence) {
|
||||
if (!ownVCardRequestInProgress) {
|
||||
switch (p_presence.vCardUpdateType()) {
|
||||
case QXmppPresence::VCardUpdateNone: //this presence has nothing to do with photo
|
||||
|
@ -253,8 +248,7 @@ void Core::VCardHandler::handlePresenceOfMyAccountChange(const QXmppPresence& p_
|
|||
}
|
||||
}
|
||||
|
||||
void Core::VCardHandler::uploadVCard(const Shared::VCard& card)
|
||||
{
|
||||
void Core::VCardHandler::uploadVCard(const Shared::VCard& card) {
|
||||
QXmppVCardIq iq;
|
||||
initializeQXmppVCard(iq, card);
|
||||
|
||||
|
@ -283,11 +277,10 @@ void Core::VCardHandler::uploadVCard(const Shared::VCard& card)
|
|||
} else {
|
||||
if (avatarType.size() > 0) {
|
||||
QFile oA(oldPath);
|
||||
if (!oA.open(QFile::ReadOnly)) {
|
||||
if (!oA.open(QFile::ReadOnly))
|
||||
qDebug() << "Couldn't read old avatar of account" << acc->name << ", uploading empty avatar";
|
||||
} else {
|
||||
else
|
||||
data = oA.readAll();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -303,11 +296,9 @@ void Core::VCardHandler::uploadVCard(const Shared::VCard& card)
|
|||
onOwnVCardReceived(iq);
|
||||
}
|
||||
|
||||
QString Core::VCardHandler::getAvatarPath() const
|
||||
{
|
||||
if (avatarType.size() == 0) {
|
||||
QString Core::VCardHandler::getAvatarPath() const {
|
||||
if (avatarType.size() == 0)
|
||||
return "";
|
||||
} else {
|
||||
else
|
||||
return QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + "/" + acc->name + "/" + "avatar." + avatarType;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -180,7 +180,7 @@ void Core::Squawk::addAccount(
|
|||
connect(acc, &Account::changeRoomParticipant, this, &Squawk::onAccountChangeRoomPresence);
|
||||
connect(acc, &Account::removeRoomParticipant, this, &Squawk::onAccountRemoveRoomPresence);
|
||||
|
||||
connect(acc, &Account::receivedVCard, this, &Squawk::responseVCard);
|
||||
connect(acc, &Account::infoReady, this, &Squawk::responseInfo);
|
||||
|
||||
connect(acc, &Account::uploadFileError, this, &Squawk::onAccountUploadFileError);
|
||||
|
||||
|
@ -717,24 +717,24 @@ void Core::Squawk::renameContactRequest(const QString& account, const QString& j
|
|||
itr->second->renameContactRequest(jid, newName);
|
||||
}
|
||||
|
||||
void Core::Squawk::requestVCard(const QString& account, const QString& jid)
|
||||
void Core::Squawk::requestInfo(const QString& account, const QString& jid)
|
||||
{
|
||||
AccountsMap::const_iterator itr = amap.find(account);
|
||||
if (itr == amap.end()) {
|
||||
qDebug() << "An attempt to request" << jid << "vcard of non existing account" << account << ", skipping";
|
||||
qDebug() << "An attempt to request info about" << jid << "of non existing account" << account << ", skipping";
|
||||
return;
|
||||
}
|
||||
itr->second->requestVCard(jid);
|
||||
itr->second->requestInfo(jid);
|
||||
}
|
||||
|
||||
void Core::Squawk::uploadVCard(const QString& account, const Shared::VCard& card)
|
||||
void Core::Squawk::updateInfo(const QString& account, const Shared::Info& info)
|
||||
{
|
||||
AccountsMap::const_iterator itr = amap.find(account);
|
||||
if (itr == amap.end()) {
|
||||
qDebug() << "An attempt to upload vcard to non existing account" << account << ", skipping";
|
||||
qDebug() << "An attempt to update info to non existing account" << account << ", skipping";
|
||||
return;
|
||||
}
|
||||
itr->second->uploadVCard(card);
|
||||
itr->second->updateInfo(info);
|
||||
}
|
||||
|
||||
void Core::Squawk::readSettings()
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include "shared/enums.h"
|
||||
#include "shared/message.h"
|
||||
#include "shared/global.h"
|
||||
#include "shared/info.h"
|
||||
#include "shared/clientinfo.h"
|
||||
#include "external/simpleCrypt/simplecrypt.h"
|
||||
|
||||
|
@ -87,7 +88,7 @@ signals:
|
|||
void fileDownloadComplete(const std::list<Shared::MessageInfo> msgs, const QString& path);
|
||||
void fileUploadComplete(const std::list<Shared::MessageInfo> msgs, const QString& url, const QString& path);
|
||||
|
||||
void responseVCard(const QString& jid, const Shared::VCard& card);
|
||||
void responseInfo(const Shared::Info& info);
|
||||
void changeMessage(const QString& account, const QString& jid, const QString& id, const QMap<QString, QVariant>& data);
|
||||
void requestPassword(const QString& account, bool authernticationError);
|
||||
|
||||
|
@ -123,8 +124,8 @@ public slots:
|
|||
|
||||
void fileDownloadRequest(const QString& url);
|
||||
|
||||
void requestVCard(const QString& account, const QString& jid);
|
||||
void uploadVCard(const QString& account, const Shared::VCard& card);
|
||||
void requestInfo(const QString& account, const QString& jid);
|
||||
void updateInfo(const QString& account, const Shared::Info& info);
|
||||
void responsePassword(const QString& account, const QString& password);
|
||||
void onLocalPathInvalid(const QString& path);
|
||||
void changeDownloadsPath(const QString& path);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue