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

Add Matrix option for using plain text instead of notice #25

Merged
merged 1 commit into from Dec 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions config/locales/server.en.yml
Expand Up @@ -55,6 +55,7 @@ en:
chat_integration_matrix_homeserver: "Homeserver to connect to. Make sure to include the protocol"
chat_integration_matrix_access_token: "Access token for the bot's Matrix account"
chat_integration_matrix_excerpt_length: "Matrix post excerpt length"
chat_integration_matrix_use_notice: "Use notice instead of plain message"

#######################################
########### ZULIP SETTINGS ############
Expand Down
2 changes: 2 additions & 0 deletions config/settings.yml
Expand Up @@ -85,6 +85,8 @@ chat_integration:
default: ''
chat_integration_matrix_excerpt_length:
default: 400
chat_integration_matrix_use_notice:
default: true

#######################################
########### ZULIP SETTINGS ############
Expand Down
2 changes: 1 addition & 1 deletion lib/discourse_chat/provider/matrix/matrix_provider.rb
Expand Up @@ -39,7 +39,7 @@ def self.generate_matrix_message(post)
end

message = {
msgtype: 'm.notice',
msgtype: SiteSetting.chat_integration_matrix_use_notice ? 'm.notice' : 'm.text',
body: I18n.t('chat_integration.provider.matrix.text_message', user: display_name,
post_url: post.full_url,
title: post.topic.title),
Expand Down