|
@@ -307,13 +307,15 @@ func (s *subscribePush) subStrDetail(matchKey, detail string) string {
|
|
|
}
|
|
|
matchKeys = append(matchKeys, regexp.QuoteMeta(v))
|
|
|
}
|
|
|
- indexs := regexp.MustCompile(strings.Join(matchKeys, "|")).FindStringIndex(detail)
|
|
|
- if len(indexs) > 0 {
|
|
|
- start := string(detail[0:indexs[0]])
|
|
|
- if len([]rune(start)) > 50 {
|
|
|
- start = string([]rune(start)[len([]rune(start))-50:])
|
|
|
+ if len(matchKeys) > 0 {
|
|
|
+ indexs := regexp.MustCompile(strings.Join(matchKeys, "|")).FindStringIndex(detail)
|
|
|
+ if len(indexs) > 0 {
|
|
|
+ start := string(detail[0:indexs[0]])
|
|
|
+ if len([]rune(start)) > 50 {
|
|
|
+ start = string([]rune(start)[len([]rune(start))-50:])
|
|
|
+ }
|
|
|
+ detail = start + string(detail[indexs[0]:])
|
|
|
}
|
|
|
- detail = start + string(detail[indexs[0]:])
|
|
|
}
|
|
|
if len([]rune(detail)) > 200 {
|
|
|
detail = string([]rune(detail)[:200])
|