mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-08-04 06:45:45 +02:00
currentconversation: always set the current conversation id
This must be done even when empty and contributes to the deselection mechanism. Change-Id: Ia97186ad8f37763ed2c8f61f4f44a0a04df7577b
This commit is contained in:
parent
7a844ee1ae
commit
84d625c1b4
1 changed files with 75 additions and 74 deletions
|
@ -51,12 +51,18 @@ void
|
|||
CurrentConversation::updateData()
|
||||
{
|
||||
auto convId = lrcInstance_->get_selectedConvUid();
|
||||
if (convId.isEmpty())
|
||||
return;
|
||||
|
||||
auto cleanup = qScopeGuard([&] {
|
||||
set_id(convId);
|
||||
updateErrors(convId);
|
||||
});
|
||||
|
||||
try {
|
||||
auto accountId = lrcInstance_->get_currentAccountId();
|
||||
const auto& accInfo = lrcInstance_->accountModel().getAccountInfo(accountId);
|
||||
if (auto optConv = accInfo.conversationModel->getConversationForUid(convId)) {
|
||||
auto optConv = accInfo.conversationModel->getConversationForUid(convId);
|
||||
if (!optConv)
|
||||
return;
|
||||
auto& convInfo = optConv->get();
|
||||
set_lastSelfMessageId(convInfo.lastSelfMessageId);
|
||||
QStringList uris, bannedUris;
|
||||
|
@ -93,8 +99,7 @@ CurrentConversation::updateData()
|
|||
set_callState(call::Status::INVALID);
|
||||
set_hasCall(false);
|
||||
}
|
||||
set_inCall(callState_ == call::Status::CONNECTED
|
||||
|| callState_ == call::Status::IN_PROGRESS
|
||||
set_inCall(callState_ == call::Status::CONNECTED || callState_ == call::Status::IN_PROGRESS
|
||||
|| callState_ == call::Status::PAUSED);
|
||||
|
||||
// The temporary status is only for dialogs.
|
||||
|
@ -102,8 +107,7 @@ CurrentConversation::updateData()
|
|||
// is consistently determined by the peer's uri being equal to
|
||||
// the conversation id.
|
||||
auto members = accInfo.conversationModel->peersForConversation(convId);
|
||||
set_isTemporary(isCoreDialog_ ? (convId == members.at(0) || convId == "SEARCHSIP")
|
||||
: false);
|
||||
set_isTemporary(isCoreDialog_ ? (convId == members.at(0) || convId == "SEARCHSIP") : false);
|
||||
|
||||
auto isContact {false};
|
||||
if (isCoreDialog_)
|
||||
|
@ -128,12 +132,9 @@ CurrentConversation::updateData()
|
|||
|
||||
onProfileUpdated(convId);
|
||||
updateActiveCalls(accountId, convId);
|
||||
}
|
||||
} catch (...) {
|
||||
qWarning() << "Can't update current conversation data for" << convId;
|
||||
}
|
||||
set_id(convId);
|
||||
updateErrors(convId);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -304,7 +305,7 @@ CurrentConversation::showSwarmDetails()
|
|||
void
|
||||
CurrentConversation::updateErrors(const QString& convId)
|
||||
{
|
||||
if (convId != id_)
|
||||
if (convId != id_ || convId.isEmpty())
|
||||
return;
|
||||
try {
|
||||
QStringList newErrors;
|
||||
|
|
Loading…
Add table
Reference in a new issue