Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[slack] Remove previews #3226

Closed
1 task done
icsy7867 opened this issue Jun 7, 2023 · 4 comments · Fixed by #5167
Closed
1 task done

[slack] Remove previews #3226

icsy7867 opened this issue Jun 7, 2023 · 4 comments · Fixed by #5167
Labels
area:notifications Everything related to notifications feature-request Request for new features to be added type:enhance-existing feature wants to enhance existing monitor

Comments

@icsy7867
Copy link

icsy7867 commented Jun 7, 2023

⚠️ Please verify that this feature request has NOT been suggested before.

  • I checked and didn't find similar feature request

🏷️ Feature Request Type

UI Feature, Other

🔖 Feature description

image

I had someone ask me for this, and I am not sure if it is possible. But the slack integration adds a preview with what looks like very similar information from the message. This appears a bit superfluous and it would be nice to be able to disable this.

✔️ Solution

Add an option to the web gui to disable link and media unfurling.
https://api.slack.com/reference/messaging/link-unfurling#no_unfurling_please

Not really sure where the preview is coming from, it's not really media and not really a link. But this should prevent this from happening in the slack API/Webhook call:

{
    "text": "Check out the <https://api.slack.com|Slack API>",
    "unfurl_links": false,
    "unfurl_media": false
}

So a simple slider for "Disable Preview", "Disable Link Unfurling" in the slack integration edit menu with the other sliders should be functional and still look aesthetically pleasing. You could also do a single slider "No previews" or something instead.

image

❓ Alternatives

Not sure of any.

📝 Additional Context

No response

@icsy7867 icsy7867 added the feature-request Request for new features to be added label Jun 7, 2023
@icsy7867
Copy link
Author

icsy7867 commented Jun 7, 2023

Looking at the code:
https://raw.githubusercontent.com/louislam/uptime-kuma/68f389868ca1f16893454ba16763498544aa8ace/server/notification-providers/slack.js

It appears this is from the attachment array in the data object:
"attachments": [...]

https://api.slack.com/reference/messaging/attachments#example

So a simple toggle to "Include Preview" or something similar, when disabled, removes:
data.attachments from the payload.

@DaanMeijer
Copy link
Contributor

DaanMeijer commented Oct 15, 2023

I would be willing to fix this issue with a pull request, once my pull request for #3351 gets merged :)

@CommanderStorm CommanderStorm added the area:notifications Everything related to notifications label Dec 6, 2023
@CommanderStorm CommanderStorm changed the title Remove previews in Slack Integration [slack] Remove previews Dec 14, 2023
@CommanderStorm CommanderStorm added the type:enhance-existing feature wants to enhance existing monitor label Dec 14, 2023
@falkoschindler
Copy link

I would also love to hide these redundant previews!
@DaanMeijer Are you still up for a pull request? 🙂

@DaanMeijer
Copy link
Contributor

I would also love to hide these redundant previews! @DaanMeijer Are you still up for a pull request? 🙂

Absolutely! I hope to get to it sometime this week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:notifications Everything related to notifications feature-request Request for new features to be added type:enhance-existing feature wants to enhance existing monitor
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants