New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mattermost attachment support #801
Comments
I plan on tackling this feature request, this will require adding a 'Bot' mode similar to the Slack plugin as file uploads are only available through Mattermost's API and not webhooks. However, the challenge is to differentiate between the two modes, as both webhook and bot tokens in Mattermost are a 27-digit alphanumeric string -- unlike with Slack that uses different token formats. The current schema does include a
Looking through the code, One possible solution would be to have a @caronc thoughts or other ideas? |
Probably a new mode (or modes) would be better vs a mode paired with a bool. We have a few plugins that detect the mode to use based on the key/token provided. But a mode that can also be set to enforce the detection (to override). I'm not at home right now, but i can dig up some examples. If the tokens are different as you say, then this works in our favor because it makes the auto detection easier (and accurate). Thoughts? P.s. thanks for taking this on. Attachments are a bit harry, but there are lots of examples you should be able to borrow from the cover all angles most services use. Might be some copying and pasting i think to make your life easier |
Sorry I guess I wasn't clear, but Mattermost tokens for webhooks and bots use the same format, so it's not possible to auto detect based on token. One big difference between the two modes is how channels are passed. Webhooks use slugs like I thought the ids had some special encoding similar to uuids that we can use to validate channel ids, but looking through their source code they just assume any 26-digit alphanumeric string is a valid id: https://github.com/mattermost/mattermost-server/blob/v6.7.2/model/utils.go#L608 We can do the same, but this seems unreliable as channel names have a max length of 64(src) I can create the initial PR where any notifications with attachments use API calls over hooks, and then we can revisit whether to use a bool flag or some other mechanism. |
Nah, if that is the case, definitely don't auto-detect. But i think I'd still rather have 4 distinctive modes over a separate switch that toggles a bot flag paired with the 2 existing modes. Otherwise, whatever you come up with will be amazing no doubt! 馃殌馃憤馃檪 |
馃挕 The Idea
The current Mattermost implementation doesn't support attachments, but Mattermost does. This should extend the Mattermost implementation to add support for attachments
馃敤 Breaking Feature
Nope
The text was updated successfully, but these errors were encountered: