18 lines
386 B
Go
18 lines
386 B
Go
package placement
|
|
|
|
import "strings"
|
|
|
|
func ResolveReplyTargetID(externalID, permalink string) string {
|
|
if id := strings.TrimSpace(externalID); id != "" {
|
|
return id
|
|
}
|
|
permalink = normalizeThreadsPermalink(permalink)
|
|
if permalink == "" {
|
|
return ""
|
|
}
|
|
match := threadsPostURLRe.FindStringSubmatch(permalink)
|
|
if len(match) < 3 {
|
|
return ""
|
|
}
|
|
return strings.TrimSpace(match[2])
|
|
} |