Fixed issue #912 - Long Twitter direct messages are shown as link after 140 chars.

This commit is contained in:
Thorsten Eckel 2017-04-21 13:52:32 +02:00
parent 131d360c75
commit d93c1ba444
2 changed files with 8 additions and 8 deletions

View file

@ -324,7 +324,7 @@ returns
Rails.logger.debug ' - searching for direct_messages'
older_import = 0
older_import_max = 20
@rest_client.client.direct_messages.each { |tweet|
@rest_client.client.direct_messages(full_text: 'true').each { |tweet|
# ignore older messages
if (@channel.created_at - 15.days) > tweet.created_at || older_import >= older_import_max

View file

@ -210,7 +210,7 @@ class TwitterTest < ActiveSupport::TestCase
}
assert(article, "Can't find tweet id #{tweet.id}/#{text}")
assert_equal(customer_login, article.from, 'ticket article from')
assert_equal(nil, article.to, 'ticket article to')
assert_nil(article.to, 'ticket article to')
ticket = article.ticket
assert_equal('new', ticket.reload.state.name)
@ -307,7 +307,7 @@ class TwitterTest < ActiveSupport::TestCase
client.destroy_direct_message(dm.id)
}
hash = "#citheo44 #{hash_gen}"
text = "How about #{rand_word} the details? #{hash}"
text = "How about #{rand_word} the details? #{hash} - #{'Long' * 50}"
dm = client.create_direct_message(
system_login_without_at,
text,
@ -328,7 +328,7 @@ class TwitterTest < ActiveSupport::TestCase
assert(article, "inbound article '#{text}' created")
assert_equal(customer_login, article.from, 'ticket article from')
assert_equal(system_login, article.to, 'ticket article to')
assert_equal(text, article.body, 'ticket article body')
ticket = article.ticket
assert(ticket, 'ticket of inbound article exists')
assert(ticket.articles, 'ticket.articles exists')
@ -504,7 +504,7 @@ class TwitterTest < ActiveSupport::TestCase
sleep 10
}
assert_equal(nil, article, "retweet article '#{text}' not created")
assert_nil(article, "retweet article '#{text}' not created")
end
test 'f streaming test' do
@ -537,7 +537,7 @@ class TwitterTest < ActiveSupport::TestCase
}
assert(article, "article from customer with text '#{text}' message_id '#{tweet.id}' created")
assert_equal(customer_login, article.from, 'ticket article from')
assert_equal(nil, article.to, 'ticket article to')
assert_nil(article.to, 'ticket article to')
# new tweet II - by me_bauer
client = Twitter::REST::Client.new do |config|
@ -562,7 +562,7 @@ class TwitterTest < ActiveSupport::TestCase
}
assert(article, "article from customer with text '#{text}' message_id '#{tweet.id}' created")
assert_equal(customer_login, article.from, 'ticket article from')
assert_equal(nil, article.to, 'ticket article to')
assert_nil(article.to, 'ticket article to')
# send reply
reply_text = "RE #{text}"
@ -728,7 +728,7 @@ class TwitterTest < ActiveSupport::TestCase
sleep 10
}
assert_equal(nil, article, "retweet article '#{text}' not created")
assert_nil(article, "retweet article '#{text}' not created")
thread.exit
thread.join