Changeset View
Changeset View
Standalone View
Standalone View
src/client/client.cpp
| Show First 20 Lines • Show All 96 Lines • ▼ Show 20 Lines | auto Client::passwordLogin(std::string homeserver, std::string username, | ||||
| // It is meaningless to wait for it in a Promise | // It is meaningless to wait for it in a Promise | ||||
| // that is never exposed to the user. | // that is never exposed to the user. | ||||
| that.startSyncing(); | that.startSyncing(); | ||||
| }); | }); | ||||
| return p1; | return p1; | ||||
| } | } | ||||
| auto Client::mLoginTokenLogin( | |||||
| std::string homeserver, | |||||
| std::string loginToken, | |||||
| std::optional<std::string> deviceName | |||||
| ) const -> PromiseT | |||||
| { | |||||
| auto p1 = m_ctx.dispatch(MLoginTokenLoginAction{ | |||||
| homeserver, loginToken, deviceName}); | |||||
| p1 | |||||
| .then([that=toEventLoop()](auto stat) { | |||||
| if (! stat.success()) { | |||||
| return; | |||||
| } | |||||
| that.startSyncing(); | |||||
| }); | |||||
| return p1; | |||||
| } | |||||
| auto Client::tokenLogin(std::string homeserver, std::string username, | auto Client::tokenLogin(std::string homeserver, std::string username, | ||||
| std::string token, std::string deviceId) const | std::string token, std::string deviceId) const | ||||
| -> PromiseT | -> PromiseT | ||||
| { | { | ||||
| auto p1 = m_ctx.dispatch(TokenLoginAction{ | auto p1 = m_ctx.dispatch(TokenLoginAction{ | ||||
| homeserver, username, token, deviceId}); | homeserver, username, token, deviceId}); | ||||
| p1 | p1 | ||||
| .then([that=toEventLoop()](auto stat) { | .then([that=toEventLoop()](auto stat) { | ||||
| ▲ Show 20 Lines • Show All 412 Lines • Show Last 20 Lines | |||||