diff --git a/pkg/server/messages_api.go b/pkg/server/messages_api.go index 4a4653d..ebdf2e3 100644 --- a/pkg/server/messages_api.go +++ b/pkg/server/messages_api.go @@ -14,7 +14,13 @@ func listMessage(c *fiber.Ctx) error { offset := c.QueryInt("offset", 0) alias := c.Params("channel") - channel, err := services.GetChannelWithAlias(alias) + var err error + var channel models.Channel + if val, ok := c.Locals("realm").(models.Realm); ok { + channel, err = services.GetChannelWithAlias(alias, val.ID) + } else { + channel, err = services.GetChannelWithAlias(alias) + } if err != nil { return fiber.NewError(fiber.StatusNotFound, err.Error()) } else if _, _, err := services.GetAvailableChannel(channel.ID, user); err != nil { diff --git a/settings.toml b/settings.toml index 45c8bfb..c18fa49 100644 --- a/settings.toml +++ b/settings.toml @@ -10,7 +10,7 @@ secret = "LtTjzAGFLshwXhN4ZD4nG5KlMv1MWcsvfv03TSZYnT1VhiAnLIZFTnHUwR0XhGgi" content = "uploads" [debug] -database = false +database = true print_routes = false [identity]