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

Method FileContent

model/message.go:128–141  ·  view source on GitHub ↗

FileContent set file notification

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

Source from the content-addressed store, hash-verified

126
127// FileContent set file notification
128func (m *Message) FileContent(path string, filename string, desc string, size int, actions []string) *Message {
129 ctx := &pb.MsgContent{
130 Type: pb.MsgType_File,
131 File: filepath.ToSlash(path),
132 Filename: filename,
133 Size: uint64(size),
134 Actions: parseActions(actions),
135 }
136 if len(desc) > 0 {
137 ctx.Text = desc
138 }
139 m.Content, _ = proto.Marshal(ctx)
140 return m
141}
142
143// ImageContent set image notification
144func (m *Message) ImageContent(path string, t *Thumbnail, size int) *Message {

Callers 1

saveUploadFileMethod · 0.80

Calls 2

parseActionsFunction · 0.85
MarshalMethod · 0.80

Tested by

no test coverage detected