Skip to content
Snippets Groups Projects
Commit 9379af23 authored by Adrien Beraud's avatar Adrien Beraud Committed by Adrien Béraud
Browse files

callmodel: don't send profile

profile was not saved at reception anymore, this was wasting bandwidth

Change-Id: I3cbc1f1683a1e5a4b14616404cde5e27e07623e5
parent 406a251c
No related branches found
No related tags found
No related merge requests found
......@@ -145,12 +145,6 @@ public:
QStringList getCallIds();
/**
* Send the profile VCard into a call
* @param callId
*/
void sendProfile(const QString& callId);
CallModel::CallInfoMap calls;
CallModel::CallParticipantsModelMap participantsModel;
const CallbacksHandler& callbacksHandler;
......@@ -1550,7 +1544,6 @@ CallModelPimpl::slotCallStateChanged(const QString& accountId,
|| previousStatus == call::Status::OUTGOING_RINGING) {
call->startTime = std::chrono::steady_clock::now();
Q_EMIT linked.callStarted(callId);
sendProfile(callId);
}
// Add to calls if in pendingConferences_
for (int i = 0; i < pendingConferencees_.size(); ++i) {
......@@ -1783,31 +1776,6 @@ CallModelPimpl::slotConferenceChanged(const QString& accountId,
Q_EMIT linked.currentCallChanged(currentCall_);
}
void
CallModelPimpl::sendProfile(const QString& callId)
{
auto vCard = linked.owner.accountModel->accountVCard(linked.owner.id);
std::random_device rdev;
auto key = std::to_string(dis(rdev));
int i = 0;
int total = vCard.size() / 1000 + (vCard.size() % 1000 ? 1 : 0);
while (vCard.size()) {
auto sizeLimit = std::min(1000, static_cast<int>(vCard.size()));
MapStringString chunk;
chunk[QString("%1; id=%2,part=%3,of=%4")
.arg(lrc::vCard::PROFILE_VCF)
.arg(key.c_str())
.arg(QString::number(i + 1))
.arg(QString::number(total))]
= vCard.left(sizeLimit);
vCard.remove(0, sizeLimit);
++i;
CallManager::instance().sendTextMessage(linked.owner.id, callId, chunk, false);
}
}
void
CallModelPimpl::onRemoteRecordingChanged(const QString& callId, const QString& peerUri, bool state)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment