Fixed issue #912 - Long Twitter direct messages are shown as link after 140 chars.
This commit is contained in:
parent
131d360c75
commit
d93c1ba444
2 changed files with 8 additions and 8 deletions
|
@ -324,7 +324,7 @@ returns
|
||||||
Rails.logger.debug ' - searching for direct_messages'
|
Rails.logger.debug ' - searching for direct_messages'
|
||||||
older_import = 0
|
older_import = 0
|
||||||
older_import_max = 20
|
older_import_max = 20
|
||||||
@rest_client.client.direct_messages.each { |tweet|
|
@rest_client.client.direct_messages(full_text: 'true').each { |tweet|
|
||||||
|
|
||||||
# ignore older messages
|
# ignore older messages
|
||||||
if (@channel.created_at - 15.days) > tweet.created_at || older_import >= older_import_max
|
if (@channel.created_at - 15.days) > tweet.created_at || older_import >= older_import_max
|
||||||
|
|
|
@ -210,7 +210,7 @@ class TwitterTest < ActiveSupport::TestCase
|
||||||
}
|
}
|
||||||
assert(article, "Can't find tweet id #{tweet.id}/#{text}")
|
assert(article, "Can't find tweet id #{tweet.id}/#{text}")
|
||||||
assert_equal(customer_login, article.from, 'ticket article from')
|
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
|
ticket = article.ticket
|
||||||
assert_equal('new', ticket.reload.state.name)
|
assert_equal('new', ticket.reload.state.name)
|
||||||
|
|
||||||
|
@ -307,7 +307,7 @@ class TwitterTest < ActiveSupport::TestCase
|
||||||
client.destroy_direct_message(dm.id)
|
client.destroy_direct_message(dm.id)
|
||||||
}
|
}
|
||||||
hash = "#citheo44 #{hash_gen}"
|
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(
|
dm = client.create_direct_message(
|
||||||
system_login_without_at,
|
system_login_without_at,
|
||||||
text,
|
text,
|
||||||
|
@ -328,7 +328,7 @@ class TwitterTest < ActiveSupport::TestCase
|
||||||
|
|
||||||
assert(article, "inbound article '#{text}' created")
|
assert(article, "inbound article '#{text}' created")
|
||||||
assert_equal(customer_login, article.from, 'ticket article from')
|
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
|
ticket = article.ticket
|
||||||
assert(ticket, 'ticket of inbound article exists')
|
assert(ticket, 'ticket of inbound article exists')
|
||||||
assert(ticket.articles, 'ticket.articles exists')
|
assert(ticket.articles, 'ticket.articles exists')
|
||||||
|
@ -504,7 +504,7 @@ class TwitterTest < ActiveSupport::TestCase
|
||||||
sleep 10
|
sleep 10
|
||||||
}
|
}
|
||||||
|
|
||||||
assert_equal(nil, article, "retweet article '#{text}' not created")
|
assert_nil(article, "retweet article '#{text}' not created")
|
||||||
end
|
end
|
||||||
|
|
||||||
test 'f streaming test' do
|
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(article, "article from customer with text '#{text}' message_id '#{tweet.id}' created")
|
||||||
assert_equal(customer_login, article.from, 'ticket article from')
|
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
|
# new tweet II - by me_bauer
|
||||||
client = Twitter::REST::Client.new do |config|
|
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(article, "article from customer with text '#{text}' message_id '#{tweet.id}' created")
|
||||||
assert_equal(customer_login, article.from, 'ticket article from')
|
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
|
# send reply
|
||||||
reply_text = "RE #{text}"
|
reply_text = "RE #{text}"
|
||||||
|
@ -728,7 +728,7 @@ class TwitterTest < ActiveSupport::TestCase
|
||||||
sleep 10
|
sleep 10
|
||||||
}
|
}
|
||||||
|
|
||||||
assert_equal(nil, article, "retweet article '#{text}' not created")
|
assert_nil(article, "retweet article '#{text}' not created")
|
||||||
|
|
||||||
thread.exit
|
thread.exit
|
||||||
thread.join
|
thread.join
|
||||||
|
|
Loading…
Reference in a new issue