Skip to content
Snippets Groups Projects
Commit 5ef2824e authored by Houmin's avatar Houmin Committed by Stepan Salenikovich
Browse files

Account: do not hardcode trust request key values


Use the DRing::Account::TrustRequest constants instead

Change-Id: I0f6e1e71c21fe689f071abe6d3ae5afed9a71926
Reviewed-by: default avatarStepan Salenikovich <stepan.salenikovich@savoirfairelinux.com>
parent 4605c011
No related branches found
No related tags found
No related merge requests found
......@@ -145,12 +145,14 @@ Account* Account::buildExistingAccountFromId(const QByteArray& _accountId)
if (a->protocol() == Account::Protocol::RING) {
const VectorMapStringString& pending_tr {ConfigurationManager::instance().getTrustRequests(a->id())};
for (const auto& tr_info : pending_tr) {
auto payload = tr_info["payload"];
auto payload = tr_info[DRing::Account::TrustRequest::PAYLOAD];
auto peer = VCardUtils::mapToPersonFromIncomingContactRequest(VCardUtils::toHashMap(payload.toUtf8()),
tr_info["from"]);
a->pendingContactRequestModel()->d_ptr->addRequest(new ContactRequest(a, peer, tr_info["from"],
tr_info["received"].toInt()));
tr_info[DRing::Account::TrustRequest::FROM]);
auto contactRequest = new ContactRequest(a,
peer,
tr_info[DRing::Account::TrustRequest::FROM],
tr_info[DRing::Account::TrustRequest::RECEIVED].toInt());
a->pendingContactRequestModel()->d_ptr->addRequest(contactRequest);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment