Merge pull request #2224 from csoler/v0.6-BugFixing_5

continue bug fixing for 0.6.6 (See commits)
This commit is contained in:
csoler 2021-01-18 13:24:31 +01:00 committed by GitHub
commit 5ec3ae8640
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 128 additions and 56 deletions

View file

@ -611,8 +611,31 @@ void IdEditDialog::updateId()
else
mEditGroup.mImage.clear();
uint32_t dummyToken = 0;
rsIdentity->updateIdentity(mEditGroup);
RsGxsId keyId;
std::string gpg_password;
if(!mEditGroup.mPgpId.isNull())
{
std::string gpg_name = rsPeers->getGPGName(rsPeers->getGPGOwnId());
bool cancelled;
rsNotify->clearPgpPassphrase(); // just in case
if(!NotifyQt::getInstance()->askForPassword(tr("Profile password needed.").toStdString(),
gpg_name + " (" + rsPeers->getOwnId().toStdString() + ")",
false,
gpg_password,cancelled))
{
QMessageBox::critical(NULL,tr("Identity creation failed"),tr("Cannot create an identity linked to your profile without your profile password."));
return;
}
}
if(!rsIdentity->updateIdentity(RsGxsId(mEditGroup.mMeta.mGroupId),mEditGroup.mMeta.mGroupName,mEditGroup.mImage,mEditGroup.mPgpId.isNull(),gpg_password))
{
QMessageBox::critical(NULL,tr("Identity update failed"),tr("Cannot update identity. Something went wrong. Check your profile password."));
return;
}
accept();
}

View file

@ -406,25 +406,18 @@ void ChatWidget::init(const ChatId &chat_id, const QString &title)
{
RsIdentityDetails details;
time_t start = time(nullptr);
while (!rsIdentity->getIdDetails(RsGxsId(historyIt->peerName), details))
{
std::this_thread::sleep_for(std::chrono::milliseconds(10));
if (time(nullptr)>start+2)
{
std::cerr << "ChatWidget History haven't found Id Details and have wait 1 sec for it." << std::endl;
break;
}
}
if (rsIdentity->getIdDetails(RsGxsId(historyIt->peerName), details))
if (rsIdentity->getIdDetails(RsGxsId(historyIt->peerId), details))
name = QString::fromUtf8(details.mNickname.c_str());
else
name = QString::fromUtf8(historyIt->peerName.c_str());
} else {
name = QString::fromUtf8(historyIt->peerName.c_str());
else if(!historyIt->peerName.empty())
name = QString::fromUtf8(historyIt->peerName.c_str());
else
name = QString::fromUtf8(historyIt->peerId.toStdString().c_str());
} else {
name = QString::fromUtf8(historyIt->peerId.toStdString().c_str());
}
addChatMsg(historyIt->incoming, name, RsGxsId(historyIt->peerName.c_str()), QDateTime::fromTime_t(historyIt->sendTime), QDateTime::fromTime_t(historyIt->recvTime), QString::fromUtf8(historyIt->message.c_str()), MSGTYPE_HISTORY);
addChatMsg(historyIt->incoming, name, RsGxsId(historyIt->peerId.toStdString().c_str()), QDateTime::fromTime_t(historyIt->sendTime), QDateTime::fromTime_t(historyIt->recvTime), QString::fromUtf8(historyIt->message.c_str()), MSGTYPE_HISTORY);
}
}
}

View file

@ -907,7 +907,7 @@
</font>
</property>
<property name="text">
<string>Chatlobbies</string>
<string>Chat rooms</string>
</property>
</widget>
</item>
@ -920,7 +920,7 @@
</font>
</property>
<property name="text">
<string>Private chat</string>
<string>Node-to-node chat</string>
</property>
</widget>
</item>
@ -933,7 +933,7 @@
</font>
</property>
<property name="text">
<string>Group chat</string>
<string>Broadcast</string>
</property>
</widget>
</item>