Merge pull request #32 from Thra11/show-boosted-attachments

Fix #30: display attachments from boosted toots
This commit is contained in:
Dusko Angirevic 2018-10-18 10:43:58 +02:00 committed by GitHub
commit 7b834966fb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -252,5 +252,18 @@ function parseToot (data){
}
item['attachments'].push(tmp)
}
if(item['status_reblog']){
for(var i = 0; i < data['reblog']['media_attachments'].length ; i++){
var attachments = data['reblog']['media_attachments'][i];
item['content'] = item['content'].replaceAll(attachments['text_url'], '')
var tmp = {
id: attachments['id'],
type: attachments['type'],
url: attachments['remote_url'] && typeof attachments['remote_url'] == "string" ? attachments['remote_url'] : attachments['url'],
preview_url: loadImages ? attachments['preview_url'] : ''
}
item['attachments'].push(tmp)
}
}
return item;
}