mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-07-23 17:05:28 +02:00
call-swarm: follow daemon changes
Change-Id: I32e83c2ccf82be78fbdd6e9932105228dd6dee8b
This commit is contained in:
parent
87c215deb7
commit
28c1cbbb34
9 changed files with 49 additions and 39 deletions
2
daemon
2
daemon
|
@ -1 +1 @@
|
|||
Subproject commit d15b4f79613a3cbbd427ea331958f48e4a34f0a4
|
||||
Subproject commit e2107772fd3d0b11f0721dec98f95a610b7f9a77
|
|
@ -354,10 +354,11 @@ CallAdapter::onCallInfosChanged(const QString& accountId, const QString& callId)
|
|||
}
|
||||
|
||||
void
|
||||
CallAdapter::onCallAddedToConference(const QString& callId, const QString& confId)
|
||||
CallAdapter::onCallAddedToConference(const QString& callId, const QString& conversationId, const QString& confId)
|
||||
{
|
||||
Q_UNUSED(callId)
|
||||
Q_UNUSED(confId)
|
||||
Q_UNUSED(conversationId)
|
||||
saveConferenceSubcalls();
|
||||
}
|
||||
|
||||
|
|
|
@ -122,7 +122,7 @@ public Q_SLOTS:
|
|||
void onAccountChanged();
|
||||
void onCallStatusChanged(const QString& accountId, const QString& callId);
|
||||
void onCallStatusChanged(const QString& callId, int code);
|
||||
void onCallAddedToConference(const QString& callId, const QString& confId);
|
||||
void onCallAddedToConference(const QString& callId, const QString& conversationId, const QString& confId);
|
||||
void onCallStarted(const QString& callId);
|
||||
void onCallEnded(const QString& callId);
|
||||
void onCallInfosChanged(const QString& accountId, const QString& callId);
|
||||
|
|
|
@ -480,9 +480,10 @@ Q_SIGNALS:
|
|||
/**
|
||||
* Emitted when a call is added to a conference
|
||||
* @param callId
|
||||
* @param conversationId
|
||||
* @param confId
|
||||
*/
|
||||
void callAddedToConference(const QString& callId, const QString& confId) const;
|
||||
void callAddedToConference(const QString& callId, const QString& conversationId, const QString& confId) const;
|
||||
|
||||
/**
|
||||
* Emitted when a voice mail notice arrives
|
||||
|
|
|
@ -548,9 +548,9 @@ CallbacksHandler::slotIncomingMessage(const QString& accountId,
|
|||
}
|
||||
|
||||
void
|
||||
CallbacksHandler::slotConferenceCreated(const QString& accountId, const QString& callId)
|
||||
CallbacksHandler::slotConferenceCreated(const QString& accountId, const QString& convId, const QString& callId)
|
||||
{
|
||||
Q_EMIT conferenceCreated(accountId, callId);
|
||||
Q_EMIT conferenceCreated(accountId, convId, callId);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -173,7 +173,7 @@ Q_SIGNALS:
|
|||
* Connect this signal to know when a new conference is created
|
||||
* @param callId of the conference
|
||||
*/
|
||||
void conferenceCreated(const QString& accountId, const QString& callId);
|
||||
void conferenceCreated(const QString& accountId, const QString& conversationId, const QString& callId);
|
||||
void conferenceChanged(const QString& accountId, const QString& confId, const QString& state);
|
||||
/**
|
||||
* Connect this signal to know when a conference is removed
|
||||
|
@ -500,9 +500,10 @@ private Q_SLOTS:
|
|||
/**
|
||||
* Emit conferenceCreated
|
||||
* @param accountId
|
||||
* @param callId of the conference
|
||||
* @param callId of the conference
|
||||
* @param conversationId of the conference
|
||||
*/
|
||||
void slotConferenceCreated(const QString& accountId, const QString& callId);
|
||||
void slotConferenceCreated(const QString& accountId, const QString& conversationId, const QString& callId);
|
||||
/**
|
||||
* Emit conferenceRemove
|
||||
* @param accountId
|
||||
|
|
|
@ -236,7 +236,7 @@ public Q_SLOTS:
|
|||
* Listen from CallbacksHandler when a conference is created.
|
||||
* @param callId
|
||||
*/
|
||||
void slotConferenceCreated(const QString& accountId, const QString& callId);
|
||||
void slotConferenceCreated(const QString& accountId, const QString& conversationId, const QString& callId);
|
||||
void slotConferenceChanged(const QString& accountId,
|
||||
const QString& callId,
|
||||
const QString& state);
|
||||
|
@ -839,12 +839,12 @@ CallModel::joinCalls(const QString& callIdA, const QString& callIdB) const
|
|||
try {
|
||||
auto& accountInfo = owner.accountModel->getAccountInfo(accountIdCall1);
|
||||
if (accountInfo.callModel->hasCall(callIdA)) {
|
||||
Q_EMIT accountInfo.callModel->callAddedToConference(callIdA, callIdB);
|
||||
Q_EMIT accountInfo.callModel->callAddedToConference(callIdA, "", callIdB);
|
||||
}
|
||||
} catch (...) {
|
||||
}
|
||||
} else {
|
||||
Q_EMIT callAddedToConference(callIdA, callIdB);
|
||||
Q_EMIT callAddedToConference(callIdA, "", callIdB);
|
||||
}
|
||||
} else if (call1.type == call::Type::CONFERENCE || call2.type == call::Type::CONFERENCE) {
|
||||
auto call = call1.type == call::Type::CONFERENCE ? callIdB : callIdA;
|
||||
|
@ -863,12 +863,12 @@ CallModel::joinCalls(const QString& callIdA, const QString& callIdB) const
|
|||
try {
|
||||
auto& accountInfo = owner.accountModel->getAccountInfo(accountCall);
|
||||
if (accountInfo.callModel->hasCall(call)) {
|
||||
accountInfo.callModel->pimpl_->slotConferenceCreated(owner.id, conf);
|
||||
accountInfo.callModel->pimpl_->slotConferenceCreated(owner.id, "", conf);
|
||||
}
|
||||
} catch (...) {
|
||||
}
|
||||
} else
|
||||
Q_EMIT callAddedToConference(call, conf);
|
||||
Q_EMIT callAddedToConference(call, "", conf);
|
||||
|
||||
// Remove from pendingConferences_
|
||||
for (int i = 0; i < pimpl_->pendingConferencees_.size(); ++i) {
|
||||
|
@ -1169,7 +1169,7 @@ CallModelPimpl::initConferencesFromDaemon()
|
|||
? call::Status::IN_PROGRESS
|
||||
: call::Status::PAUSED;
|
||||
callInfo->startTime = now - std::chrono::seconds(diff);
|
||||
Q_EMIT linked.callAddedToConference(call, callId);
|
||||
Q_EMIT linked.callAddedToConference(call, "", callId);
|
||||
}
|
||||
callInfo->type = call::Type::CONFERENCE;
|
||||
VectorMapStringString infos = CallManager::instance().getConferenceInfos(linked.owner.id,
|
||||
|
@ -1660,7 +1660,7 @@ CallModelPimpl::slotOnConferenceInfosUpdated(const QString& confId,
|
|||
// And must be notified when a new
|
||||
QStringList callList = CallManager::instance().getParticipantList(linked.owner.id, confId);
|
||||
Q_FOREACH (const auto& call, callList) {
|
||||
Q_EMIT linked.callAddedToConference(call, confId);
|
||||
Q_EMIT linked.callAddedToConference(call, "", confId);
|
||||
if (calls.find(call) == calls.end()) {
|
||||
qWarning() << "Call not found";
|
||||
} else {
|
||||
|
@ -1710,11 +1710,10 @@ CallModel::hasCall(const QString& callId) const
|
|||
}
|
||||
|
||||
void
|
||||
CallModelPimpl::slotConferenceCreated(const QString& accountId, const QString& confId)
|
||||
CallModelPimpl::slotConferenceCreated(const QString& accountId, const QString& conversationId, const QString& confId)
|
||||
{
|
||||
if (accountId != linked.owner.id)
|
||||
return;
|
||||
QStringList callList = CallManager::instance().getParticipantList(linked.owner.id, confId);
|
||||
|
||||
auto callInfo = std::make_shared<call::Info>();
|
||||
callInfo->id = confId;
|
||||
|
@ -1734,22 +1733,27 @@ CallModelPimpl::slotConferenceCreated(const QString& accountId, const QString& c
|
|||
calls[confId] = callInfo;
|
||||
|
||||
QString currentCallId = currentCall_;
|
||||
Q_FOREACH (const auto& call, callList) {
|
||||
Q_EMIT linked.callAddedToConference(call, confId);
|
||||
// Remove call from pendingConferences_
|
||||
for (int i = 0; i < pendingConferencees_.size(); ++i) {
|
||||
if (pendingConferencees_.at(i).callId == call) {
|
||||
Q_EMIT linked.beginRemovePendingConferenceesRows(i);
|
||||
pendingConferencees_.removeAt(i);
|
||||
Q_EMIT linked.endRemovePendingConferenceesRows();
|
||||
break;
|
||||
if (!conversationId.isEmpty()) {
|
||||
Q_EMIT linked.callAddedToConference("", conversationId, confId);
|
||||
} else {
|
||||
QStringList callList = CallManager::instance().getParticipantList(linked.owner.id, confId);
|
||||
Q_FOREACH (const auto& call, callList) {
|
||||
Q_EMIT linked.callAddedToConference(call, "", confId);
|
||||
// Remove call from pendingConferences_
|
||||
for (int i = 0; i < pendingConferencees_.size(); ++i) {
|
||||
if (pendingConferencees_.at(i).callId == call) {
|
||||
Q_EMIT linked.beginRemovePendingConferenceesRows(i);
|
||||
pendingConferencees_.removeAt(i);
|
||||
Q_EMIT linked.endRemovePendingConferenceesRows();
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (call == currentCall_)
|
||||
currentCall_ = confId;
|
||||
}
|
||||
if (call == currentCall_)
|
||||
currentCall_ = confId;
|
||||
if (currentCallId != currentCall_)
|
||||
Q_EMIT linked.currentCallChanged(confId);
|
||||
}
|
||||
if (currentCallId != currentCall_)
|
||||
Q_EMIT linked.currentCallChanged(confId);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1763,7 +1767,7 @@ CallModelPimpl::slotConferenceChanged(const QString& accountId,
|
|||
QStringList callList = CallManager::instance().getParticipantList(linked.owner.id, confId);
|
||||
QString currentCallId = currentCall_;
|
||||
Q_FOREACH (const auto& call, callList) {
|
||||
Q_EMIT linked.callAddedToConference(call, confId);
|
||||
Q_EMIT linked.callAddedToConference(call, "", confId);
|
||||
if (call == currentCall_)
|
||||
currentCall_ = confId;
|
||||
}
|
||||
|
|
|
@ -310,9 +310,10 @@ public Q_SLOTS:
|
|||
/**
|
||||
* Listen from CallModel when a call is added to a conference
|
||||
* @param callId
|
||||
* @param conversationId
|
||||
* @param confId
|
||||
*/
|
||||
void slotCallAddedToConference(const QString& callId, const QString& confId);
|
||||
void slotCallAddedToConference(const QString& callId, const QString& conversationId, const QString& confId);
|
||||
/**
|
||||
* Listen from CallbacksHandler when a conference is deleted.
|
||||
* @param accountId
|
||||
|
@ -3457,10 +3458,11 @@ ConversationModelPimpl::addIncomingMessage(const QString& peerId,
|
|||
}
|
||||
|
||||
void
|
||||
ConversationModelPimpl::slotCallAddedToConference(const QString& callId, const QString& confId)
|
||||
ConversationModelPimpl::slotCallAddedToConference(const QString& callId, const QString& conversationId, const QString& confId)
|
||||
{
|
||||
for (auto& conversation : conversations) {
|
||||
if (conversation.callId == callId && conversation.confId != confId) {
|
||||
if ((conversationId == conversation.uid)
|
||||
|| (!callId.isEmpty() && conversation.callId == callId && conversation.confId != confId)) {
|
||||
conversation.confId = confId;
|
||||
invalidateModel();
|
||||
// Refresh the conference status only if attached
|
||||
|
|
|
@ -144,11 +144,12 @@ public:
|
|||
QString(filepath.c_str()));
|
||||
}),
|
||||
exportable_callback<CallSignal::ConferenceCreated>(
|
||||
[this](const std::string& accountId, const std::string& confId) {
|
||||
LOG_LIBJAMI_SIGNAL2("conferenceCreated",
|
||||
[this](const std::string& accountId, const std::string& conversationId, const std::string& confId) {
|
||||
LOG_LIBJAMI_SIGNAL3("conferenceCreated",
|
||||
QString(accountId.c_str()),
|
||||
QString(conversationId.c_str()),
|
||||
QString(confId.c_str()));
|
||||
Q_EMIT conferenceCreated(QString(accountId.c_str()), QString(confId.c_str()));
|
||||
Q_EMIT conferenceCreated(QString(accountId.c_str()), QString(conversationId.c_str()), QString(confId.c_str()));
|
||||
}),
|
||||
exportable_callback<CallSignal::ConferenceChanged>([this](const std::string& accountId,
|
||||
const std::string& confId,
|
||||
|
@ -628,7 +629,7 @@ Q_SIGNALS: // SIGNALS
|
|||
const QString& callId,
|
||||
const VectorMapStringString& mediaList);
|
||||
void recordPlaybackFilepath(const QString& callId, const QString& filepath);
|
||||
void conferenceCreated(const QString& accountId, const QString& confId);
|
||||
void conferenceCreated(const QString& accountId, const QString& conversationId, const QString& confId);
|
||||
void conferenceChanged(const QString& accountId, const QString& confId, const QString& state);
|
||||
void updatePlaybackScale(const QString& filepath, int position, int size);
|
||||
void conferenceRemoved(const QString& accountId, const QString& confId);
|
||||
|
|
Loading…
Add table
Reference in a new issue