diff --git a/internal/matrix/client.go b/internal/matrix/client.go index 1e7765b..8084fc7 100644 --- a/internal/matrix/client.go +++ b/internal/matrix/client.go @@ -56,7 +56,7 @@ func NewClient(config *config.MatrixConfig, db *sql.DB) (*Client, error) { func (c *Client) Login() error { c.syncer.OnEventType(event.StateMember, c.handleMemberEvent) - _, err := c.client.Login(&mautrix.ReqLogin{ + resp, err := c.client.Login(&mautrix.ReqLogin{ Type: mautrix.AuthTypePassword, Identifier: mautrix.UserIdentifier{ Type: mautrix.IdentifierTypeUser, @@ -71,6 +71,9 @@ func (c *Client) Login() error { return err } + c.deviceID = resp.DeviceID + log.Print("device ID: ", c.deviceID) + return nil }