3 * @copyright Copyright (C) 2010-2022, the Friendica project
5 * @license GNU AGPL version 3 or any later version
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU Affero General Public License as
9 * published by the Free Software Foundation, either version 3 of the
10 * License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Affero General Public License for more details.
17 * You should have received a copy of the GNU Affero General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
20 * Main view structure configuration file.
22 * Here are described all the view Friendica needs to work.
24 * Syntax (braces indicate optionale values):
27 * "<field name>" => ["table", "field"],
28 * "<field name>" => "SQL expression",
31 * "query" => "FROM `table` INNER JOIN `other-table` ..."
35 * If you need to make any change, make sure to increment the DB_UPDATE_VERSION constant value in dbstructure.config.php.
40 "application-view" => [
42 "id" => ["application", "id"],
43 "uid" => ["application-token", "uid"],
44 "name" => ["application", "name"],
45 "redirect_uri" => ["application", "redirect_uri"],
46 "website" => ["application", "website"],
47 "client_id" => ["application", "client_id"],
48 "client_secret" => ["application", "client_secret"],
49 "code" => ["application-token", "code"],
50 "access_token" => ["application-token", "access_token"],
51 "created_at" => ["application-token", "created_at"],
52 "scopes" => ["application-token", "scopes"],
53 "read" => ["application-token", "read"],
54 "write" => ["application-token", "write"],
55 "follow" => ["application-token", "follow"],
56 "push" => ["application-token", "push"],
58 "query" => "FROM `application-token`
59 INNER JOIN `application` ON `application-token`.`application-id` = `application`.`id`"
63 "id" => ["post-user", "id"],
64 "post-user-id" => ["post-user", "id"],
65 "uid" => ["post-user", "uid"],
66 "parent" => ["parent-post", "id"],
67 "uri" => ["item-uri", "uri"],
68 "uri-id" => ["post-user", "uri-id"],
69 "parent-uri" => ["parent-item-uri", "uri"],
70 "parent-uri-id" => ["post-user", "parent-uri-id"],
71 "thr-parent" => ["thr-parent-item-uri", "uri"],
72 "thr-parent-id" => ["post-user", "thr-parent-id"],
73 "conversation" => ["conversation-item-uri", "uri"],
74 "conversation-id" => ["post-thread-user", "conversation-id"],
75 "quote-uri" => ["quote-item-uri", "uri"],
76 "quote-uri-id" => ["post-content", "quote-uri-id"],
77 "guid" => ["item-uri", "guid"],
78 "wall" => ["post-user", "wall"],
79 "gravity" => ["post-user", "gravity"],
80 "extid" => ["external-item-uri", "uri"],
81 "external-id" => ["post-user", "external-id"],
82 "created" => ["post-user", "created"],
83 "edited" => ["post-user", "edited"],
84 "commented" => ["post-thread-user", "commented"],
85 "received" => ["post-user", "received"],
86 "changed" => ["post-thread-user", "changed"],
87 "post-type" => ["post-user", "post-type"],
88 "post-reason" => ["post-user", "post-reason"],
89 "private" => ["post-user", "private"],
90 "pubmail" => ["post-thread-user", "pubmail"],
91 "visible" => ["post-user", "visible"],
92 "starred" => ["post-thread-user", "starred"],
93 "unseen" => ["post-user", "unseen"],
94 "deleted" => ["post-user", "deleted"],
95 "origin" => ["post-user", "origin"],
96 "parent-origin" => ["post-thread-user", "origin"],
97 "mention" => ["post-thread-user", "mention"],
98 "global" => ["post-user", "global"],
99 "featured" => "EXISTS(SELECT `type` FROM `post-collection` WHERE `type` = 0 AND `uri-id` = `post-user`.`uri-id`)",
100 "network" => ["post-user", "network"],
101 "protocol" => ["post-user", "protocol"],
102 "vid" => ["post-user", "vid"],
103 "psid" => ["post-user", "psid"],
104 "verb" => "IF (`post-user`.`vid` IS NULL, '', `verb`.`name`)",
105 "title" => ["post-content", "title"],
106 "content-warning" => ["post-content", "content-warning"],
107 "raw-body" => ["post-content", "raw-body"],
108 "body" => "IFNULL (`post-content`.`body`, '')",
109 "rendered-hash" => ["post-content", "rendered-hash"],
110 "rendered-html" => ["post-content", "rendered-html"],
111 "language" => ["post-content", "language"],
112 "plink" => ["post-content", "plink"],
113 "location" => ["post-content", "location"],
114 "coord" => ["post-content", "coord"],
115 "app" => ["post-content", "app"],
116 "object-type" => ["post-content", "object-type"],
117 "object" => ["post-content", "object"],
118 "target-type" => ["post-content", "target-type"],
119 "target" => ["post-content", "target"],
120 "resource-id" => ["post-content", "resource-id"],
121 "contact-id" => ["post-user", "contact-id"],
122 "contact-uri-id" => ["contact", "uri-id"],
123 "contact-link" => ["contact", "url"],
124 "contact-addr" => ["contact", "addr"],
125 "contact-name" => ["contact", "name"],
126 "contact-nick" => ["contact", "nick"],
127 "contact-avatar" => ["contact", "thumb"],
128 "contact-network" => ["contact", "network"],
129 "contact-blocked" => ["contact", "blocked"],
130 "contact-hidden" => ["contact", "hidden"],
131 "contact-readonly" => ["contact", "readonly"],
132 "contact-archive" => ["contact", "archive"],
133 "contact-pending" => ["contact", "pending"],
134 "contact-rel" => ["contact", "rel"],
135 "contact-uid" => ["contact", "uid"],
136 "contact-contact-type" => ["contact", "contact-type"],
137 "writable" => "IF (`post-user`.`network` IN ('apub', 'dfrn', 'dspr', 'stat'), true, `contact`.`writable`)",
138 "self" => ["contact", "self"],
139 "cid" => ["contact", "id"],
140 "alias" => ["contact", "alias"],
141 "photo" => ["contact", "photo"],
142 "name-date" => ["contact", "name-date"],
143 "uri-date" => ["contact", "uri-date"],
144 "avatar-date" => ["contact", "avatar-date"],
145 "thumb" => ["contact", "thumb"],
146 "author-id" => ["post-user", "author-id"],
147 "author-uri-id" => ["author", "uri-id"],
148 "author-link" => ["author", "url"],
149 "author-addr" => ["author", "addr"],
150 "author-name" => "IF (`contact`.`url` = `author`.`url` AND `contact`.`name` != '', `contact`.`name`, `author`.`name`)",
151 "author-nick" => ["author", "nick"],
152 "author-avatar" => "IF (`contact`.`url` = `author`.`url` AND `contact`.`thumb` != '', `contact`.`thumb`, `author`.`thumb`)",
153 "author-network" => ["author", "network"],
154 "author-blocked" => ["author", "blocked"],
155 "author-hidden" => ["author", "hidden"],
156 "author-updated" => ["author", "updated"],
157 "author-gsid" => ["author", "gsid"],
158 "author-uri-id" => ["author", "uri-id"],
159 "owner-id" => ["post-user", "owner-id"],
160 "owner-uri-id" => ["owner", "uri-id"],
161 "owner-link" => ["owner", "url"],
162 "owner-addr" => ["owner", "addr"],
163 "owner-name" => "IF (`contact`.`url` = `owner`.`url` AND `contact`.`name` != '', `contact`.`name`, `owner`.`name`)",
164 "owner-nick" => ["owner", "nick"],
165 "owner-avatar" => "IF (`contact`.`url` = `owner`.`url` AND `contact`.`thumb` != '', `contact`.`thumb`, `owner`.`thumb`)",
166 "owner-network" => ["owner", "network"],
167 "owner-blocked" => ["owner", "blocked"],
168 "owner-hidden" => ["owner", "hidden"],
169 "owner-updated" => ["owner", "updated"],
170 "owner-contact-type" => ["owner", "contact-type"],
171 "causer-id" => ["post-user", "causer-id"],
172 "causer-uri-id" => ["causer", "uri-id"],
173 "causer-link" => ["causer", "url"],
174 "causer-addr" => ["causer", "addr"],
175 "causer-name" => ["causer", "name"],
176 "causer-nick" => ["causer", "nick"],
177 "causer-avatar" => ["causer", "thumb"],
178 "causer-network" => ["causer", "network"],
179 "causer-blocked" => ["causer", "blocked"],
180 "causer-hidden" => ["causer", "hidden"],
181 "causer-contact-type" => ["causer", "contact-type"],
182 "postopts" => ["post-delivery-data", "postopts"],
183 "inform" => ["post-delivery-data", "inform"],
184 "delivery_queue_count" => ["post-delivery-data", "queue_count"],
185 "delivery_queue_done" => ["post-delivery-data", "queue_done"],
186 "delivery_queue_failed" => ["post-delivery-data", "queue_failed"],
187 "allow_cid" => "IF (`post-user`.`psid` IS NULL, '', `permissionset`.`allow_cid`)",
188 "allow_gid" => "IF (`post-user`.`psid` IS NULL, '', `permissionset`.`allow_gid`)",
189 "deny_cid" => "IF (`post-user`.`psid` IS NULL, '', `permissionset`.`deny_cid`)",
190 "deny_gid" => "IF (`post-user`.`psid` IS NULL, '', `permissionset`.`deny_gid`)",
191 "event-id" => ["post-user", "event-id"],
192 "event-created" => ["event", "created"],
193 "event-edited" => ["event", "edited"],
194 "event-start" => ["event", "start"],
195 "event-finish" => ["event", "finish"],
196 "event-summary" => ["event", "summary"],
197 "event-desc" => ["event", "desc"],
198 "event-location" => ["event", "location"],
199 "event-type" => ["event", "type"],
200 "event-nofinish" => ["event", "nofinish"],
201 "event-ignore" => ["event", "ignore"],
202 "question-id" => ["post-question", "id"],
203 "question-multiple" => ["post-question", "multiple"],
204 "question-voters" => ["post-question", "voters"],
205 "question-end-time" => ["post-question", "end-time"],
206 "has-categories" => "EXISTS(SELECT `uri-id` FROM `post-category` WHERE `post-category`.`uri-id` = `post-user`.`uri-id` AND `post-category`.`uid` = `post-user`.`uid`)",
207 "has-media" => "EXISTS(SELECT `id` FROM `post-media` WHERE `post-media`.`uri-id` = `post-user`.`uri-id`)",
208 "signed_text" => ["diaspora-interaction", "interaction"],
209 "parent-guid" => ["parent-item-uri", "guid"],
210 "parent-network" => ["parent-post", "network"],
211 "parent-author-id" => ["parent-post", "author-id"],
212 "parent-author-link" => ["parent-post-author", "url"],
213 "parent-author-name" => ["parent-post-author", "name"],
214 "parent-author-nick" => ["parent-post-author", "nick"],
215 "parent-author-network" => ["parent-post-author", "network"],
217 "query" => "FROM `post-user`
218 STRAIGHT_JOIN `post-thread-user` ON `post-thread-user`.`uri-id` = `post-user`.`parent-uri-id` AND `post-thread-user`.`uid` = `post-user`.`uid`
219 STRAIGHT_JOIN `contact` ON `contact`.`id` = `post-user`.`contact-id`
220 STRAIGHT_JOIN `contact` AS `author` ON `author`.`id` = `post-user`.`author-id`
221 STRAIGHT_JOIN `contact` AS `owner` ON `owner`.`id` = `post-user`.`owner-id`
222 LEFT JOIN `contact` AS `causer` ON `causer`.`id` = `post-user`.`causer-id`
223 LEFT JOIN `item-uri` ON `item-uri`.`id` = `post-user`.`uri-id`
224 LEFT JOIN `item-uri` AS `thr-parent-item-uri` ON `thr-parent-item-uri`.`id` = `post-user`.`thr-parent-id`
225 LEFT JOIN `item-uri` AS `parent-item-uri` ON `parent-item-uri`.`id` = `post-user`.`parent-uri-id`
226 LEFT JOIN `item-uri` AS `conversation-item-uri` ON `conversation-item-uri`.`id` = `post-thread-user`.`conversation-id`
227 LEFT JOIN `item-uri` AS `external-item-uri` ON `external-item-uri`.`id` = `post-user`.`external-id`
228 LEFT JOIN `verb` ON `verb`.`id` = `post-user`.`vid`
229 LEFT JOIN `event` ON `event`.`id` = `post-user`.`event-id`
230 LEFT JOIN `diaspora-interaction` ON `diaspora-interaction`.`uri-id` = `post-user`.`uri-id`
231 LEFT JOIN `post-content` ON `post-content`.`uri-id` = `post-user`.`uri-id`
232 LEFT JOIN `item-uri` AS `quote-item-uri` ON `quote-item-uri`.`id` = `post-content`.`quote-uri-id`
233 LEFT JOIN `post-delivery-data` ON `post-delivery-data`.`uri-id` = `post-user`.`uri-id` AND `post-user`.`origin`
234 LEFT JOIN `post-question` ON `post-question`.`uri-id` = `post-user`.`uri-id`
235 LEFT JOIN `permissionset` ON `permissionset`.`id` = `post-user`.`psid`
236 LEFT JOIN `post-user` AS `parent-post` ON `parent-post`.`uri-id` = `post-user`.`parent-uri-id` AND `parent-post`.`uid` = `post-user`.`uid`
237 LEFT JOIN `contact` AS `parent-post-author` ON `parent-post-author`.`id` = `parent-post`.`author-id`"
239 "post-thread-user-view" => [
241 "id" => ["post-user", "id"],
242 "post-user-id" => ["post-user", "id"],
243 "uid" => ["post-thread-user", "uid"],
244 "parent" => ["parent-post", "id"],
245 "uri" => ["item-uri", "uri"],
246 "uri-id" => ["post-thread-user", "uri-id"],
247 "parent-uri" => ["parent-item-uri", "uri"],
248 "parent-uri-id" => ["post-user", "parent-uri-id"],
249 "thr-parent" => ["thr-parent-item-uri", "uri"],
250 "thr-parent-id" => ["post-user", "thr-parent-id"],
251 "conversation" => ["conversation-item-uri", "uri"],
252 "conversation-id" => ["post-thread-user", "conversation-id"],
253 "quote-uri" => ["quote-item-uri", "uri"],
254 "quote-uri-id" => ["post-content", "quote-uri-id"],
255 "guid" => ["item-uri", "guid"],
256 "wall" => ["post-thread-user", "wall"],
257 "gravity" => ["post-user", "gravity"],
258 "extid" => ["external-item-uri", "uri"],
259 "external-id" => ["post-user", "external-id"],
260 "created" => ["post-thread-user", "created"],
261 "edited" => ["post-user", "edited"],
262 "commented" => ["post-thread-user", "commented"],
263 "received" => ["post-thread-user", "received"],
264 "changed" => ["post-thread-user", "changed"],
265 "post-type" => ["post-user", "post-type"],
266 "post-reason" => ["post-user", "post-reason"],
267 "private" => ["post-user", "private"],
268 "pubmail" => ["post-thread-user", "pubmail"],
269 "ignored" => ["post-thread-user", "ignored"],
270 "visible" => ["post-user", "visible"],
271 "starred" => ["post-thread-user", "starred"],
272 "unseen" => ["post-thread-user", "unseen"],
273 "deleted" => ["post-user", "deleted"],
274 "origin" => ["post-thread-user", "origin"],
275 "mention" => ["post-thread-user", "mention"],
276 "global" => ["post-user", "global"],
277 "featured" => "EXISTS(SELECT `type` FROM `post-collection` WHERE `type` = 0 AND `uri-id` = `post-thread-user`.`uri-id`)",
278 "network" => ["post-thread-user", "network"],
279 "vid" => ["post-user", "vid"],
280 "psid" => ["post-thread-user", "psid"],
281 "verb" => "IF (`post-user`.`vid` IS NULL, '', `verb`.`name`)",
282 "title" => ["post-content", "title"],
283 "content-warning" => ["post-content", "content-warning"],
284 "raw-body" => ["post-content", "raw-body"],
285 "body" => ["post-content", "body"],
286 "rendered-hash" => ["post-content", "rendered-hash"],
287 "rendered-html" => ["post-content", "rendered-html"],
288 "language" => ["post-content", "language"],
289 "plink" => ["post-content", "plink"],
290 "location" => ["post-content", "location"],
291 "coord" => ["post-content", "coord"],
292 "app" => ["post-content", "app"],
293 "object-type" => ["post-content", "object-type"],
294 "object" => ["post-content", "object"],
295 "target-type" => ["post-content", "target-type"],
296 "target" => ["post-content", "target"],
297 "resource-id" => ["post-content", "resource-id"],
298 "contact-id" => ["post-thread-user", "contact-id"],
299 "contact-uri-id" => ["contact", "uri-id"],
300 "contact-link" => ["contact", "url"],
301 "contact-addr" => ["contact", "addr"],
302 "contact-name" => ["contact", "name"],
303 "contact-nick" => ["contact", "nick"],
304 "contact-avatar" => ["contact", "thumb"],
305 "contact-network" => ["contact", "network"],
306 "contact-blocked" => ["contact", "blocked"],
307 "contact-hidden" => ["contact", "hidden"],
308 "contact-readonly" => ["contact", "readonly"],
309 "contact-archive" => ["contact", "archive"],
310 "contact-pending" => ["contact", "pending"],
311 "contact-rel" => ["contact", "rel"],
312 "contact-uid" => ["contact", "uid"],
313 "contact-contact-type" => ["contact", "contact-type"],
314 "writable" => "IF (`post-user`.`network` IN ('apub', 'dfrn', 'dspr', 'stat'), true, `contact`.`writable`)",
315 "self" => ["contact", "self"],
316 "cid" => ["contact", "id"],
317 "alias" => ["contact", "alias"],
318 "photo" => ["contact", "photo"],
319 "name-date" => ["contact", "name-date"],
320 "uri-date" => ["contact", "uri-date"],
321 "avatar-date" => ["contact", "avatar-date"],
322 "thumb" => ["contact", "thumb"],
323 "author-id" => ["post-thread-user", "author-id"],
324 "author-uri-id" => ["author", "uri-id"],
325 "author-link" => ["author", "url"],
326 "author-addr" => ["author", "addr"],
327 "author-name" => "IF (`contact`.`url` = `author`.`url` AND `contact`.`name` != '', `contact`.`name`, `author`.`name`)",
328 "author-nick" => ["author", "nick"],
329 "author-avatar" => "IF (`contact`.`url` = `author`.`url` AND `contact`.`thumb` != '', `contact`.`thumb`, `author`.`thumb`)",
330 "author-network" => ["author", "network"],
331 "author-blocked" => ["author", "blocked"],
332 "author-hidden" => ["author", "hidden"],
333 "author-updated" => ["author", "updated"],
334 "author-gsid" => ["author", "gsid"],
335 "author-uri-id" => ["author", "uri-id"],
336 "owner-id" => ["post-thread-user", "owner-id"],
337 "owner-uri-id" => ["owner", "uri-id"],
338 "owner-link" => ["owner", "url"],
339 "owner-addr" => ["owner", "addr"],
340 "owner-name" => "IF (`contact`.`url` = `owner`.`url` AND `contact`.`name` != '', `contact`.`name`, `owner`.`name`)",
341 "owner-nick" => ["owner", "nick"],
342 "owner-avatar" => "IF (`contact`.`url` = `owner`.`url` AND `contact`.`thumb` != '', `contact`.`thumb`, `owner`.`thumb`)",
343 "owner-network" => ["owner", "network"],
344 "owner-blocked" => ["owner", "blocked"],
345 "owner-hidden" => ["owner", "hidden"],
346 "owner-updated" => ["owner", "updated"],
347 "owner-contact-type" => ["owner", "contact-type"],
348 "causer-id" => ["post-thread-user", "causer-id"],
349 "causer-uri-id" => ["causer", "uri-id"],
350 "causer-link" => ["causer", "url"],
351 "causer-addr" => ["causer", "addr"],
352 "causer-name" => ["causer", "name"],
353 "causer-nick" => ["causer", "nick"],
354 "causer-avatar" => ["causer", "thumb"],
355 "causer-network" => ["causer", "network"],
356 "causer-blocked" => ["causer", "blocked"],
357 "causer-hidden" => ["causer", "hidden"],
358 "causer-contact-type" => ["causer", "contact-type"],
359 "postopts" => ["post-delivery-data", "postopts"],
360 "inform" => ["post-delivery-data", "inform"],
361 "delivery_queue_count" => ["post-delivery-data", "queue_count"],
362 "delivery_queue_done" => ["post-delivery-data", "queue_done"],
363 "delivery_queue_failed" => ["post-delivery-data", "queue_failed"],
364 "allow_cid" => "IF (`post-thread-user`.`psid` IS NULL, '', `permissionset`.`allow_cid`)",
365 "allow_gid" => "IF (`post-thread-user`.`psid` IS NULL, '', `permissionset`.`allow_gid`)",
366 "deny_cid" => "IF (`post-thread-user`.`psid` IS NULL, '', `permissionset`.`deny_cid`)",
367 "deny_gid" => "IF (`post-thread-user`.`psid` IS NULL, '', `permissionset`.`deny_gid`)",
368 "event-id" => ["post-user", "event-id"],
369 "event-created" => ["event", "created"],
370 "event-edited" => ["event", "edited"],
371 "event-start" => ["event", "start"],
372 "event-finish" => ["event", "finish"],
373 "event-summary" => ["event", "summary"],
374 "event-desc" => ["event", "desc"],
375 "event-location" => ["event", "location"],
376 "event-type" => ["event", "type"],
377 "event-nofinish" => ["event", "nofinish"],
378 "event-ignore" => ["event", "ignore"],
379 "question-id" => ["post-question", "id"],
380 "question-multiple" => ["post-question", "multiple"],
381 "question-voters" => ["post-question", "voters"],
382 "question-end-time" => ["post-question", "end-time"],
383 "has-categories" => "EXISTS(SELECT `uri-id` FROM `post-category` WHERE `post-category`.`uri-id` = `post-thread-user`.`uri-id` AND `post-category`.`uid` = `post-thread-user`.`uid`)",
384 "has-media" => "EXISTS(SELECT `id` FROM `post-media` WHERE `post-media`.`uri-id` = `post-thread-user`.`uri-id`)",
385 "signed_text" => ["diaspora-interaction", "interaction"],
386 "parent-guid" => ["parent-item-uri", "guid"],
387 "parent-network" => ["parent-post", "network"],
388 "parent-author-id" => ["parent-post", "author-id"],
389 "parent-author-link" => ["parent-post-author", "url"],
390 "parent-author-name" => ["parent-post-author", "name"],
391 "parent-author-network" => ["parent-post-author", "network"],
393 "query" => "FROM `post-thread-user`
394 INNER JOIN `post-user` ON `post-user`.`id` = `post-thread-user`.`post-user-id`
395 STRAIGHT_JOIN `contact` ON `contact`.`id` = `post-thread-user`.`contact-id`
396 STRAIGHT_JOIN `contact` AS `author` ON `author`.`id` = `post-thread-user`.`author-id`
397 STRAIGHT_JOIN `contact` AS `owner` ON `owner`.`id` = `post-thread-user`.`owner-id`
398 LEFT JOIN `contact` AS `causer` ON `causer`.`id` = `post-thread-user`.`causer-id`
399 LEFT JOIN `item-uri` ON `item-uri`.`id` = `post-thread-user`.`uri-id`
400 LEFT JOIN `item-uri` AS `thr-parent-item-uri` ON `thr-parent-item-uri`.`id` = `post-user`.`thr-parent-id`
401 LEFT JOIN `item-uri` AS `parent-item-uri` ON `parent-item-uri`.`id` = `post-user`.`parent-uri-id`
402 LEFT JOIN `item-uri` AS `conversation-item-uri` ON `conversation-item-uri`.`id` = `post-thread-user`.`conversation-id`
403 LEFT JOIN `item-uri` AS `external-item-uri` ON `external-item-uri`.`id` = `post-user`.`external-id`
404 LEFT JOIN `verb` ON `verb`.`id` = `post-user`.`vid`
405 LEFT JOIN `event` ON `event`.`id` = `post-user`.`event-id`
406 LEFT JOIN `diaspora-interaction` ON `diaspora-interaction`.`uri-id` = `post-thread-user`.`uri-id`
407 LEFT JOIN `post-content` ON `post-content`.`uri-id` = `post-thread-user`.`uri-id`
408 LEFT JOIN `item-uri` AS `quote-item-uri` ON `quote-item-uri`.`id` = `post-content`.`quote-uri-id`
409 LEFT JOIN `post-delivery-data` ON `post-delivery-data`.`uri-id` = `post-thread-user`.`uri-id` AND `post-thread-user`.`origin`
410 LEFT JOIN `post-question` ON `post-question`.`uri-id` = `post-thread-user`.`uri-id`
411 LEFT JOIN `permissionset` ON `permissionset`.`id` = `post-thread-user`.`psid`
412 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`
413 LEFT JOIN `contact` AS `parent-post-author` ON `parent-post-author`.`id` = `parent-post`.`author-id`"
417 "uri" => ["item-uri", "uri"],
418 "uri-id" => ["post", "uri-id"],
419 "parent-uri" => ["parent-item-uri", "uri"],
420 "parent-uri-id" => ["post", "parent-uri-id"],
421 "thr-parent" => ["thr-parent-item-uri", "uri"],
422 "thr-parent-id" => ["post", "thr-parent-id"],
423 "conversation" => ["conversation-item-uri", "uri"],
424 "conversation-id" => ["post-thread", "conversation-id"],
425 "quote-uri" => ["quote-item-uri", "uri"],
426 "quote-uri-id" => ["post-content", "quote-uri-id"],
427 "guid" => ["item-uri", "guid"],
428 "gravity" => ["post", "gravity"],
429 "extid" => ["external-item-uri", "uri"],
430 "external-id" => ["post", "external-id"],
431 "created" => ["post", "created"],
432 "edited" => ["post", "edited"],
433 "commented" => ["post-thread", "commented"],
434 "received" => ["post", "received"],
435 "changed" => ["post-thread", "changed"],
436 "post-type" => ["post", "post-type"],
437 "private" => ["post", "private"],
438 "visible" => ["post", "visible"],
439 "deleted" => ["post", "deleted"],
440 "global" => ["post", "global"],
441 "featured" => "EXISTS(SELECT `type` FROM `post-collection` WHERE `type` = 0 AND `uri-id` = `post`.`uri-id`)",
442 "network" => ["post", "network"],
443 "vid" => ["post", "vid"],
444 "verb" => "IF (`post`.`vid` IS NULL, '', `verb`.`name`)",
445 "title" => ["post-content", "title"],
446 "content-warning" => ["post-content", "content-warning"],
447 "raw-body" => ["post-content", "raw-body"],
448 "body" => ["post-content", "body"],
449 "rendered-hash" => ["post-content", "rendered-hash"],
450 "rendered-html" => ["post-content", "rendered-html"],
451 "language" => ["post-content", "language"],
452 "plink" => ["post-content", "plink"],
453 "location" => ["post-content", "location"],
454 "coord" => ["post-content", "coord"],
455 "app" => ["post-content", "app"],
456 "object-type" => ["post-content", "object-type"],
457 "object" => ["post-content", "object"],
458 "target-type" => ["post-content", "target-type"],
459 "target" => ["post-content", "target"],
460 "resource-id" => ["post-content", "resource-id"],
461 "contact-id" => ["post", "author-id"],
462 "contact-uri-id" => ["author", "uri-id"],
463 "contact-link" => ["author", "url"],
464 "contact-addr" => ["author", "addr"],
465 "contact-name" => ["author", "name"],
466 "contact-nick" => ["author", "nick"],
467 "contact-avatar" => ["author", "thumb"],
468 "contact-network" => ["author", "network"],
469 "contact-blocked" => ["author", "blocked"],
470 "contact-hidden" => ["author", "hidden"],
471 "contact-readonly" => ["author", "readonly"],
472 "contact-archive" => ["author", "archive"],
473 "contact-pending" => ["author", "pending"],
474 "contact-rel" => ["author", "rel"],
475 "contact-uid" => ["author", "uid"],
476 "contact-contact-type" => ["author", "contact-type"],
477 "writable" => "IF (`post`.`network` IN ('apub', 'dfrn', 'dspr', 'stat'), true, `author`.`writable`)",
479 "cid" => ["author", "id"],
480 "alias" => ["author", "alias"],
481 "photo" => ["author", "photo"],
482 "name-date" => ["author", "name-date"],
483 "uri-date" => ["author", "uri-date"],
484 "avatar-date" => ["author", "avatar-date"],
485 "thumb" => ["author", "thumb"],
486 "author-id" => ["post", "author-id"],
487 "author-uri-id" => ["author", "uri-id"],
488 "author-link" => ["author", "url"],
489 "author-addr" => ["author", "addr"],
490 "author-name" => ["author", "name"],
491 "author-nick" => ["author", "nick"],
492 "author-avatar" => ["author", "thumb"],
493 "author-network" => ["author", "network"],
494 "author-blocked" => ["author", "blocked"],
495 "author-hidden" => ["author", "hidden"],
496 "author-updated" => ["author", "updated"],
497 "author-gsid" => ["author", "gsid"],
498 "author-uri-id" => ["author", "uri-id"],
499 "owner-id" => ["post", "owner-id"],
500 "owner-uri-id" => ["owner", "uri-id"],
501 "owner-link" => ["owner", "url"],
502 "owner-addr" => ["owner", "addr"],
503 "owner-name" => ["owner", "name"],
504 "owner-nick" => ["owner", "nick"],
505 "owner-avatar" => ["owner", "thumb"],
506 "owner-network" => ["owner", "network"],
507 "owner-blocked" => ["owner", "blocked"],
508 "owner-hidden" => ["owner", "hidden"],
509 "owner-updated" => ["owner", "updated"],
510 "owner-contact-type" => ["owner", "contact-type"],
511 "causer-id" => ["post", "causer-id"],
512 "causer-uri-id" => ["causer", "uri-id"],
513 "causer-link" => ["causer", "url"],
514 "causer-addr" => ["causer", "addr"],
515 "causer-name" => ["causer", "name"],
516 "causer-nick" => ["causer", "nick"],
517 "causer-avatar" => ["causer", "thumb"],
518 "causer-network" => ["causer", "network"],
519 "causer-blocked" => ["causer", "blocked"],
520 "causer-hidden" => ["causer", "hidden"],
521 "causer-contact-type" => ["causer", "contact-type"],
522 "question-id" => ["post-question", "id"],
523 "question-multiple" => ["post-question", "multiple"],
524 "question-voters" => ["post-question", "voters"],
525 "question-end-time" => ["post-question", "end-time"],
526 "has-categories" => "0",
527 "has-media" => "EXISTS(SELECT `id` FROM `post-media` WHERE `post-media`.`uri-id` = `post`.`uri-id`)",
528 "signed_text" => ["diaspora-interaction", "interaction"],
529 "parent-guid" => ["parent-item-uri", "guid"],
530 "parent-network" => ["parent-post", "network"],
531 "parent-author-id" => ["parent-post", "author-id"],
532 "parent-author-link" => ["parent-post-author", "url"],
533 "parent-author-name" => ["parent-post-author", "name"],
534 "parent-author-network" => ["parent-post-author", "network"],
536 "query" => "FROM `post`
537 STRAIGHT_JOIN `post-thread` ON `post-thread`.`uri-id` = `post`.`parent-uri-id`
538 STRAIGHT_JOIN `contact` AS `author` ON `author`.`id` = `post`.`author-id`
539 STRAIGHT_JOIN `contact` AS `owner` ON `owner`.`id` = `post`.`owner-id`
540 LEFT JOIN `contact` AS `causer` ON `causer`.`id` = `post`.`causer-id`
541 LEFT JOIN `item-uri` ON `item-uri`.`id` = `post`.`uri-id`
542 LEFT JOIN `item-uri` AS `thr-parent-item-uri` ON `thr-parent-item-uri`.`id` = `post`.`thr-parent-id`
543 LEFT JOIN `item-uri` AS `parent-item-uri` ON `parent-item-uri`.`id` = `post`.`parent-uri-id`
544 LEFT JOIN `item-uri` AS `conversation-item-uri` ON `conversation-item-uri`.`id` = `post-thread`.`conversation-id`
545 LEFT JOIN `item-uri` AS `external-item-uri` ON `external-item-uri`.`id` = `post`.`external-id`
546 LEFT JOIN `verb` ON `verb`.`id` = `post`.`vid`
547 LEFT JOIN `diaspora-interaction` ON `diaspora-interaction`.`uri-id` = `post`.`uri-id`
548 LEFT JOIN `post-content` ON `post-content`.`uri-id` = `post`.`uri-id`
549 LEFT JOIN `item-uri` AS `quote-item-uri` ON `quote-item-uri`.`id` = `post-content`.`quote-uri-id`
550 LEFT JOIN `post-question` ON `post-question`.`uri-id` = `post`.`uri-id`
551 LEFT JOIN `post` AS `parent-post` ON `parent-post`.`uri-id` = `post`.`parent-uri-id`
552 LEFT JOIN `contact` AS `parent-post-author` ON `parent-post-author`.`id` = `parent-post`.`author-id`"
554 "post-thread-view" => [
556 "uri" => ["item-uri", "uri"],
557 "uri-id" => ["post-thread", "uri-id"],
558 "parent-uri" => ["parent-item-uri", "uri"],
559 "parent-uri-id" => ["post", "parent-uri-id"],
560 "thr-parent" => ["thr-parent-item-uri", "uri"],
561 "thr-parent-id" => ["post", "thr-parent-id"],
562 "conversation" => ["conversation-item-uri", "uri"],
563 "conversation-id" => ["post-thread", "conversation-id"],
564 "quote-uri" => ["quote-item-uri", "uri"],
565 "quote-uri-id" => ["post-content", "quote-uri-id"],
566 "guid" => ["item-uri", "guid"],
567 "gravity" => ["post", "gravity"],
568 "extid" => ["external-item-uri", "uri"],
569 "external-id" => ["post", "external-id"],
570 "created" => ["post-thread", "created"],
571 "edited" => ["post", "edited"],
572 "commented" => ["post-thread", "commented"],
573 "received" => ["post-thread", "received"],
574 "changed" => ["post-thread", "changed"],
575 "post-type" => ["post", "post-type"],
576 "private" => ["post", "private"],
577 "visible" => ["post", "visible"],
578 "deleted" => ["post", "deleted"],
579 "global" => ["post", "global"],
580 "featured" => "EXISTS(SELECT `type` FROM `post-collection` WHERE `type` = 0 AND `uri-id` = `post-thread`.`uri-id`)",
581 "network" => ["post-thread", "network"],
582 "vid" => ["post", "vid"],
583 "verb" => "IF (`post`.`vid` IS NULL, '', `verb`.`name`)",
584 "title" => ["post-content", "title"],
585 "content-warning" => ["post-content", "content-warning"],
586 "raw-body" => ["post-content", "raw-body"],
587 "body" => ["post-content", "body"],
588 "rendered-hash" => ["post-content", "rendered-hash"],
589 "rendered-html" => ["post-content", "rendered-html"],
590 "language" => ["post-content", "language"],
591 "plink" => ["post-content", "plink"],
592 "location" => ["post-content", "location"],
593 "coord" => ["post-content", "coord"],
594 "app" => ["post-content", "app"],
595 "object-type" => ["post-content", "object-type"],
596 "object" => ["post-content", "object"],
597 "target-type" => ["post-content", "target-type"],
598 "target" => ["post-content", "target"],
599 "resource-id" => ["post-content", "resource-id"],
600 "contact-id" => ["post-thread", "author-id"],
601 "contact-uri-id" => ["author", "uri-id"],
602 "contact-link" => ["author", "url"],
603 "contact-addr" => ["author", "addr"],
604 "contact-name" => ["author", "name"],
605 "contact-nick" => ["author", "nick"],
606 "contact-avatar" => ["author", "thumb"],
607 "contact-network" => ["author", "network"],
608 "contact-blocked" => ["author", "blocked"],
609 "contact-hidden" => ["author", "hidden"],
610 "contact-readonly" => ["author", "readonly"],
611 "contact-archive" => ["author", "archive"],
612 "contact-pending" => ["author", "pending"],
613 "contact-rel" => ["author", "rel"],
614 "contact-uid" => ["author", "uid"],
615 "contact-contact-type" => ["author", "contact-type"],
616 "writable" => "IF (`post`.`network` IN ('apub', 'dfrn', 'dspr', 'stat'), true, `author`.`writable`)",
618 "cid" => ["author", "id"],
619 "alias" => ["author", "alias"],
620 "photo" => ["author", "photo"],
621 "name-date" => ["author", "name-date"],
622 "uri-date" => ["author", "uri-date"],
623 "avatar-date" => ["author", "avatar-date"],
624 "thumb" => ["author", "thumb"],
625 "author-id" => ["post-thread", "author-id"],
626 "author-uri-id" => ["author", "uri-id"],
627 "author-link" => ["author", "url"],
628 "author-addr" => ["author", "addr"],
629 "author-name" => ["author", "name"],
630 "author-nick" => ["author", "nick"],
631 "author-avatar" => ["author", "thumb"],
632 "author-network" => ["author", "network"],
633 "author-blocked" => ["author", "blocked"],
634 "author-hidden" => ["author", "hidden"],
635 "author-updated" => ["author", "updated"],
636 "author-gsid" => ["author", "gsid"],
637 "author-uri-id" => ["author", "uri-id"],
638 "owner-id" => ["post-thread", "owner-id"],
639 "owner-uri-id" => ["owner", "uri-id"],
640 "owner-link" => ["owner", "url"],
641 "owner-addr" => ["owner", "addr"],
642 "owner-name" => ["owner", "name"],
643 "owner-nick" => ["owner", "nick"],
644 "owner-avatar" => ["owner", "thumb"],
645 "owner-network" => ["owner", "network"],
646 "owner-blocked" => ["owner", "blocked"],
647 "owner-hidden" => ["owner", "hidden"],
648 "owner-updated" => ["owner", "updated"],
649 "owner-contact-type" => ["owner", "contact-type"],
650 "causer-id" => ["post-thread", "causer-id"],
651 "causer-uri-id" => ["causer", "uri-id"],
652 "causer-link" => ["causer", "url"],
653 "causer-addr" => ["causer", "addr"],
654 "causer-name" => ["causer", "name"],
655 "causer-nick" => ["causer", "nick"],
656 "causer-avatar" => ["causer", "thumb"],
657 "causer-network" => ["causer", "network"],
658 "causer-blocked" => ["causer", "blocked"],
659 "causer-hidden" => ["causer", "hidden"],
660 "causer-contact-type" => ["causer", "contact-type"],
661 "question-id" => ["post-question", "id"],
662 "question-multiple" => ["post-question", "multiple"],
663 "question-voters" => ["post-question", "voters"],
664 "question-end-time" => ["post-question", "end-time"],
665 "has-categories" => "0",
666 "has-media" => "EXISTS(SELECT `id` FROM `post-media` WHERE `post-media`.`uri-id` = `post-thread`.`uri-id`)",
667 "total-comments" => "(SELECT COUNT(*) FROM `post` WHERE `parent-uri-id` = `post-thread`.`uri-id` AND `gravity` = 6)",
668 "total-actors" => "(SELECT COUNT(DISTINCT(`author-id`)) FROM `post` WHERE `parent-uri-id` = `post-thread`.`uri-id` AND `gravity` = 6)",
669 "signed_text" => ["diaspora-interaction", "interaction"],
670 "parent-guid" => ["parent-item-uri", "guid"],
671 "parent-network" => ["parent-post", "network"],
672 "parent-author-id" => ["parent-post", "author-id"],
673 "parent-author-link" => ["parent-post-author", "url"],
674 "parent-author-name" => ["parent-post-author", "name"],
675 "parent-author-network" => ["parent-post-author", "network"],
677 "query" => "FROM `post-thread`
678 INNER JOIN `post` ON `post`.`uri-id` = `post-thread`.`uri-id`
679 STRAIGHT_JOIN `contact` AS `author` ON `author`.`id` = `post-thread`.`author-id`
680 STRAIGHT_JOIN `contact` AS `owner` ON `owner`.`id` = `post-thread`.`owner-id`
681 LEFT JOIN `contact` AS `causer` ON `causer`.`id` = `post-thread`.`causer-id`
682 LEFT JOIN `item-uri` ON `item-uri`.`id` = `post-thread`.`uri-id`
683 LEFT JOIN `item-uri` AS `thr-parent-item-uri` ON `thr-parent-item-uri`.`id` = `post`.`thr-parent-id`
684 LEFT JOIN `item-uri` AS `parent-item-uri` ON `parent-item-uri`.`id` = `post`.`parent-uri-id`
685 LEFT JOIN `item-uri` AS `conversation-item-uri` ON `conversation-item-uri`.`id` = `post-thread`.`conversation-id`
686 LEFT JOIN `item-uri` AS `external-item-uri` ON `external-item-uri`.`id` = `post`.`external-id`
687 LEFT JOIN `verb` ON `verb`.`id` = `post`.`vid`
688 LEFT JOIN `diaspora-interaction` ON `diaspora-interaction`.`uri-id` = `post-thread`.`uri-id`
689 LEFT JOIN `post-content` ON `post-content`.`uri-id` = `post-thread`.`uri-id`
690 LEFT JOIN `item-uri` AS `quote-item-uri` ON `quote-item-uri`.`id` = `post-content`.`quote-uri-id`
691 LEFT JOIN `post-question` ON `post-question`.`uri-id` = `post-thread`.`uri-id`
692 LEFT JOIN `post` AS `parent-post` ON `parent-post`.`uri-id` = `post`.`parent-uri-id`
693 LEFT JOIN `contact` AS `parent-post-author` ON `parent-post-author`.`id` = `parent-post`.`author-id`"
697 "uri-id" => ["post-category", "uri-id"],
698 "uid" => ["post-category", "uid"],
699 "type" => ["post-category", "type"],
700 "tid" => ["post-category", "tid"],
701 "name" => ["tag", "name"],
702 "url" => ["tag", "url"],
704 "query" => "FROM `post-category`
705 LEFT JOIN `tag` ON `post-category`.`tid` = `tag`.`id`"
707 "collection-view" => [
709 "uri-id" => ["post-collection", "uri-id"],
710 "type" => ["post-collection", "type"],
711 "cid" => ["post-collection", "author-id"],
712 "received" => ["post", "received"],
713 "created" => ["post", "created"],
714 "commented" => ["post-thread", "commented"],
715 "private" => ["post", "private"],
716 "visible" => ["post", "visible"],
717 "deleted" => ["post", "deleted"],
718 "thr-parent-id" => ["post", "thr-parent-id"],
719 "author-id" => ["post-collection", "author-id"],
720 "gravity" => ["post", "gravity"],
722 "query" => "FROM `post-collection`
723 INNER JOIN `post` ON `post-collection`.`uri-id` = `post`.`uri-id`
724 INNER JOIN `post-thread` ON `post-thread`.`uri-id` = `post`.`parent-uri-id`"
728 "uri-id" => ["post-media", "uri-id"],
729 "type" => ["post-media", "type"],
730 "received" => ["post", "received"],
731 "created" => ["post", "created"],
732 "private" => ["post", "private"],
733 "visible" => ["post", "visible"],
734 "deleted" => ["post", "deleted"],
735 "thr-parent-id" => ["post", "thr-parent-id"],
736 "author-id" => ["post", "author-id"],
737 "gravity" => ["post", "gravity"],
739 "query" => "FROM `post-media`
740 INNER JOIN `post` ON `post-media`.`uri-id` = `post`.`uri-id`"
744 "uri-id" => ["post-tag", "uri-id"],
745 "type" => ["post-tag", "type"],
746 "tid" => ["post-tag", "tid"],
747 "cid" => ["post-tag", "cid"],
748 "name" => "CASE `cid` WHEN 0 THEN `tag`.`name` ELSE `contact`.`name` END",
749 "url" => "CASE `cid` WHEN 0 THEN `tag`.`url` ELSE `contact`.`url` END",
750 "tag-type" => "CASE `cid` WHEN 0 THEN `tag`.`type` ELSE 1 END",
752 "query" => "FROM `post-tag`
753 LEFT JOIN `tag` ON `post-tag`.`tid` = `tag`.`id`
754 LEFT JOIN `contact` ON `post-tag`.`cid` = `contact`.`id`"
756 "network-item-view" => [
758 "uri-id" => ["post-user", "uri-id"],
759 "parent" => ["parent-post", "id"],
760 "received" => ["post-user", "received"],
761 "commented" => ["post-thread-user", "commented"],
762 "created" => ["post-user", "created"],
763 "uid" => ["post-user", "uid"],
764 "starred" => ["post-thread-user", "starred"],
765 "mention" => ["post-thread-user", "mention"],
766 "network" => ["post-user", "network"],
767 "unseen" => ["post-user", "unseen"],
768 "gravity" => ["post-user", "gravity"],
769 "contact-id" => ["post-user", "contact-id"],
770 "contact-type" => ["ownercontact", "contact-type"],
772 "query" => "FROM `post-user`
773 STRAIGHT_JOIN `post-thread-user` ON `post-thread-user`.`uri-id` = `post-user`.`parent-uri-id` AND `post-thread-user`.`uid` = `post-user`.`uid`
774 INNER JOIN `contact` ON `contact`.`id` = `post-thread-user`.`contact-id`
775 LEFT JOIN `user-contact` AS `author` ON `author`.`uid` = `post-thread-user`.`uid` AND `author`.`cid` = `post-thread-user`.`author-id`
776 LEFT JOIN `user-contact` AS `owner` ON `owner`.`uid` = `post-thread-user`.`uid` AND `owner`.`cid` = `post-thread-user`.`owner-id`
777 INNER JOIN `contact` AS `ownercontact` ON `ownercontact`.`id` = `post-thread-user`.`owner-id`
778 LEFT JOIN `post-user` AS `parent-post` ON `parent-post`.`uri-id` = `post-user`.`parent-uri-id` AND `parent-post`.`uid` = `post-user`.`uid`
779 WHERE `post-user`.`visible` AND NOT `post-user`.`deleted`
780 AND (NOT `contact`.`readonly` AND NOT `contact`.`blocked` AND NOT `contact`.`pending`)
781 AND (`post-user`.`hidden` IS NULL OR NOT `post-user`.`hidden`)
782 AND (`author`.`blocked` IS NULL OR NOT `author`.`blocked`)
783 AND (`owner`.`blocked` IS NULL OR NOT `owner`.`blocked`)"
785 "network-thread-view" => [
787 "uri-id" => ["post-thread-user", "uri-id"],
788 "parent" => ["parent-post", "id"],
789 "received" => ["post-thread-user", "received"],
790 "commented" => ["post-thread-user", "commented"],
791 "created" => ["post-thread-user", "created"],
792 "uid" => ["post-thread-user", "uid"],
793 "starred" => ["post-thread-user", "starred"],
794 "mention" => ["post-thread-user", "mention"],
795 "network" => ["post-thread-user", "network"],
796 "contact-id" => ["post-thread-user", "contact-id"],
797 "contact-type" => ["ownercontact", "contact-type"],
799 "query" => "FROM `post-thread-user`
800 INNER JOIN `post-user` ON `post-user`.`id` = `post-thread-user`.`post-user-id`
801 STRAIGHT_JOIN `contact` ON `contact`.`id` = `post-thread-user`.`contact-id`
802 LEFT JOIN `user-contact` AS `author` ON `author`.`uid` = `post-thread-user`.`uid` AND `author`.`cid` = `post-thread-user`.`author-id`
803 LEFT JOIN `user-contact` AS `owner` ON `owner`.`uid` = `post-thread-user`.`uid` AND `owner`.`cid` = `post-thread-user`.`owner-id`
804 LEFT JOIN `contact` AS `ownercontact` ON `ownercontact`.`id` = `post-thread-user`.`owner-id`
805 LEFT JOIN `post-user` AS `parent-post` ON `parent-post`.`uri-id` = `post-user`.`parent-uri-id` AND `parent-post`.`uid` = `post-user`.`uid`
806 WHERE `post-user`.`visible` AND NOT `post-user`.`deleted`
807 AND (NOT `contact`.`readonly` AND NOT `contact`.`blocked` AND NOT `contact`.`pending`)
808 AND (`post-thread-user`.`hidden` IS NULL OR NOT `post-thread-user`.`hidden`)
809 AND (`author`.`blocked` IS NULL OR NOT `author`.`blocked`)
810 AND (`owner`.`blocked` IS NULL OR NOT `owner`.`blocked`)"
814 "id" => ["contact", "id"],
815 "uid" => ["contact", "uid"],
816 "created" => ["contact", "created"],
817 "updated" => ["contact", "updated"],
818 "self" => ["contact", "self"],
819 "remote_self" => ["contact", "remote_self"],
820 "rel" => ["contact", "rel"],
821 "network" => ["contact", "network"],
822 "protocol" => ["contact", "protocol"],
823 "name" => ["contact", "name"],
824 "nick" => ["contact", "nick"],
825 "location" => ["contact", "location"],
826 "about" => ["contact", "about"],
827 "keywords" => ["contact", "keywords"],
828 "xmpp" => ["contact", "xmpp"],
829 "matrix" => ["contact", "matrix"],
830 "attag" => ["contact", "attag"],
831 "avatar" => ["contact", "avatar"],
832 "photo" => ["contact", "photo"],
833 "thumb" => ["contact", "thumb"],
834 "micro" => ["contact", "micro"],
835 "header" => ["contact", "header"],
836 "url" => ["contact", "url"],
837 "nurl" => ["contact", "nurl"],
838 "uri-id" => ["contact", "uri-id"],
839 "addr" => ["contact", "addr"],
840 "alias" => ["contact", "alias"],
841 "pubkey" => ["contact", "pubkey"],
842 "prvkey" => ["contact", "prvkey"],
843 "batch" => ["contact", "batch"],
844 "request" => ["contact", "request"],
845 "notify" => ["contact", "notify"],
846 "poll" => ["contact", "poll"],
847 "confirm" => ["contact", "confirm"],
848 "poco" => ["contact", "poco"],
849 "subhub" => ["contact", "subhub"],
850 "hub-verify" => ["contact", "hub-verify"],
851 "last-update" => ["contact", "last-update"],
852 "success_update" => ["contact", "success_update"],
853 "failure_update" => ["contact", "failure_update"],
854 "name-date" => ["contact", "name-date"],
855 "uri-date" => ["contact", "uri-date"],
856 "avatar-date" => ["contact", "avatar-date"],
857 "picdate" => ["contact", "avatar-date"], /// @todo Replaces all uses of "picdate" with "avatar-date"
858 "term-date" => ["contact", "term-date"],
859 "last-item" => ["contact", "last-item"],
860 "priority" => ["contact", "priority"],
861 "blocked" => ["user", "blocked"],
862 "block_reason" => ["contact", "block_reason"],
863 "readonly" => ["contact", "readonly"],
864 "writable" => ["contact", "writable"],
865 "forum" => ["contact", "forum"],
866 "prv" => ["contact", "prv"],
867 "contact-type" => ["contact", "contact-type"],
868 "manually-approve" => ["contact", "manually-approve"],
869 "hidden" => ["contact", "hidden"],
870 "archive" => ["contact", "archive"],
871 "pending" => ["contact", "pending"],
872 "deleted" => ["contact", "deleted"],
873 "unsearchable" => ["contact", "unsearchable"],
874 "sensitive" => ["contact", "sensitive"],
875 "baseurl" => ["contact", "baseurl"],
876 "reason" => ["contact", "reason"],
877 "info" => ["contact", "info"],
878 "bdyear" => ["contact", "bdyear"],
879 "bd" => ["contact", "bd"],
880 "notify_new_posts" => ["contact", "notify_new_posts"],
881 "fetch_further_information" => ["contact", "fetch_further_information"],
882 "ffi_keyword_denylist" => ["contact", "ffi_keyword_denylist"],
883 "parent-uid" => ["user", "parent-uid"],
884 "guid" => ["user", "guid"],
885 "nickname" => ["user", "nickname"], /// @todo Replaces all uses of "nickname" with "nick"
886 "email" => ["user", "email"],
887 "openid" => ["user", "openid"],
888 "timezone" => ["user", "timezone"],
889 "language" => ["user", "language"],
890 "register_date" => ["user", "register_date"],
891 "login_date" => ["user", "login_date"],
892 "default-location" => ["user", "default-location"],
893 "allow_location" => ["user", "allow_location"],
894 "theme" => ["user", "theme"],
895 "upubkey" => ["user", "pubkey"],
896 "uprvkey" => ["user", "prvkey"],
897 "sprvkey" => ["user", "sprvkey"],
898 "spubkey" => ["user", "spubkey"],
899 "verified" => ["user", "verified"],
900 "blockwall" => ["user", "blockwall"],
901 "hidewall" => ["user", "hidewall"],
902 "blocktags" => ["user", "blocktags"],
903 "unkmail" => ["user", "unkmail"],
904 "cntunkmail" => ["user", "cntunkmail"],
905 "notify-flags" => ["user", "notify-flags"],
906 "page-flags" => ["user", "page-flags"],
907 "account-type" => ["user", "account-type"],
908 "prvnets" => ["user", "prvnets"],
909 "maxreq" => ["user", "maxreq"],
910 "expire" => ["user", "expire"],
911 "account_removed" => ["user", "account_removed"],
912 "account_expired" => ["user", "account_expired"],
913 "account_expires_on" => ["user", "account_expires_on"],
914 "expire_notification_sent" => ["user", "expire_notification_sent"],
915 "def_gid" => ["user", "def_gid"],
916 "allow_cid" => ["user", "allow_cid"],
917 "allow_gid" => ["user", "allow_gid"],
918 "deny_cid" => ["user", "deny_cid"],
919 "deny_gid" => ["user", "deny_gid"],
920 "openidserver" => ["user", "openidserver"],
921 "publish" => ["profile", "publish"],
922 "net-publish" => ["profile", "net-publish"],
923 "hide-friends" => ["profile", "hide-friends"],
924 "prv_keywords" => ["profile", "prv_keywords"],
925 "pub_keywords" => ["profile", "pub_keywords"],
926 "address" => ["profile", "address"],
927 "locality" => ["profile", "locality"],
928 "region" => ["profile", "region"],
929 "postal-code" => ["profile", "postal-code"],
930 "country-name" => ["profile", "country-name"],
931 "homepage" => ["profile", "homepage"],
932 "homepage_verified" => ["profile", "homepage_verified"],
933 "dob" => ["profile", "dob"],
935 "query" => "FROM `user`
936 INNER JOIN `contact` ON `contact`.`uid` = `user`.`uid` AND `contact`.`self`
937 INNER JOIN `profile` ON `profile`.`uid` = `user`.`uid`"
941 "id" => ["contact", "id"],
942 "url" => ["contact", "url"],
943 "nurl" => ["contact", "nurl"],
944 "uri-id" => ["contact", "uri-id"],
945 "guid" => ["item-uri", "guid"],
946 "addr" => ["contact", "addr"],
947 "alias" => ["contact", "alias"],
948 "name" => ["contact", "name"],
949 "nick" => ["contact", "nick"],
950 "about" => ["contact", "about"],
951 "keywords" => ["contact", "keywords"],
952 "xmpp" => ["contact", "xmpp"],
953 "matrix" => ["contact", "matrix"],
954 "avatar" => ["contact", "avatar"],
955 "photo" => ["contact", "photo"],
956 "thumb" => ["contact", "thumb"],
957 "micro" => ["contact", "micro"],
958 "header" => ["contact", "header"],
959 "created" => ["contact", "created"],
960 "updated" => ["contact", "updated"],
961 "network" => ["contact", "network"],
962 "protocol" => ["contact", "protocol"],
963 "location" => ["contact", "location"],
964 "attag" => ["contact", "attag"],
965 "pubkey" => ["contact", "pubkey"],
966 "prvkey" => ["contact", "prvkey"],
967 "subscribe" => ["contact", "subscribe"],
968 "last-update" => ["contact", "last-update"],
969 "success_update" => ["contact", "success_update"],
970 "failure_update" => ["contact", "failure_update"],
971 "failed" => ["contact", "failed"],
972 "last-item" => ["contact", "last-item"],
973 "last-discovery" => ["contact", "last-discovery"],
974 "contact-type" => ["contact", "contact-type"],
975 "manually-approve" => ["contact", "manually-approve"],
976 "unsearchable" => ["contact", "unsearchable"],
977 "sensitive" => ["contact", "sensitive"],
978 "baseurl" => ["contact", "baseurl"],
979 "gsid" => ["contact", "gsid"],
980 "info" => ["contact", "info"],
981 "bdyear" => ["contact", "bdyear"],
982 "bd" => ["contact", "bd"],
983 "poco" => ["contact", "poco"],
984 "name-date" => ["contact", "name-date"],
985 "uri-date" => ["contact", "uri-date"],
986 "avatar-date" => ["contact", "avatar-date"],
987 "term-date" => ["contact", "term-date"],
988 "global-ignored" => ["contact", "hidden"],
989 "global-blocked" => ["contact", "blocked"],
990 "hidden" => ["contact", "hidden"],
991 "archive" => ["contact", "archive"],
992 "deleted" => ["contact", "deleted"],
993 "blocked" => ["contact", "blocked"],
994 "dfrn-notify" => ["contact", "notify"],
995 "dfrn-poll" => ["contact", "poll"],
996 "diaspora-guid" => ["fcontact", "guid"],
997 "diaspora-batch" => ["fcontact", "batch"],
998 "diaspora-notify" => ["fcontact", "notify"],
999 "diaspora-poll" => ["fcontact", "poll"],
1000 "diaspora-alias" => ["fcontact", "alias"],
1001 "ap-uuid" => ["apcontact", "uuid"],
1002 "ap-type" => ["apcontact", "type"],
1003 "ap-following" => ["apcontact", "following"],
1004 "ap-followers" => ["apcontact", "followers"],
1005 "ap-inbox" => ["apcontact", "inbox"],
1006 "ap-outbox" => ["apcontact", "outbox"],
1007 "ap-sharedinbox" => ["apcontact", "sharedinbox"],
1008 "ap-generator" => ["apcontact", "generator"],
1009 "ap-following_count" => ["apcontact", "following_count"],
1010 "ap-followers_count" => ["apcontact", "followers_count"],
1011 "ap-statuses_count" => ["apcontact", "statuses_count"],
1012 "site_name" => ["gserver", "site_name"],
1013 "platform" => ["gserver", "platform"],
1014 "version" => ["gserver", "version"],
1016 "query" => "FROM `contact`
1017 LEFT JOIN `item-uri` ON `item-uri`.`id` = `contact`.`uri-id`
1018 LEFT JOIN `apcontact` ON `apcontact`.`uri-id` = `contact`.`uri-id`
1019 LEFT JOIN `fcontact` ON `fcontact`.`uri-id` = contact.`uri-id`
1020 LEFT JOIN `gserver` ON `gserver`.`id` = contact.`gsid`
1021 WHERE `contact`.`uid` = 0"
1023 "account-user-view" => [
1025 "id" => ["ucontact", "id"],
1026 "pid" => ["contact", "id"],
1027 "uid" => ["ucontact", "uid"],
1028 "url" => ["contact", "url"],
1029 "nurl" => ["contact", "nurl"],
1030 "uri-id" => ["contact", "uri-id"],
1031 "guid" => ["item-uri", "guid"],
1032 "addr" => ["contact", "addr"],
1033 "alias" => ["contact", "alias"],
1034 "name" => ["contact", "name"],
1035 "nick" => ["contact", "nick"],
1036 "about" => ["contact", "about"],
1037 "keywords" => ["contact", "keywords"],
1038 "xmpp" => ["contact", "xmpp"],
1039 "matrix" => ["contact", "matrix"],
1040 "avatar" => ["contact", "avatar"],
1041 "photo" => ["contact", "photo"],
1042 "thumb" => ["contact", "thumb"],
1043 "micro" => ["contact", "micro"],
1044 "header" => ["contact", "header"],
1045 "created" => ["contact", "created"],
1046 "updated" => ["contact", "updated"],
1047 "self" => ["ucontact", "self"],
1048 "remote_self" => ["ucontact", "remote_self"],
1049 "rel" => ["ucontact", "rel"],
1050 "network" => ["contact", "network"],
1051 "protocol" => ["ucontact", "protocol"],
1052 "location" => ["contact", "location"],
1053 "attag" => ["ucontact", "attag"],
1054 "pubkey" => ["contact", "pubkey"],
1055 "prvkey" => ["contact", "prvkey"],
1056 "subscribe" => ["contact", "subscribe"],
1057 "last-update" => ["contact", "last-update"],
1058 "success_update" => ["contact", "success_update"],
1059 "failure_update" => ["contact", "failure_update"],
1060 "failed" => ["contact", "failed"],
1061 "last-item" => ["contact", "last-item"],
1062 "last-discovery" => ["contact", "last-discovery"],
1063 "contact-type" => ["contact", "contact-type"],
1064 "manually-approve" => ["contact", "manually-approve"],
1065 "unsearchable" => ["contact", "unsearchable"],
1066 "sensitive" => ["contact", "sensitive"],
1067 "baseurl" => ["contact", "baseurl"],
1068 "gsid" => ["contact", "gsid"],
1069 "info" => ["ucontact", "info"],
1070 "bdyear" => ["contact", "bdyear"],
1071 "bd" => ["contact", "bd"],
1072 "poco" => ["contact", "poco"],
1073 "name-date" => ["contact", "name-date"],
1074 "uri-date" => ["contact", "uri-date"],
1075 "avatar-date" => ["contact", "avatar-date"],
1076 "term-date" => ["contact", "term-date"],
1077 "global-ignored" => ["contact", "hidden"],
1078 "global-blocked" => ["contact", "blocked"],
1079 "hidden" => ["ucontact", "hidden"],
1080 "archive" => ["ucontact", "archive"],
1081 "pending" => ["ucontact", "pending"],
1082 "deleted" => ["ucontact", "deleted"],
1083 "notify_new_posts" => ["ucontact", "notify_new_posts"],
1084 "fetch_further_information" => ["ucontact", "fetch_further_information"],
1085 "ffi_keyword_denylist" => ["ucontact", "ffi_keyword_denylist"],
1086 "rating" => ["ucontact", "rating"],
1087 "readonly" => ["ucontact", "readonly"],
1088 "blocked" => ["ucontact", "blocked"],
1089 "block_reason" => ["ucontact", "block_reason"],
1090 "subhub" => ["ucontact", "subhub"],
1091 "hub-verify" => ["ucontact", "hub-verify"],
1092 "reason" => ["ucontact", "reason"],
1093 "dfrn-notify" => ["contact", "notify"],
1094 "dfrn-poll" => ["contact", "poll"],
1095 "diaspora-guid" => ["fcontact", "guid"],
1096 "diaspora-batch" => ["fcontact", "batch"],
1097 "diaspora-notify" => ["fcontact", "notify"],
1098 "diaspora-poll" => ["fcontact", "poll"],
1099 "diaspora-alias" => ["fcontact", "alias"],
1100 "diaspora-interacting_count" => ["fcontact", "interacting_count"],
1101 "diaspora-interacted_count" => ["fcontact", "interacted_count"],
1102 "diaspora-post_count" => ["fcontact", "post_count"],
1103 "ap-uuid" => ["apcontact", "uuid"],
1104 "ap-type" => ["apcontact", "type"],
1105 "ap-following" => ["apcontact", "following"],
1106 "ap-followers" => ["apcontact", "followers"],
1107 "ap-inbox" => ["apcontact", "inbox"],
1108 "ap-outbox" => ["apcontact", "outbox"],
1109 "ap-sharedinbox" => ["apcontact", "sharedinbox"],
1110 "ap-generator" => ["apcontact", "generator"],
1111 "ap-following_count" => ["apcontact", "following_count"],
1112 "ap-followers_count" => ["apcontact", "followers_count"],
1113 "ap-statuses_count" => ["apcontact", "statuses_count"],
1114 "site_name" => ["gserver", "site_name"],
1115 "platform" => ["gserver", "platform"],
1116 "version" => ["gserver", "version"],
1118 "query" => "FROM `contact` AS `ucontact`
1119 INNER JOIN `contact` ON `contact`.`uri-id` = `ucontact`.`uri-id` AND `contact`.`uid` = 0
1120 LEFT JOIN `item-uri` ON `item-uri`.`id` = `ucontact`.`uri-id`
1121 LEFT JOIN `apcontact` ON `apcontact`.`uri-id` = `ucontact`.`uri-id`
1122 LEFT JOIN `fcontact` ON `fcontact`.`uri-id` = `ucontact`.`uri-id` AND `fcontact`.`network` = 'dspr'
1123 LEFT JOIN `gserver` ON `gserver`.`id` = contact.`gsid`"
1127 "id" => ["register", "id"],
1128 "hash" => ["register", "hash"],
1129 "created" => ["register", "created"],
1130 "uid" => ["register", "uid"],
1131 "password" => ["register", "password"],
1132 "language" => ["register", "language"],
1133 "note" => ["register", "note"],
1134 "self" => ["contact", "self"],
1135 "name" => ["contact", "name"],
1136 "url" => ["contact", "url"],
1137 "micro" => ["contact", "micro"],
1138 "email" => ["user", "email"],
1139 "nick" => ["contact", "nick"],
1141 "query" => "FROM `register`
1142 INNER JOIN `contact` ON `register`.`uid` = `contact`.`uid`
1143 INNER JOIN `user` ON `register`.`uid` = `user`.`uid`"
1145 "tag-search-view" => [
1147 "uri-id" => ["post-tag", "uri-id"],
1148 "uid" => ["post-user", "uid"],
1149 "iid" => ["post-user", "id"],
1150 "private" => ["post-user", "private"],
1151 "wall" => ["post-user", "wall"],
1152 "origin" => ["post-user", "origin"],
1153 "global" => ["post-user", "global"],
1154 "gravity" => ["post-user", "gravity"],
1155 "received" => ["post-user", "received"],
1156 "network" => ["post-user", "network"],
1157 "author-id" => ["post-user", "author-id"],
1158 "name" => ["tag", "name"],
1160 "query" => "FROM `post-tag`
1161 INNER JOIN `tag` ON `tag`.`id` = `post-tag`.`tid`
1162 STRAIGHT_JOIN `post-user` ON `post-user`.`uri-id` = `post-tag`.`uri-id`
1163 WHERE `post-tag`.`type` = 1"
1165 "workerqueue-view" => [
1167 "pid" => ["process", "pid"],
1168 "priority" => ["workerqueue", "priority"],
1170 "query" => "FROM `process`
1171 INNER JOIN `workerqueue` ON `workerqueue`.`pid` = `process`.`pid`
1172 WHERE NOT `workerqueue`.`done`"
1174 "profile_field-view" => [
1176 "id" => ["profile_field", "id"],
1177 "uid" => ["profile_field", "uid"],
1178 "label" => ["profile_field", "label"],
1179 "value" => ["profile_field", "value"],
1180 "order" => ["profile_field", "order"],
1181 "psid"=> ["profile_field", "psid"],
1182 "allow_cid" => ["permissionset", "allow_cid"],
1183 "allow_gid" => ["permissionset", "allow_gid"],
1184 "deny_cid" => ["permissionset", "deny_cid"],
1185 "deny_gid" => ["permissionset", "deny_gid"],
1186 "created" => ["profile_field", "created"],
1187 "edited" => ["profile_field", "edited"],
1189 "query" => "FROM `profile_field`
1190 INNER JOIN `permissionset` ON `permissionset`.`id` = `profile_field`.`psid`"