Commit 7091f596 authored by Ming Rui Zhang's avatar Ming Rui Zhang Committed by Sébastien Blin

callwidget: recover add contact button on sip account

Change-Id: If6dd5453f146ba9cc2d2cc6bb1a3b0bf35798762
parent 124c2a97
......@@ -936,18 +936,21 @@ CallWidget::setupChatView(const lrc::api::conversation::Info& convInfo)
auto selectedAccountId = LRCInstance::getCurrAccId();
auto& accountInfo = LRCInstance::accountModel().getAccountInfo(selectedAccountId);
bool isRINGAccount = accountInfo.profileInfo.type == lrc::api::profile::Type::RING;
lrc::api::profile::Type contactType;
try {
auto contactInfo = accountInfo.contactModel->getContact(contactURI.toStdString());
if (contactInfo.isTrusted) {
isContact = true;
}
contactType = contactInfo.profileInfo.type;
} catch (...) {}
ui->imNameLabel->setText(displayName);
ui->imIdLabel->setText(displayId);
ui->imIdLabel->setVisible(isRINGAccount && displayName != displayId);
bool shouldShowSendContactRequestBtn = !isContact && isRINGAccount;
bool shouldShowSendContactRequestBtn = !isContact && contactType != lrc::api::profile::Type::SIP;
ui->sendContactRequestButton->setVisible(shouldShowSendContactRequestBtn);
ui->messageView->setMessagesVisibility(false);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment