Пример #1
0
func handleAidText(ctx context.Context, input []byte, m richcontent.MatchIndices) (string, error) {
	req, ok := ctx.Value(CtxKeyArticleRequest).(*ArticleRequest)
	if !ok {
		log.Println("no ArticleRequest present")
		return "", nil // Silently fail
	}

	aidString := string(m.ByteSliceOf(input, 1))
	return aidAndBrdnameToArticle(req.Brd.BrdName, aidString)
}
Пример #2
0
func handleBoardAidText(ctx context.Context, input []byte, m richcontent.MatchIndices) (string, error) {
	brdname := string(m.ByteSliceOf(input, 1))
	aidString := string(m.ByteSliceOf(input, 2))
	return aidAndBrdnameToArticle(brdname, aidString)
}