Save device ID
This commit is contained in:
parent
8e608f0f17
commit
a18353b531
|
@ -56,7 +56,7 @@ func NewClient(config *config.MatrixConfig, db *sql.DB) (*Client, error) {
|
||||||
func (c *Client) Login() error {
|
func (c *Client) Login() error {
|
||||||
c.syncer.OnEventType(event.StateMember, c.handleMemberEvent)
|
c.syncer.OnEventType(event.StateMember, c.handleMemberEvent)
|
||||||
|
|
||||||
_, err := c.client.Login(&mautrix.ReqLogin{
|
resp, err := c.client.Login(&mautrix.ReqLogin{
|
||||||
Type: mautrix.AuthTypePassword,
|
Type: mautrix.AuthTypePassword,
|
||||||
Identifier: mautrix.UserIdentifier{
|
Identifier: mautrix.UserIdentifier{
|
||||||
Type: mautrix.IdentifierTypeUser,
|
Type: mautrix.IdentifierTypeUser,
|
||||||
|
@ -71,6 +71,9 @@ func (c *Client) Login() error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
c.deviceID = resp.DeviceID
|
||||||
|
log.Print("device ID: ", c.deviceID)
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue