Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

feat: Category specific channels #7

Merged
merged 6 commits into from
Sep 5, 2016
Merged

feat: Category specific channels #7

merged 6 commits into from
Sep 5, 2016

Conversation

Jake-Shadle
Copy link
Contributor

This adds the ability to turn on category specific channels, which
can be specified in the category settings when the setting is enabled.

If the category does not have a specific channel set, it falls back to
the parent category if there is one, otherwise it just uses the global
channel specified in the settings.

Jake added 2 commits February 23, 2016 17:28
This adds the ability to turn on category specific channels, which
can be specified in the category settings when the setting is enabled.

If the category does not have a specific channel set, it falls back to
the parent category if there is one, otherwise it just uses the global
channel specified in the settings.
@bernd
Copy link
Owner

bernd commented Feb 25, 2016

Thanks for the PR! I just asked in #6 if this would cover the use case.

@Jake-Shadle
Copy link
Contributor Author

Cool, let me know if you want me to clean anything up, I am a complete n00b at Ruby so it's probably not idiomatic. 😞

@richardxia
Copy link

This looks pretty useful! However, it'd be nice if we could have the ability to set SiteSetting.slack_channel to None to prevent messages from being posted to a default channel unless if they have access a specific category. I think that this could be done after line 48 with a single line:

next if channel.empty?

I'm not familiar with Discourse plugins, but that should work if it's built on Ruby on Rails. Otherwise, you'll want to do next if !channel or channel == ''.

@Jake-Shadle
Copy link
Contributor Author

I was actually thinking about this, except by having a checkbox in the UI so it is more obvious to the user. (would also disable text input where you put the channel/user name)

@deargle
Copy link

deargle commented Aug 25, 2016

FWIW I'm using this PR with @richardxia's next if channel.empty? suggestion with great success.

I also added the post category name to the slack post title, but my use case is kind of specific: I'm only sending a subset of my categories to one channel (for example I'm excluding #Staff), so it's helpful for me to both be able to per-category things and leave the default category blank, and to also show the category name in the title. As @richardxia commented here I should check if category is nil to make my edit more generalizable. Maybe it'll help someone else to see what I did.

@Jake-Shadle
Copy link
Contributor Author

Yah, I don't remember why, this was made a long time ago, put it back how it was. 😃

@deargle
Copy link

deargle commented Aug 26, 2016

Cool thanks!

@bernd this PR has reached critical mass. It simply must be merged. (Please.) I'll write a readme PR to describe the three-ish new features in here if this gets merged.

@bernd
Copy link
Owner

bernd commented Sep 5, 2016

@deargle Awesome, thank you!

@bernd bernd merged commit fd85b1d into bernd:master Sep 5, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants