feat: sync chatlist sharing support
This commit is contained in:
parent
ec6e8fd13d
commit
2a9c12263f
62 changed files with 3408 additions and 212 deletions
|
|
@ -9,6 +9,7 @@ import (
|
|||
"unicode/utf8"
|
||||
|
||||
"telesrv/internal/domain"
|
||||
"telesrv/internal/links"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
@ -113,7 +114,7 @@ func (s *Service) CreateBusinessChatLink(ctx context.Context, userID int64, inpu
|
|||
link, err := s.business.CreateBusinessChatLink(ctx, domain.BusinessChatLink{
|
||||
OwnerUserID: userID,
|
||||
Slug: slug,
|
||||
Link: businessChatLinkURL(slug),
|
||||
Link: s.businessChatLinkURL(slug),
|
||||
Message: normalized.Message,
|
||||
Entities: normalized.Entities,
|
||||
Title: normalized.Title,
|
||||
|
|
@ -501,6 +502,10 @@ func randomBusinessChatLinkSlug() (string, error) {
|
|||
return fmt.Sprintf("%x", value), nil
|
||||
}
|
||||
|
||||
func businessChatLinkURL(slug string) string {
|
||||
return "https://telesrv.net/m/" + slug
|
||||
func (s *Service) businessChatLinkURL(slug string) string {
|
||||
baseURL := links.DefaultPublicBaseURL
|
||||
if s != nil && s.publicBaseURL != "" {
|
||||
baseURL = s.publicBaseURL
|
||||
}
|
||||
return links.Build(baseURL, "m/"+slug, nil)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue