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

Method TextFileContent

model/message.go:175–191  ·  view source on GitHub ↗

TextFileContent set text file notification

(path string, filename string, title string, desc string, size int, actions []string)

Source from the content-addressed store, hash-verified

173
174// TextFileContent set text file notification
175func (m *Message) TextFileContent(path string, filename string, title string, desc string, size int, actions []string) *Message {
176 ctx := &pb.MsgContent{
177 Type: pb.MsgType_File,
178 File: filepath.ToSlash(path),
179 Filename: filename,
180 Size: uint64(size),
181 Actions: parseActions(actions),
182 }
183 if len(title) > 0 {
184 ctx.Title = title
185 }
186 if len(desc) > 0 {
187 ctx.Text = desc
188 }
189 m.Content, _ = proto.Marshal(ctx)
190 return m
191}
192
193// IsTimeline return is timeline notification
194func (m *Message) IsTimeline() bool {

Callers 1

makeTextContentMethod · 0.80

Calls 2

parseActionsFunction · 0.85
MarshalMethod · 0.80

Tested by

no test coverage detected