fedimbed: fix gts attachments
This commit is contained in:
		
							parent
							
								
									eebce06577
								
							
						
					
					
						commit
						beeee91e2e
					
				
					 1 changed files with 7 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -343,13 +343,18 @@ async function processUrl(msg, url, spoiler = false) {
 | 
			
		|||
      }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (platform == "gotosocial") console.log(postData);
 | 
			
		||||
    // if (platform == "gotosocial") console.log(postData);
 | 
			
		||||
 | 
			
		||||
    content =
 | 
			
		||||
      postData._misskey_content ?? postData.source?.content ?? postData.content;
 | 
			
		||||
    cw = postData.summary;
 | 
			
		||||
    timestamp = postData.published;
 | 
			
		||||
    for (const attachment of postData.attachment) {
 | 
			
		||||
 | 
			
		||||
    // NB: gts doesnt send singular attachments as areay
 | 
			
		||||
    const attachments = Array.isArray(postData.attachment)
 | 
			
		||||
      ? postData.attachment
 | 
			
		||||
      : [postData.attachment];
 | 
			
		||||
    for (const attachment of attachments) {
 | 
			
		||||
      if (attachment.mediaType.startsWith("video/")) {
 | 
			
		||||
        videos.push({
 | 
			
		||||
          url: attachment.url,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue