Open alecisec opened 6 years ago
This formatting not only prevents the notification displaying, but more critically it actually prevents all contents of the post from being Searchable within mattermost.
I'm tempted to just remove the boxes completely, or at least make it configurable. Either that, or a feature request to mattermost to make attachment contents searchable..
A toggle to omit the box would be awesome, especially if it were per-feed 👍
If I get time to work on it, i'll add it to my list of things to do! Quite busy in "real life" of late.. :)
If you point me to file that renders it is I can have a go
You're more than welcome to take a look!
This is the part that does the message:
https://github.com/PromoFaux/Matterfeed.NET/blob/master/Matterfeed.NET/RssFeedReader.cs#L142-L165
private static MattermostMessage MattermostMessage(RssFeed rssFeedConfig, string title, string link, string attText, string author)
{
var converter = new Converter();
var message = new MattermostMessage
{
Channel = rssFeedConfig.BotChannelOverride == "" ? null : rssFeedConfig.BotChannelOverride,
Username = rssFeedConfig.BotNameOverride == "" ? null : rssFeedConfig.BotNameOverride,
IconUrl = rssFeedConfig.BotImageOverride == "" ? null : new Uri(rssFeedConfig.BotImageOverride),
Attachments = new List<MattermostAttachment>
{
new MattermostAttachment
{
Pretext = rssFeedConfig.FeedPretext,
Title = title ?? "",
TitleLink = link == null ? null : new Uri(link),
Text = converter.Convert(attText),
AuthorName = author
}
}
};
return message;
}
If you need some more information on how the MattermostMessage class works, see my other repo here
Have noted that due to the box-out surrounding the content (not sure of the correct term sorry) mattermost will not correctly add the subject to a notification.
Using https://github.com/PromoFaux/Matterfeed.NET/blob/master/config/secrets.json.sample as an example -
The first feed listed when mattermost displays a notificaiton will read simply "Bruce Schneier - Schneier on Security"
I suggest moving