Skip to content

Commit

Permalink
Hide preview on link post
Browse files Browse the repository at this point in the history
(cherry picked from commit 81ff761)
  • Loading branch information
arturtr committed Mar 31, 2016
1 parent 761674f commit 90e52fb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion init.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

project_module :chat_telegram do
permission :create_telegram_chat, :telegram_group_chats => :create
permission :close_telegram_chat, :telegram_group_chats => :create
permission :close_telegram_chat, :telegram_group_chats => :destroy
permission :view_telegram_chat_link, :telegram_group_chats => :create
permission :view_telegram_chat_archive, :telegram_group_chats => :create
end
Expand Down
9 changes: 7 additions & 2 deletions lib/tasks/chat_telegram.rake
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,10 @@ namespace :chat_telegram do
issue = set_telegram_id(message, telegram_chat_id)

issue_url = RedmineChatTelegram.issue_url(issue.id)
bot.send_message(chat_id: telegram_chat_id, text: "Hello, everybody! This is a chat for issue: #{issue_url}")
bot.send_message(chat_id: telegram_chat_id,
text: "Hello, everybody! This is a chat for issue: #{issue_url}",
disable_web_page_preview: true)

message_text = 'Chat created'
telegram_message = TelegramMessage.create issue_id: issue.id,
telegram_id: telegram_id,
Expand Down Expand Up @@ -131,7 +134,9 @@ namespace :chat_telegram do
message_text = message.text

if message_text.include?('/task') or message_text.include?('/link') or message_text.include?('/url')
bot.send_message(chat_id: telegram_chat_id, text: "#{issue.subject}\n#{issue_url}")
bot.send_message(chat_id: telegram_chat_id,
text: "#{issue.subject}\n#{issue_url}",
disable_web_page_preview: true)

next unless message_text.gsub('/task', '').gsub('/link', '').gsub('/url', '').strip.present?

Expand Down

0 comments on commit 90e52fb

Please sign in to comment.