package chat import ( "errors" "github.com/labstack/echo/v4" "gitflic.ru/akselbant/mtusi2026lab1-fork/internal/pkg/domain" ) func (h *Chat) authorizedChat(c echo.Context, requestedChat domain.Chat) (domain.Chat, bool, error) { chat, err := h.useCase.GetChat(c.Request().Context(), authenticatedUser(c).ID, requestedChat) if err != nil { return domain.Chat{}, false, h.useCaseError(c, err) } return chat, true, nil } func (h *Chat) cursorPosition(raw string, present bool, scope, owner string) (*domain.Position, error) { if !present { return nil, nil } if raw == "" { return nil, errors.New("empty cursor") } createdAt, id, err := h.cursor.decode(raw, scope, owner) if err != nil { return nil, err } return &domain.Position{CreatedAt: createdAt, ID: id}, nil }