1
0
Fork 0

The post-media table now works with the "attach" field as well

This commit is contained in:
Michael 2020-10-31 13:26:08 +00:00
commit 8485c8c357
7 changed files with 131 additions and 22 deletions

View file

@ -196,7 +196,8 @@ class Processor
$item['attach'] = '';
}
$item['attach'] .= '[attach]href="' . $attach['url'] . '" length="' . ($attach['length'] ?? '0') . '" type="' . $attach['mediaType'] . '" title="' . ($attach['name'] ?? '') . '"[/attach]';
$item['attach'] .= Post\Media::getAttachElement($attach['url'],
$attach['length'] ?? 0, $attach['mediaType'], $attach['name'] ?? '');
}
}
}

View file

@ -39,6 +39,7 @@ use Friendica\Model\ItemURI;
use Friendica\Model\Mail;
use Friendica\Model\Notify\Type;
use Friendica\Model\PermissionSet;
use Friendica\Model\Post;
use Friendica\Model\Post\Category;
use Friendica\Model\Profile;
use Friendica\Model\Tag;
@ -2176,7 +2177,7 @@ class DFRN
$item["attach"] = "";
}
$item["attach"] .= '[attach]href="' . $href . '" length="' . $length . '" type="' . $type . '" title="' . $title . '"[/attach]';
$item["attach"] .= Post\Media::getAttachElement($href, $length, $type, $title);
break;
}
}

View file

@ -33,6 +33,7 @@ use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Contact;
use Friendica\Model\Item;
use Friendica\Model\Post;
use Friendica\Model\Tag;
use Friendica\Model\User;
use Friendica\Util\DateTimeFormat;
@ -457,7 +458,7 @@ class Feed
$attachments[] = ["link" => $href, "type" => $type, "length" => $length];
$item["attach"] .= '[attach]href="' . $href . '" length="' . $length . '" type="' . $type . '"[/attach]';
$item["attach"] .= Post\Media::getAttachElement($href, $length, $type);
}
$taglist = [];

View file

@ -36,6 +36,7 @@ use Friendica\Model\Contact;
use Friendica\Model\Conversation;
use Friendica\Model\Item;
use Friendica\Model\ItemURI;
use Friendica\Model\Post;
use Friendica\Model\Tag;
use Friendica\Model\User;
use Friendica\Network\Probe;
@ -1126,7 +1127,8 @@ class OStatus
if (!isset($attribute['length'])) {
$attribute['length'] = "0";
}
$item["attach"] .= '[attach]href="'.$attribute['href'].'" length="'.$attribute['length'].'" type="'.$attribute['type'].'" title="'.($attribute['title'] ?? '') .'"[/attach]';
$item["attach"] .= Post\Media::getAttachElement($attribute['href'],
$attribute['length'], $attribute['type'], $attribute['title'] ?? '');
}
break;
case "related":