forked from GNUsocial/gnu-social
		
	Save attached URLs when importing a Twitter status: this lets our thumbnail detection handle photos and videos linked to by Twitter posters.
This commit is contained in:
		| @@ -189,6 +189,7 @@ class TwitterImport | ||||
|         Notice_to_status::saveNew($notice->id, $status->id); | ||||
|  | ||||
|         $this->saveStatusMentions($notice, $status); | ||||
|         $this->saveStatusAttachments($notice, $status); | ||||
|  | ||||
|         $notice->blowOnInsert(); | ||||
|  | ||||
| @@ -648,4 +649,20 @@ class TwitterImport | ||||
|             } | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Record URL links from the notice. Needed to get thumbnail records | ||||
|      * for referenced photo and video posts, etc. | ||||
|      * | ||||
|      * @param Notice $notice | ||||
|      * @param object $status | ||||
|      */ | ||||
|     function saveStatusAttachments($notice, $status) | ||||
|     { | ||||
|         if (!empty($status->entities) && !empty($status->entities->urls)) { | ||||
|             foreach ($status->entities->urls as $url) { | ||||
|                 File::processNew($url->url, $notice->id); | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user