mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
fix(core): Fix missed ToxId to ToxPk constructions
This commit is contained in:
parent
11f7f6193a
commit
56eed63fde
|
@ -1279,9 +1279,9 @@ ToxPk Core::getSelfPublicKey() const
|
|||
{
|
||||
QMutexLocker ml{&coreLoopLock};
|
||||
|
||||
uint8_t friendId[TOX_ADDRESS_SIZE] = {0x00};
|
||||
tox_self_get_address(tox.get(), friendId);
|
||||
return ToxPk(friendId);
|
||||
uint8_t selfPk[TOX_PUBLIC_KEY_SIZE] = {0x00};
|
||||
tox_self_get_public_key(tox.get(), selfPk);
|
||||
return ToxPk(selfPk);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -448,8 +448,7 @@ void Profile::startCore()
|
|||
|
||||
core->start();
|
||||
|
||||
const ToxId& selfId = core->getSelfId();
|
||||
const ToxPk& selfPk = selfId.getPublicKey();
|
||||
const ToxPk& selfPk = core->getSelfPublicKey();
|
||||
const QByteArray data = loadAvatarData(selfPk);
|
||||
if (data.isEmpty()) {
|
||||
qDebug() << "Self avatar not found, will broadcast empty avatar to friends";
|
||||
|
|
|
@ -314,7 +314,7 @@ void AddFriendForm::deleteFriendRequest(const ToxId& toxId)
|
|||
const int size = Settings::getInstance().getFriendRequestSize();
|
||||
for (int i = 0; i < size; ++i) {
|
||||
Settings::Request request = Settings::getInstance().getFriendRequest(i);
|
||||
if (toxId == ToxId(request.address)) {
|
||||
if (toxId.getPublicKey() == ToxPk(request.address)) {
|
||||
Settings::getInstance().removeFriendRequest(i);
|
||||
return;
|
||||
}
|
||||
|
@ -329,7 +329,7 @@ void AddFriendForm::onFriendRequestAccepted()
|
|||
removeFriendRequestWidget(friendWidget);
|
||||
const int indexFromEnd = requestsLayout->count() - index - 1;
|
||||
const Settings::Request request = Settings::getInstance().getFriendRequest(indexFromEnd);
|
||||
emit friendRequestAccepted(ToxId(request.address).getPublicKey());
|
||||
emit friendRequestAccepted(ToxPk{request.address});
|
||||
Settings::getInstance().removeFriendRequest(indexFromEnd);
|
||||
Settings::getInstance().savePersonal();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user