FileContent set file notification
(path string, filename string, desc string, size int, actions []string)
| 126 | |
| 127 | // FileContent set file notification |
| 128 | func (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 |
| 144 | func (m *Message) ImageContent(path string, t *Thumbnail, size int) *Message { |
no test coverage detected