|
@ -245,6 +245,7 @@ func (s *Service) Register(oldService types.Service, client *matrix.Client) erro |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
s.joinRooms(client) |
|
|
return nil |
|
|
return nil |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -266,6 +267,18 @@ func (s *Service) PostRegister(oldService types.Service) { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func (s *Service) joinRooms(client *matrix.Client) { |
|
|
|
|
|
for roomID := range s.Rooms { |
|
|
|
|
|
if _, err := client.JoinRoom(roomID, "", ""); err != nil { |
|
|
|
|
|
log.WithFields(log.Fields{ |
|
|
|
|
|
log.ErrorKey: err, |
|
|
|
|
|
"room_id": roomID, |
|
|
|
|
|
"user_id": client.UserID, |
|
|
|
|
|
}).Error("Failed to join room") |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
func init() { |
|
|
func init() { |
|
|
types.RegisterService(func(serviceID, serviceUserID, webhookEndpointURL string) types.Service { |
|
|
types.RegisterService(func(serviceID, serviceUserID, webhookEndpointURL string) types.Service { |
|
|
return &Service{ |
|
|
return &Service{ |
|
|