TextFileContent set text file notification
(path string, filename string, title string, desc string, size int, actions []string)
| 173 | |
| 174 | // TextFileContent set text file notification |
| 175 | func (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 |
| 194 | func (m *Message) IsTimeline() bool { |
no test coverage detected