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
`psid`intunsignedCOMMENT'ID of the permission set of this post',
`allow_cid`mediumtextCOMMENT'Access Control - list of allowed contact.id \'<19><78>\'',
`allow_gid`mediumtextCOMMENT'Access Control - list of allowed groups',
`deny_cid`mediumtextCOMMENT'Access Control - list of denied contact.id',
@ -495,7 +496,8 @@ CREATE TABLE IF NOT EXISTS `item` (
`resource-id`varchar(32)NOTNULLDEFAULT''COMMENT'Used to link other tables to items, it identifies the linked resource (e.g. photo) and if set must also set resource_type',
`event-id`intunsignedNOTNULLDEFAULT0COMMENT'Used to link to the event.id',
`attach`mediumtextCOMMENT'JSON structure representing attachments to this item',
`type`varchar(20)NOTNULLDEFAULT''COMMENT'',
`type`varchar(20)COMMENT'Deprecated',
`bookmark`booleanCOMMENT'Deprecated',
`file`mediumtextCOMMENT'Deprecated',
`location`varchar(255)COMMENT'Deprecated',
`coord`varchar(255)COMMENT'Deprecated',
@ -542,7 +544,8 @@ CREATE TABLE IF NOT EXISTS `item` (
INDEX`uid_wall_changed`(`uid`,`wall`,`changed`),
INDEX`uid_eventid`(`uid`,`event-id`),
INDEX`icid`(`icid`),
INDEX`iaid`(`iaid`)
INDEX`iaid`(`iaid`),
INDEX`psid`(`psid`)
)DEFAULTCOLLATEutf8mb4_general_ciCOMMENT='Structure for all posts';
--
@ -760,6 +763,20 @@ CREATE TABLE IF NOT EXISTS `pconfig` (
@ -1169,8 +1166,6 @@ function api_statuses_update($type)
thrownewTooManyRequestsException(L10n::t("Monthly posting limit of %d post reached. The post was rejected.","Monthly posting limit of %d posts reached. The post was rejected.",$throttle_month));
}
}
$_REQUEST['type']='wall';
}
if(x($_FILES,'media')){
@ -1992,7 +1987,6 @@ function api_statuses_repeat($type)
"icid"=>["type"=>"int unsigned","relation"=>["item-content"=>"id"],"comment"=>"Id of the item-content table entry that contains the whole item content"],
"iaid"=>["type"=>"int unsigned","relation"=>["item-activity"=>"id"],"comment"=>"Id of the item-activity table entry that contains the activity data"],
// User specific fields. Should possible be replaced with something different
"psid"=>["type"=>"int unsigned","relation"=>["permissionset"=>"id"],"comment"=>"ID of the permission set of this post"],
// These fields will be replaced by the "psid" from above
"allow_cid"=>["type"=>"mediumtext","comment"=>"Access Control - list of allowed contact.id '<19><78>'"],
"allow_gid"=>["type"=>"mediumtext","comment"=>"Access Control - list of allowed groups"],
"deny_cid"=>["type"=>"mediumtext","comment"=>"Access Control - list of denied contact.id"],
"deny_gid"=>["type"=>"mediumtext","comment"=>"Access Control - list of denied groups"],
// These fields will be moved into some item-delivery-information table
"postopts"=>["type"=>"text","comment"=>"External post connectors add their network name to this comma-separated string to identify that they should be delivered to these networks during delivery"],
"inform"=>["type"=>"mediumtext","comment"=>"Additional receivers of this post"],
// It is to be decided whether these fields belong to the user or the structure
"resource-id"=>["type"=>"varchar(32)","not null"=>"1","default"=>"","comment"=>"Used to link other tables to items, it identifies the linked resource (e.g. photo) and if set must also set resource_type"],
"event-id"=>["type"=>"int unsigned","not null"=>"1","default"=>"0","relation"=>["event"=>"id"],"comment"=>"Used to link to the event.id"],
// Will be replaced by the "attach" table
// Could possibly be replaced by the "attach" table?
"attach"=>["type"=>"mediumtext","comment"=>"JSON structure representing attachments to this item"],
// Seems to be only used for notes, but is filled at many places.
// Will be replaced with some general field that contain the values of "origin" and "wall" as well.