Create a named device on login
This commit is contained in:
parent
f81909d34b
commit
0f72808858
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 New Issue
Block a user