MCPcopy Create free account
hub / github.com/chanify/chanify / parseActions

Function parseActions

model/message.go:281–301  ·  view source on GitHub ↗
(actions []string)

Source from the content-addressed store, hash-verified

279}
280
281func parseActions(actions []string) []*pb.ActionItem {
282 if len(actions) <= 0 {
283 return nil
284 }
285 if len(actions) > 4 {
286 actions = actions[:4]
287 }
288 acts := []*pb.ActionItem{}
289 for _, act := range actions {
290 ss := strings.SplitN(act, "|", 2)
291 if len(ss) > 1 {
292 item := &pb.ActionItem{
293 Type: pb.ActType_ActURL,
294 Name: ss[0],
295 Link: ss[1],
296 }
297 acts = append(acts, item)
298 }
299 }
300 return acts
301}

Callers 3

ActionContentMethod · 0.85
FileContentMethod · 0.85
TextFileContentMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected