use Friendica\Model\Mail;
use Friendica\Model\Notify\Type;
use Friendica\Model\PermissionSet;
+use Friendica\Model\Post\Category;
use Friendica\Model\Profile;
use Friendica\Model\Tag;
-use Friendica\Model\Term;
use Friendica\Model\User;
use Friendica\Network\Probe;
use Friendica\Util\Crypto;
}
if (isset($category)) {
- $sql_post_table = sprintf(
- "INNER JOIN (SELECT `oid` FROM `term` WHERE `term` = '%s' AND `otype` = %d AND `type` = %d AND `uid` = %d ORDER BY `tid` DESC) AS `term` ON `item`.`id` = `term`.`oid` ",
- DBA::escape(Strings::protectSprintf($category)),
- intval(Term::OBJECT_TYPE_POST),
- intval(Term::CATEGORY),
- intval($owner_id)
- );
+ $sql_post_table = sprintf("INNER JOIN (SELECT `uri-id` FROM `category-view` WHERE `name` = '%s' AND `type` = %d AND `uid` = %d ORDER BY `uri-id` DESC) AS `category` ON `item`.`uri-id` = `category`.`uri-id` ",
+ DBA::escape(Strings::protectSprintf($category)), intval(Category::CATEGORY), intval($owner_id));
}
if ($public_feed && ! $converse) {
}
$fields = ['title' => $item['title'] ?? '', 'body' => $item['body'] ?? '',
- 'tag' => $item['tag'] ?? '', 'changed' => DateTimeFormat::utcNow(),
+ 'changed' => DateTimeFormat::utcNow(),
'edited' => DateTimeFormat::utc($item["edited"])];
$condition = ["`uri` = ? AND `uid` IN (0, ?)", $item["uri"], $importer["importer_uid"]];
// We store the data from "dfrn:diaspora_signature" in a different table, this is done in "Item::insert"
$dsprsig = XML::unescape(XML::getFirstNodeValue($xpath, "dfrn:diaspora_signature/text()", $entry));
if ($dsprsig != "") {
- $item["dsprsig"] = $dsprsig;
+ $signature = json_decode(base64_decode($dsprsig));
+ // We don't store the old style signatures anymore that also contained the "signature" and "signer"
+ if (!empty($signature->signed_text) && empty($signature->signature) && empty($signature->signer)) {
+ $item["diaspora_signed_text"] = $signature->signed_text;
+ }
}
$item["verb"] = XML::getFirstNodeValue($xpath, "activity:verb/text()", $entry);
// Turn this into a wall post.
$notify = Item::isRemoteSelf($importer, $item);
- $posted_id = Item::insert($item, false, $notify);
+ $posted_id = Item::insert($item, $notify);
if ($notify) {
$posted_id = $notify;