mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-25 20:48:52 +03:00
Create a named device on login
This commit is contained in:
parent
f81909d34b
commit
0f72808858
1 changed files with 13 additions and 1 deletions
14
src/Login.cc
14
src/Login.cc
|
@ -34,10 +34,22 @@ LoginRequest::LoginRequest(QString username, QString password)
|
|||
|
||||
QByteArray LoginRequest::serialize() noexcept
|
||||
{
|
||||
#if defined(Q_OS_MAC)
|
||||
QString initialDeviceName("nheko on Mac OS");
|
||||
#elif defined(Q_OS_LINUX)
|
||||
QString initialDeviceName("nheko on Linux");
|
||||
#elif defined(Q_OS_WIN)
|
||||
QString initialDeviceName("nheko on Windows");
|
||||
#else
|
||||
QString initialDeviceName("nheko");
|
||||
#endif
|
||||
|
||||
QJsonObject body{
|
||||
{"type", "m.login.password"},
|
||||
{"user", user_},
|
||||
{"password", password_}};
|
||||
{"password", password_},
|
||||
{"initial_device_display_name", initialDeviceName},
|
||||
};
|
||||
|
||||
return QJsonDocument(body).toJson(QJsonDocument::Compact);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue