yuya373 / emacs-slack

slack client for emacs
1.1k stars 117 forks source link

private channels that I don't have access to make emacs-slack fail #554

Open Konubinix opened 2 years ago

Konubinix commented 2 years ago

When someone refers to a private channel for which I don't have access, in slack, it is displayed like this.

image

In emacs, it fails in slack-block-to-string (for slack-rich-text-channel-element)

In the following code

    (propertize (format "#%s" (slack-room-name (slack-room-find id team) team))
                'room-id id
                'keymap slack-channel-button-keymap
                'face 'slack-channel-button-face)))

It cannot find the room, and then calls (slack-room-name nil team) which fails, leaving the channel partially filled.

I hackily changed the code to write "private_channel" when it does not find the channel.

    (propertize (format "#%s" (if-let (
                                       (channel (slack-room-find id team))
                                       )
                                  (slack-room-name channel team)
                                "private_channel"
                                )
                        )
                'room-id id
                'keymap slack-channel-button-keymap
                'face 'slack-channel-button-face)))

So that it now doesn't fail.

We can discuss the issue so that I can submit a pull request. So far, my code looks a bit ad-hoc.