VCard::ref VCardManager::getVCardAndRequestWhenNeeded(const JID& jid, const boost::posix_time::time_duration& allowedAge) { VCard::ref vcard = storage->getVCard(jid); boost::posix_time::ptime vcardFetchedTime = storage->getVCardWriteTime(jid); bool vcardTooOld = vcard && (vcardFetchedTime.is_special() || ((boost::posix_time::second_clock::universal_time() - vcardFetchedTime) > allowedAge)); if (!vcard || vcardTooOld) { requestVCard(jid); } return vcard; }
/// This function requests the server for vCard of the connected user itself. /// Once received the signal clientVCardReceived() is emitted. Received vCard /// can be get using clientVCard(). QString QXmppVCardManager::requestClientVCard() { return requestVCard(); }
void VCardManager::requestOwnVCard() { requestVCard(JID()); }