New item field "Post-type" and new table "permissionset" (#5408)

* "post-type" replaces "bookmark" and "type"

* Removed some more type

* Added index to permission set

* The permission set is now stored

* The permission set is now removed upon expiry

* Post update now stores the permission set

* New file

* Permissions are now sorted

* Changed documentation
This commit is contained in:
Michael Vogel 2018-07-19 15:52:05 +02:00 committed by Hypolite Petovan
parent 0b38f1c58b
commit 5af9596dde
29 changed files with 222 additions and 145 deletions

View file

@ -1017,7 +1017,7 @@ class DFRN
XML::addElement($doc, $entry, "dfrn:extid", $item['extid']);
}
if ($item['bookmark']) {
if ($item['post-type'] == Item::PT_PAGE) {
XML::addElement($doc, $entry, "dfrn:bookmark", "true");
}
@ -2308,7 +2308,6 @@ class DFRN
|| ($item["verb"] == ACTIVITY_ATTENDMAYBE)
) {
$is_like = true;
$item["type"] = "activity";
$item["gravity"] = GRAVITY_ACTIVITY;
// only one like or dislike per person
// splitted into two queries for performance issues
@ -2489,7 +2488,7 @@ class DFRN
$item["extid"] = XML::getFirstNodeValue($xpath, "dfrn:extid/text()", $entry);
if (XML::getFirstNodeValue($xpath, "dfrn:bookmark/text()", $entry) == "true") {
$item["bookmark"] = true;
$item["post-type"] = Item::PT_PAGE;
}
$notice_info = $xpath->query("statusnet:notice_info", $entry);
@ -2621,7 +2620,6 @@ class DFRN
}
if ($entrytype == DFRN::REPLY_RC) {
$item["type"] = "remote-comment";
$item["wall"] = 1;
} elseif ($entrytype == DFRN::TOP_LEVEL) {
if (!isset($item["object-type"])) {
@ -2829,7 +2827,6 @@ class DFRN
$header = [];
$header["uid"] = $importer["importer_uid"];
$header["network"] = NETWORK_DFRN;
$header["type"] = "remote";
$header["wall"] = 0;
$header["origin"] = 0;
$header["contact-id"] = $importer["id"];