Rubocop redundant return fix
This commit is contained in:
parent
bf6f66ada8
commit
6fcf381751
|
@ -18,7 +18,7 @@ module DiscourseChat::Provider::FlowdockProvider
|
||||||
req.body = message.to_json
|
req.body = message.to_json
|
||||||
response = http.request(req)
|
response = http.request(req)
|
||||||
|
|
||||||
return response
|
response
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.generate_flowdock_message(post, flow_token)
|
def self.generate_flowdock_message(post, flow_token)
|
||||||
|
@ -45,7 +45,7 @@ module DiscourseChat::Provider::FlowdockProvider
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return message
|
message
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.trigger_notification(post, channel)
|
def self.trigger_notification(post, channel)
|
||||||
|
|
|
@ -28,7 +28,7 @@ module DiscourseChat
|
||||||
req.body = message.to_json
|
req.body = message.to_json
|
||||||
response = http.request(req)
|
response = http.request(req)
|
||||||
|
|
||||||
return response
|
response
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.generate_matrix_message(post)
|
def self.generate_matrix_message(post)
|
||||||
|
@ -53,7 +53,7 @@ module DiscourseChat
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return message
|
message
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.trigger_notification(post, channel)
|
def self.trigger_notification(post, channel)
|
||||||
|
|
|
@ -43,7 +43,7 @@ module DiscourseChat::Provider::MattermostProvider
|
||||||
# Create channel if doesn't exist
|
# Create channel if doesn't exist
|
||||||
channel ||= DiscourseChat::Channel.create!(provider: provider, data: { identifier: channel_id })
|
channel ||= DiscourseChat::Channel.create!(provider: provider, data: { identifier: channel_id })
|
||||||
|
|
||||||
return ::DiscourseChat::Helper.process_command(channel, tokens)
|
::DiscourseChat::Helper.process_command(channel, tokens)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@ module DiscourseChat::Provider::RocketchatProvider
|
||||||
|
|
||||||
message[:attachments].push(summary)
|
message[:attachments].push(summary)
|
||||||
|
|
||||||
return message
|
message
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.send_via_webhook(message)
|
def self.send_via_webhook(message)
|
||||||
|
|
|
@ -100,7 +100,7 @@ module DiscourseChat::Provider::SlackProvider
|
||||||
response = http.request(req)
|
response = http.request(req)
|
||||||
end
|
end
|
||||||
|
|
||||||
return { text: I18n.t("chat_integration.provider.slack.transcript.loading") }
|
{ text: I18n.t("chat_integration.provider.slack.transcript.loading") }
|
||||||
end
|
end
|
||||||
|
|
||||||
def interactive
|
def interactive
|
||||||
|
|
|
@ -70,7 +70,7 @@ module DiscourseChat::Provider::SlackProvider
|
||||||
|
|
||||||
message[:attachments].push(summary)
|
message[:attachments].push(summary)
|
||||||
|
|
||||||
return message
|
message
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.send_via_api(post, channel, message)
|
def self.send_via_api(post, channel, message)
|
||||||
|
|
|
@ -80,7 +80,7 @@ module DiscourseChat::Provider::TelegramProvider
|
||||||
tokens[0][0] = '' # Remove the slash from the first token
|
tokens[0][0] = '' # Remove the slash from the first token
|
||||||
tokens[0] = tokens[0].split('@')[0] # Remove the bot name from the command (necessary for group chats)
|
tokens[0] = tokens[0].split('@')[0] # Remove the bot name from the command (necessary for group chats)
|
||||||
|
|
||||||
return ::DiscourseChat::Helper.process_command(channel, tokens)
|
::DiscourseChat::Helper.process_command(channel, tokens)
|
||||||
end
|
end
|
||||||
|
|
||||||
def telegram_token_valid?
|
def telegram_token_valid?
|
||||||
|
|
|
@ -29,7 +29,7 @@ module DiscourseChat
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.sendMessage(message)
|
def self.sendMessage(message)
|
||||||
return self.do_api_request('sendMessage', message)
|
self.do_api_request('sendMessage', message)
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.do_api_request(methodName, message)
|
def self.do_api_request(methodName, message)
|
||||||
|
@ -46,7 +46,7 @@ module DiscourseChat
|
||||||
|
|
||||||
responseData = JSON.parse(response.body)
|
responseData = JSON.parse(response.body)
|
||||||
|
|
||||||
return responseData
|
responseData
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.message_text(post)
|
def self.message_text(post)
|
||||||
|
@ -69,7 +69,7 @@ module DiscourseChat
|
||||||
tags = topic.tags.map(&:name).join(', ')
|
tags = topic.tags.map(&:name).join(', ')
|
||||||
end
|
end
|
||||||
|
|
||||||
return I18n.t(
|
I18n.t(
|
||||||
"chat_integration.provider.telegram.message",
|
"chat_integration.provider.telegram.message",
|
||||||
user: display_name,
|
user: display_name,
|
||||||
post_url: post.full_url,
|
post_url: post.full_url,
|
||||||
|
|
|
@ -22,7 +22,7 @@ module DiscourseChat
|
||||||
|
|
||||||
response = http.request(req)
|
response = http.request(req)
|
||||||
|
|
||||||
return response
|
response
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.generate_zulip_message(post, stream, subject)
|
def self.generate_zulip_message(post, stream, subject)
|
||||||
|
|
Loading…
Reference in New Issue