<?php
/**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2022, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
"pubmail" => ["post-thread-user", "pubmail"],
"visible" => ["post-user", "visible"],
"starred" => ["post-thread-user", "starred"],
- "pinned" => ["post-thread-user", "pinned"],
"unseen" => ["post-user", "unseen"],
"deleted" => ["post-user", "deleted"],
"origin" => ["post-user", "origin"],
"parent-origin" => ["post-thread-user", "origin"],
- "forum_mode" => ["post-thread-user", "forum_mode"],
"mention" => ["post-thread-user", "mention"],
"global" => ["post-user", "global"],
+ "featured" => "EXISTS(SELECT `type` FROM `post-collection` WHERE `type` = 0 AND `uri-id` = `post-user`.`uri-id`)",
"network" => ["post-user", "network"],
"vid" => ["post-user", "vid"],
"psid" => ["post-user", "psid"],
"title" => ["post-content", "title"],
"content-warning" => ["post-content", "content-warning"],
"raw-body" => ["post-content", "raw-body"],
- "body" => ["post-content", "body"],
+ "body" => "IFNULL (`post-content`.`body`, '')",
"rendered-hash" => ["post-content", "rendered-hash"],
"rendered-html" => ["post-content", "rendered-html"],
"language" => ["post-content", "language"],
"event-type" => ["event", "type"],
"event-nofinish" => ["event", "nofinish"],
"event-ignore" => ["event", "ignore"],
+ "question-id" => ["post-question", "id"],
+ "question-multiple" => ["post-question", "multiple"],
+ "question-voters" => ["post-question", "voters"],
+ "question-end-time" => ["post-question", "end-time"],
"signed_text" => ["diaspora-interaction", "interaction"],
"parent-guid" => ["parent-item-uri", "guid"],
"parent-network" => ["parent-post", "network"],
"parent-author-id" => ["parent-post", "author-id"],
"parent-author-link" => ["parent-post-author", "url"],
"parent-author-name" => ["parent-post-author", "name"],
+ "parent-author-nick" => ["parent-post-author", "nick"],
"parent-author-network" => ["parent-post-author", "network"],
"parent-author-blocked" => ["parent-post-author", "blocked"],
"parent-author-hidden" => ["parent-post-author", "hidden"],
LEFT JOIN `diaspora-interaction` ON `diaspora-interaction`.`uri-id` = `post-user`.`uri-id`
LEFT JOIN `post-content` ON `post-content`.`uri-id` = `post-user`.`uri-id`
LEFT JOIN `post-delivery-data` ON `post-delivery-data`.`uri-id` = `post-user`.`uri-id` AND `post-user`.`origin`
+ LEFT JOIN `post-question` ON `post-question`.`uri-id` = `post-user`.`uri-id`
LEFT JOIN `permissionset` ON `permissionset`.`id` = `post-user`.`psid`
LEFT JOIN `post-user` AS `parent-post` ON `parent-post`.`uri-id` = `post-user`.`parent-uri-id` AND `parent-post`.`uid` = `post-user`.`uid`
LEFT JOIN `contact` AS `parent-post-author` ON `parent-post-author`.`id` = `parent-post`.`author-id`"
"ignored" => ["post-thread-user", "ignored"],
"visible" => ["post-user", "visible"],
"starred" => ["post-thread-user", "starred"],
- "pinned" => ["post-thread-user", "pinned"],
"unseen" => ["post-thread-user", "unseen"],
"deleted" => ["post-user", "deleted"],
"origin" => ["post-thread-user", "origin"],
- "forum_mode" => ["post-thread-user", "forum_mode"],
"mention" => ["post-thread-user", "mention"],
"global" => ["post-user", "global"],
+ "featured" => "EXISTS(SELECT `type` FROM `post-collection` WHERE `type` = 0 AND `uri-id` = `post-thread-user`.`uri-id`)",
"network" => ["post-thread-user", "network"],
"vid" => ["post-user", "vid"],
"psid" => ["post-thread-user", "psid"],
"event-type" => ["event", "type"],
"event-nofinish" => ["event", "nofinish"],
"event-ignore" => ["event", "ignore"],
+ "question-id" => ["post-question", "id"],
+ "question-multiple" => ["post-question", "multiple"],
+ "question-voters" => ["post-question", "voters"],
+ "question-end-time" => ["post-question", "end-time"],
"signed_text" => ["diaspora-interaction", "interaction"],
"parent-guid" => ["parent-item-uri", "guid"],
"parent-network" => ["parent-post", "network"],
LEFT JOIN `diaspora-interaction` ON `diaspora-interaction`.`uri-id` = `post-thread-user`.`uri-id`
LEFT JOIN `post-content` ON `post-content`.`uri-id` = `post-thread-user`.`uri-id`
LEFT JOIN `post-delivery-data` ON `post-delivery-data`.`uri-id` = `post-thread-user`.`uri-id` AND `post-thread-user`.`origin`
+ LEFT JOIN `post-question` ON `post-question`.`uri-id` = `post-thread-user`.`uri-id`
LEFT JOIN `permissionset` ON `permissionset`.`id` = `post-thread-user`.`psid`
LEFT JOIN `post-user` AS `parent-post` ON `parent-post`.`uri-id` = `post-user`.`parent-uri-id` AND `parent-post`.`uid` = `post-thread-user`.`uid`
LEFT JOIN `contact` AS `parent-post-author` ON `parent-post-author`.`id` = `parent-post`.`author-id`"
"visible" => ["post", "visible"],
"deleted" => ["post", "deleted"],
"global" => ["post", "global"],
+ "featured" => "EXISTS(SELECT `type` FROM `post-collection` WHERE `type` = 0 AND `uri-id` = `post`.`uri-id`)",
"network" => ["post", "network"],
"vid" => ["post", "vid"],
"verb" => "IF (`post`.`vid` IS NULL, '', `verb`.`name`)",
"causer-blocked" => ["causer", "blocked"],
"causer-hidden" => ["causer", "hidden"],
"causer-contact-type" => ["causer", "contact-type"],
+ "question-id" => ["post-question", "id"],
+ "question-multiple" => ["post-question", "multiple"],
+ "question-voters" => ["post-question", "voters"],
+ "question-end-time" => ["post-question", "end-time"],
"signed_text" => ["diaspora-interaction", "interaction"],
"parent-guid" => ["parent-item-uri", "guid"],
"parent-network" => ["parent-post", "network"],
LEFT JOIN `verb` ON `verb`.`id` = `post`.`vid`
LEFT JOIN `diaspora-interaction` ON `diaspora-interaction`.`uri-id` = `post`.`uri-id`
LEFT JOIN `post-content` ON `post-content`.`uri-id` = `post`.`uri-id`
+ LEFT JOIN `post-question` ON `post-question`.`uri-id` = `post`.`uri-id`
LEFT JOIN `post` AS `parent-post` ON `parent-post`.`uri-id` = `post`.`parent-uri-id`
LEFT JOIN `contact` AS `parent-post-author` ON `parent-post-author`.`id` = `parent-post`.`author-id`"
],
"visible" => ["post", "visible"],
"deleted" => ["post", "deleted"],
"global" => ["post", "global"],
+ "featured" => "EXISTS(SELECT `type` FROM `post-collection` WHERE `type` = 0 AND `uri-id` = `post-thread`.`uri-id`)",
"network" => ["post-thread", "network"],
"vid" => ["post", "vid"],
"verb" => "IF (`post`.`vid` IS NULL, '', `verb`.`name`)",
"causer-blocked" => ["causer", "blocked"],
"causer-hidden" => ["causer", "hidden"],
"causer-contact-type" => ["causer", "contact-type"],
+ "question-id" => ["post-question", "id"],
+ "question-multiple" => ["post-question", "multiple"],
+ "question-voters" => ["post-question", "voters"],
+ "question-end-time" => ["post-question", "end-time"],
"signed_text" => ["diaspora-interaction", "interaction"],
"parent-guid" => ["parent-item-uri", "guid"],
"parent-network" => ["parent-post", "network"],
LEFT JOIN `verb` ON `verb`.`id` = `post`.`vid`
LEFT JOIN `diaspora-interaction` ON `diaspora-interaction`.`uri-id` = `post-thread`.`uri-id`
LEFT JOIN `post-content` ON `post-content`.`uri-id` = `post-thread`.`uri-id`
+ LEFT JOIN `post-question` ON `post-question`.`uri-id` = `post-thread`.`uri-id`
LEFT JOIN `post` AS `parent-post` ON `parent-post`.`uri-id` = `post`.`parent-uri-id`
LEFT JOIN `contact` AS `parent-post-author` ON `parent-post-author`.`id` = `parent-post`.`author-id`"
],
"query" => "FROM `post-category`
LEFT JOIN `tag` ON `post-category`.`tid` = `tag`.`id`"
],
+ "collection-view" => [
+ "fields" => [
+ "uri-id" => ["post-collection", "uri-id"],
+ "type" => ["post-collection", "type"],
+ "cid" => ["post", "author-id"],
+ "received" => ["post", "received"],
+ "created" => ["post", "created"],
+ ],
+ "query" => "FROM `post-collection`
+ INNER JOIN `post` ON `post-collection`.`uri-id` = `post`.`uri-id`"
+ ],
"tag-view" => [
"fields" => [
"uri-id" => ["post-tag", "uri-id"],
"archive" => ["contact", "archive"],
"deleted" => ["contact", "deleted"],
"blocked" => ["contact", "blocked"],
- "dfrn-request" => ["contact", "request"],
"dfrn-notify" => ["contact", "notify"],
"dfrn-poll" => ["contact", "poll"],
- "dfrn-confirm" => ["contact", "confirm"],
"diaspora-guid" => ["fcontact", "guid"],
"diaspora-batch" => ["fcontact", "batch"],
"diaspora-notify" => ["fcontact", "notify"],
"ap-following_count" => ["apcontact", "following_count"],
"ap-followers_count" => ["apcontact", "followers_count"],
"ap-statuses_count" => ["apcontact", "statuses_count"],
+ "site_name" => ["gserver", "site_name"],
+ "platform" => ["gserver", "platform"],
+ "version" => ["gserver", "version"],
],
"query" => "FROM `contact`
LEFT JOIN `item-uri` ON `item-uri`.`id` = `contact`.`uri-id`
LEFT JOIN `apcontact` ON `apcontact`.`uri-id` = `contact`.`uri-id`
LEFT JOIN `fcontact` ON `fcontact`.`uri-id` = contact.`uri-id`
+ LEFT JOIN `gserver` ON `gserver`.`id` = contact.`gsid`
WHERE `contact`.`uid` = 0"
],
"account-user-view" => [
"subhub" => ["ucontact", "subhub"],
"hub-verify" => ["ucontact", "hub-verify"],
"reason" => ["ucontact", "reason"],
- "dfrn-request" => ["contact", "request"],
"dfrn-notify" => ["contact", "notify"],
"dfrn-poll" => ["contact", "poll"],
- "dfrn-confirm" => ["contact", "confirm"],
"diaspora-guid" => ["fcontact", "guid"],
"diaspora-batch" => ["fcontact", "batch"],
"diaspora-notify" => ["fcontact", "notify"],
"ap-following_count" => ["apcontact", "following_count"],
"ap-followers_count" => ["apcontact", "followers_count"],
"ap-statuses_count" => ["apcontact", "statuses_count"],
+ "site_name" => ["gserver", "site_name"],
+ "platform" => ["gserver", "platform"],
+ "version" => ["gserver", "version"],
],
"query" => "FROM `contact` AS `ucontact`
INNER JOIN `contact` ON `contact`.`uri-id` = `ucontact`.`uri-id` AND `contact`.`uid` = 0
LEFT JOIN `item-uri` ON `item-uri`.`id` = `ucontact`.`uri-id`
LEFT JOIN `apcontact` ON `apcontact`.`uri-id` = `ucontact`.`uri-id`
- LEFT JOIN `fcontact` ON `fcontact`.`uri-id` = `ucontact`.`uri-id` AND `fcontact`.`network` = 'dspr'"
+ LEFT JOIN `fcontact` ON `fcontact`.`uri-id` = `ucontact`.`uri-id` AND `fcontact`.`network` = 'dspr'
+ LEFT JOIN `gserver` ON `gserver`.`id` = contact.`gsid`"
],
"pending-view" => [
"fields" => [