Hide Link Previews in chat messages

Description

Hello, we utilize Rocket Chat for some work things. Basically I have a trigger message occurring that has some links and I’d just like to disable the link previews for these messages.

See message here: https://imgur.com/1jbsTg2

When a user clicks the “I got this button”, those messages get deleted from the channel and placed into a “history” channel, which simply contains a timestamp and the name of the user who clicked the button (along with the text and links). It also displays the link previews in that channel.

We just want to disable them for those 2 channels entirely. If it’s a thing that can be done via the rest API then that’s fine too.

Thank you!

Server Setup Information

  • Version of Rocket.Chat Server: 3.4.2 (we will be updating to 3.5.0 this Friday)
  • Operating System: Ubuntu 20.04
  • Deployment Method: SNAP
  • Number of Running Instances: 1
  • DB Replicaset Oplog: Unknown
  • NodeJS Version: v10.19.0
  • MongoDB Version: v3.6.14
  • Proxy: CADDY
  • Firewalls involved: SonicWall

Any additional Information

Well I’ve discovered this can be done via:
Administration -> Message -> Embed Link Previews (Off).

But this apparently disables all link previews across all channels and messages. Does solve my issue, but in a very poor way.

I guess the feature I want is simply unsupported at this time.

Another update:

You can disable embedded link previews on specific users. So this is much better.

Administration->Message->Disable Embed for Users.

Hi, This is not a good solution, users should be able to do that themselves without admins, like in Slack.

For a lot of admins they are concerned about security and may not want clickable links that may link to NSFW sites etc. The links will also track the Rocket instance which again the admin may not want.

So it is a bit more complex than just doing what a user wants!

I found this topic looking for a way to configure whether I want to include a preview link in my own messages.

I think we should better distinguish the different requests:

  1. Administrator is concerned about security and does not want clickable links. They can switch this off, as indicated in Starhound’s response linked above:

    Administration → Message → Embed Link Previews (Off).

  2. Channel administrator/moderator wants to disable link previews for a channel. This is what was originally discussed in this topic, but not at all addressed. I think, if the administrator did not disable clickable links (1), this can be a simple element in the channel options and could even share the same name: Embed Link Previews For This Room (On/Off)

  3. Personal setting: If link previews are allowed for the site (1) and the channel (2), I should be able to choose whether I want a link preview included in my message. I think this is what henris42 referred to earlier.

In any case, after sending a message, removing a link preview should be possible. As mentioned by Starhound, this is already addressed in #1929.

However, I see two things that seem to be important for users: the channel setting described in (2) and the personal setting described in (3). Are there already issues for this? How should this be addressed?

Well structured perspective, thanks! I’d like to add one more:

  1. Link previews from certain domains that generally require authentication and/or just deliver visual noise.

For example, we frequentlich share Gitlab and HedgeDoc links in our project channels that simply render a fat logo preview and default text every time. But we also share other links where the preview is really useful. Thus it would be helpful to have an option to hide the preview context-related.

1 Like

Try Administration -> Message -> Hosts not to integrate (or something similar, my RocketChat instance is not in english language).

Ha, it’s there, I didn’t notice! Thanks so much!

Message → Embed Ignored Hosts

(FTR: Seems like this setting expects IPv4 addresses, not domain names)

Why Embed Ignored Hosts is inactive field for public hosted chats?
BTW Disable Embed for Users settings is ignored, not work…