PromoFaux / Matterfeed.NET

Parse various Feeds and post them to your Mattermost server!
GNU General Public License v3.0
11 stars 3 forks source link

'Box' prevents notification displaying subjects #11

Open alecisec opened 6 years ago

alecisec commented 6 years ago

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 elements outside of the boxed element in order to have it pop up along with FeedPretext & BotNameOverride to make notifications more useful.</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/alecisec"><img src="https://avatars.githubusercontent.com/u/26102968?v=4" />alecisec</a> commented <strong> 6 years ago</strong> </div> <div class="markdown-body"> <p>This formatting not only prevents the notification displaying, but more critically it actually prevents all contents of the post from being Searchable within mattermost. </p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/PromoFaux"><img src="https://avatars.githubusercontent.com/u/1998970?v=4" />PromoFaux</a> commented <strong> 6 years ago</strong> </div> <div class="markdown-body"> <p>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..</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/alecisec"><img src="https://avatars.githubusercontent.com/u/26102968?v=4" />alecisec</a> commented <strong> 6 years ago</strong> </div> <div class="markdown-body"> <p>A toggle to omit the box would be awesome, especially if it were per-feed 👍 </p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/PromoFaux"><img src="https://avatars.githubusercontent.com/u/1998970?v=4" />PromoFaux</a> commented <strong> 6 years ago</strong> </div> <div class="markdown-body"> <p>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.. :)</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/alecisec"><img src="https://avatars.githubusercontent.com/u/26102968?v=4" />alecisec</a> commented <strong> 6 years ago</strong> </div> <div class="markdown-body"> <p>If you point me to file that renders it is I can have a go</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/PromoFaux"><img src="https://avatars.githubusercontent.com/u/1998970?v=4" />PromoFaux</a> commented <strong> 6 years ago</strong> </div> <div class="markdown-body"> <p>You're more than welcome to take a look!</p> <p>This is the part that does the message: </p> <p><a href="https://github.com/PromoFaux/Matterfeed.NET/blob/master/Matterfeed.NET/RssFeedReader.cs#L142-L165">https://github.com/PromoFaux/Matterfeed.NET/blob/master/Matterfeed.NET/RssFeedReader.cs#L142-L165</a></p> <pre><code class="language-C#"> 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; }</code></pre> <p>If you need some more information on how the MattermostMessage class works, see my other repo <a href="https://github.com/PromoFaux/Matterhook.NET.MatterhookClient">here</a></p> </div> </div> <div class="page-bar-simple"> </div> <div class="footer"> <ul class="body"> <li>© <script> document.write(new Date().getFullYear()) </script> Githubissues.</li> <li>Githubissues is a development platform for aggregating issues.</li> </ul> </div> <script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js"></script> <script src="/githubissues/assets/js.js"></script> <script src="/githubissues/assets/markdown.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/highlight.min.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/languages/go.min.js"></script> <script> hljs.highlightAll(); </script> </body> </html>