From 34704cd2ba0ab7bdb4fade927a078dd813edef7a Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Mon, 23 Dec 2019 08:26:43 +0100 Subject: [PATCH] Fixed issue #2873 - Tweet which is containing * will not send out, Twitter::Error::Unauthorized: Could not authenticate you. --- lib/twitter_sync.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/twitter_sync.rb b/lib/twitter_sync.rb index c48b006b1..73a89dc3d 100644 --- a/lib/twitter_sync.rb +++ b/lib/twitter_sync.rb @@ -458,7 +458,7 @@ class TwitterSync =begin -create a tweet ot direct message from an article +create a tweet or direct message from an article =end @@ -498,6 +498,12 @@ create a tweet ot direct message from an article Rails.logger.debug { 'Create tweet from article...' } + # rubocop:disable Style/AsciiComments + # workaround for https://github.com/sferik/twitter/issues/677 + # https://github.com/zammad/zammad/issues/2873 - unable to post + # tweets with * - replace `*` with the wide-asterisk `*`. + # rubocop:enable Style/AsciiComments + article[:body].tr!('*', '*') if article[:body].present? tweet = @client.update( article[:body], {