提案 #1323 » 0001-Tweet-URL-2.patch
core/plugin/twitter/twitter.rb | ||
---|---|---|
401 | 401 |
def extended_entity_media(tweet) |
402 | 402 |
extended_entities = (tweet[:extended_entities][:media] rescue nil) |
403 | 403 |
if extended_entities |
404 |
space = text_note(description: ' ')
|
|
404 |
newline = text_note(description: "\n")
|
|
405 | 405 |
result = extended_entities.map{ |media| |
406 | 406 |
case media[:type] |
407 | 407 |
when 'photo' |
... | ... | |
434 | 434 |
description: "#{media[:display_url]} (GIF)", |
435 | 435 |
uri: variant[:url]) |
436 | 436 |
end |
437 |
}.flat_map{|media| [media, space] } |
|
438 |
result.pop |
|
437 |
}.flat_map{|media| [newline, media] } |
|
439 | 438 |
result |
440 | 439 |
else |
441 | 440 |
[] |