Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.

Commit

Permalink
Fixes for Qt 5
Browse files Browse the repository at this point in the history
  • Loading branch information
curoviyxru committed Apr 21, 2022
1 parent 3dd8a19 commit 5338b4e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 17 deletions.
4 changes: 2 additions & 2 deletions crypto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
#include <openssl/rsa.h>

DHKey::DHKey(QString publicKey, qint64 fingerprint, QString exponent) :
publicKey(QByteArray::fromHex(publicKey.toAscii())),
exponent(QByteArray::fromHex(exponent.toAscii())),
publicKey(QByteArray::fromHex(publicKey.toUtf8())),
exponent(QByteArray::fromHex(exponent.toUtf8())),
fingerprint(fingerprint)
{

Expand Down
25 changes: 11 additions & 14 deletions library.pri
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,18 @@ contains(MOBILITY_CONFIG, systeminfo) {
include(qt-json/qt-json.pri)
include(thirdparty/thirdparty.pri)

win32:include(zlib/zlib.pri)
!symbian:unix:LIBS += -lz

symbian:LIBS += -llibcrypto
!symbian:unix:LIBS += -lcrypto

win32 {
exists(C:/OpenSSL-Win32) {
LIBS += -LC:/OpenSSL-Win32/lib
LIBS += -llibcrypto
INCLUDEPATH += C:/OpenSSL-Win32/include
} else {
message(OpenSSL-Win32 1.1.1 not found. Install it from https://slproweb.com/ to C:/OpenSSL-Win32)
}
}

!symbian:!android:unix:LIBS += -lz
!symbian:!android:unix:LIBS += -lcrypto

android:LIBS += -lz
android:LIBS += -LC:/QtAndroid/openssl -lcrypto
android:INCLUDEPATH += C:/QtAndroid/openssl/include

win32:include(zlib/zlib.pri)
win32:LIBS += -LC:/OpenSSL-Win32/lib -llibcrypto
win32:INCLUDEPATH += C:/OpenSSL-Win32/include

HEADERS += \
$$PWD/telegramclient.h \
Expand Down
2 changes: 1 addition & 1 deletion telegramapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ void TelegramClient::handleLoginToken(QByteArray data, qint64 mtm)
readTLAuthLoginToken(packet, var);
TelegramObject loginToken = var.toMap();

emit gotLoginToken(mtm, loginToken["expires"].toInt(), "tg://login?token=" + QString::fromAscii(loginToken["token"].toByteArray().toBase64()).replace("+", "-").replace("/", "_"));
emit gotLoginToken(mtm, loginToken["expires"].toInt(), "tg://login?token=" + QString::fromUtf8(loginToken["token"].toByteArray().toBase64()).replace("+", "-").replace("/", "_"));
}

void TelegramClient::handleLoginTokenSuccess(QByteArray data, qint64 mtm)
Expand Down

0 comments on commit 5338b4e

Please sign in to comment.