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 "guid" => ["item-uri", "guid"],
74 "wall" => ["post-user", "wall"],
75 "gravity" => ["post-user", "gravity"],
76 "extid" => ["external-item-uri", "uri"],
77 "external-id" => ["post-user", "external-id"],
78 "created" => ["post-user", "created"],
79 "edited" => ["post-user", "edited"],
80 "commented" => ["post-thread-user", "commented"],
81 "received" => ["post-user", "received"],
82 "changed" => ["post-thread-user", "changed"],
83 "post-type" => ["post-user", "post-type"],
84 "post-reason" => ["post-user", "post-reason"],
85 "private" => ["post-user", "private"],
86 "pubmail" => ["post-thread-user", "pubmail"],
87 "visible" => ["post-user", "visible"],
88 "starred" => ["post-thread-user", "starred"],
89 "unseen" => ["post-user", "unseen"],
90 "deleted" => ["post-user", "deleted"],
91 "origin" => ["post-user", "origin"],
92 "parent-origin" => ["post-thread-user", "origin"],
93 "mention" => ["post-thread-user", "mention"],
94 "global" => ["post-user", "global"],
95 "featured" => "EXISTS(SELECT `type` FROM `post-collection` WHERE `type` = 0 AND `uri-id` = `post-user`.`uri-id`)",
96 "network" => ["post-user", "network"],
97 "vid" => ["post-user", "vid"],
98 "psid" => ["post-user", "psid"],
99 "verb" => "IF (`post-user`.`vid` IS NULL, '', `verb`.`name`)",
100 "title" => ["post-content", "title"],
101 "content-warning" => ["post-content", "content-warning"],
102 "raw-body" => ["post-content", "raw-body"],
103 "body" => "IFNULL (`post-content`.`body`, '')",
104 "rendered-hash" => ["post-content", "rendered-hash"],
105 "rendered-html" => ["post-content", "rendered-html"],
106 "language" => ["post-content", "language"],
107 "plink" => ["post-content", "plink"],
108 "location" => ["post-content", "location"],
109 "coord" => ["post-content", "coord"],
110 "app" => ["post-content", "app"],
111 "object-type" => ["post-content", "object-type"],
112 "object" => ["post-content", "object"],
113 "target-type" => ["post-content", "target-type"],
114 "target" => ["post-content", "target"],
115 "resource-id" => ["post-content", "resource-id"],
116 "contact-id" => ["post-user", "contact-id"],
117 "contact-link" => ["contact", "url"],
118 "contact-addr" => ["contact", "addr"],
119 "contact-name" => ["contact", "name"],
120 "contact-nick" => ["contact", "nick"],
121 "contact-avatar" => ["contact", "thumb"],
122 "contact-network" => ["contact", "network"],
123 "contact-blocked" => ["contact", "blocked"],
124 "contact-hidden" => ["contact", "hidden"],
125 "contact-readonly" => ["contact", "readonly"],
126 "contact-archive" => ["contact", "archive"],
127 "contact-pending" => ["contact", "pending"],
128 "contact-rel" => ["contact", "rel"],
129 "contact-uid" => ["contact", "uid"],
130 "contact-contact-type" => ["contact", "contact-type"],
131 "writable" => "IF (`post-user`.`network` IN ('apub', 'dfrn', 'dspr', 'stat'), true, `contact`.`writable`)",
132 "self" => ["contact", "self"],
133 "cid" => ["contact", "id"],
134 "alias" => ["contact", "alias"],
135 "photo" => ["contact", "photo"],
136 "name-date" => ["contact", "name-date"],
137 "uri-date" => ["contact", "uri-date"],
138 "avatar-date" => ["contact", "avatar-date"],
139 "thumb" => ["contact", "thumb"],
140 "author-id" => ["post-user", "author-id"],
141 "author-link" => ["author", "url"],
142 "author-addr" => ["author", "addr"],
143 "author-name" => "IF (`contact`.`url` = `author`.`url` AND `contact`.`name` != '', `contact`.`name`, `author`.`name`)",
144 "author-nick" => ["author", "nick"],
145 "author-avatar" => "IF (`contact`.`url` = `author`.`url` AND `contact`.`thumb` != '', `contact`.`thumb`, `author`.`thumb`)",
146 "author-network" => ["author", "network"],
147 "author-blocked" => ["author", "blocked"],
148 "author-hidden" => ["author", "hidden"],
149 "author-updated" => ["author", "updated"],
150 "author-gsid" => ["author", "gsid"],
151 "author-uri-id" => ["author", "uri-id"],
152 "owner-id" => ["post-user", "owner-id"],
153 "owner-link" => ["owner", "url"],
154 "owner-addr" => ["owner", "addr"],
155 "owner-name" => "IF (`contact`.`url` = `owner`.`url` AND `contact`.`name` != '', `contact`.`name`, `owner`.`name`)",
156 "owner-nick" => ["owner", "nick"],
157 "owner-avatar" => "IF (`contact`.`url` = `owner`.`url` AND `contact`.`thumb` != '', `contact`.`thumb`, `owner`.`thumb`)",
158 "owner-network" => ["owner", "network"],
159 "owner-blocked" => ["owner", "blocked"],
160 "owner-hidden" => ["owner", "hidden"],
161 "owner-updated" => ["owner", "updated"],
162 "owner-contact-type" => ["owner", "contact-type"],
163 "causer-id" => ["post-user", "causer-id"],
164 "causer-link" => ["causer", "url"],
165 "causer-addr" => ["causer", "addr"],
166 "causer-name" => ["causer", "name"],
167 "causer-nick" => ["causer", "nick"],
168 "causer-avatar" => ["causer", "thumb"],
169 "causer-network" => ["causer", "network"],
170 "causer-blocked" => ["causer", "blocked"],
171 "causer-hidden" => ["causer", "hidden"],
172 "causer-contact-type" => ["causer", "contact-type"],
173 "postopts" => ["post-delivery-data", "postopts"],
174 "inform" => ["post-delivery-data", "inform"],
175 "delivery_queue_count" => ["post-delivery-data", "queue_count"],
176 "delivery_queue_done" => ["post-delivery-data", "queue_done"],
177 "delivery_queue_failed" => ["post-delivery-data", "queue_failed"],
178 "allow_cid" => "IF (`post-user`.`psid` IS NULL, '', `permissionset`.`allow_cid`)",
179 "allow_gid" => "IF (`post-user`.`psid` IS NULL, '', `permissionset`.`allow_gid`)",
180 "deny_cid" => "IF (`post-user`.`psid` IS NULL, '', `permissionset`.`deny_cid`)",
181 "deny_gid" => "IF (`post-user`.`psid` IS NULL, '', `permissionset`.`deny_gid`)",
182 "event-id" => ["post-user", "event-id"],
183 "event-created" => ["event", "created"],
184 "event-edited" => ["event", "edited"],
185 "event-start" => ["event", "start"],
186 "event-finish" => ["event", "finish"],
187 "event-summary" => ["event", "summary"],
188 "event-desc" => ["event", "desc"],
189 "event-location" => ["event", "location"],
190 "event-type" => ["event", "type"],
191 "event-nofinish" => ["event", "nofinish"],
192 "event-ignore" => ["event", "ignore"],
193 "question-id" => ["post-question", "id"],
194 "question-multiple" => ["post-question", "multiple"],
195 "question-voters" => ["post-question", "voters"],
196 "question-end-time" => ["post-question", "end-time"],
197 "signed_text" => ["diaspora-interaction", "interaction"],
198 "parent-guid" => ["parent-item-uri", "guid"],
199 "parent-network" => ["parent-post", "network"],
200 "parent-author-id" => ["parent-post", "author-id"],
201 "parent-author-link" => ["parent-post-author", "url"],
202 "parent-author-name" => ["parent-post-author", "name"],
203 "parent-author-nick" => ["parent-post-author", "nick"],
204 "parent-author-network" => ["parent-post-author", "network"],
205 "parent-author-blocked" => ["parent-post-author", "blocked"],
206 "parent-author-hidden" => ["parent-post-author", "hidden"],
208 "query" => "FROM `post-user`
209 STRAIGHT_JOIN `post-thread-user` ON `post-thread-user`.`uri-id` = `post-user`.`parent-uri-id` AND `post-thread-user`.`uid` = `post-user`.`uid`
210 STRAIGHT_JOIN `contact` ON `contact`.`id` = `post-user`.`contact-id`
211 STRAIGHT_JOIN `contact` AS `author` ON `author`.`id` = `post-user`.`author-id`
212 STRAIGHT_JOIN `contact` AS `owner` ON `owner`.`id` = `post-user`.`owner-id`
213 LEFT JOIN `contact` AS `causer` ON `causer`.`id` = `post-user`.`causer-id`
214 LEFT JOIN `item-uri` ON `item-uri`.`id` = `post-user`.`uri-id`
215 LEFT JOIN `item-uri` AS `thr-parent-item-uri` ON `thr-parent-item-uri`.`id` = `post-user`.`thr-parent-id`
216 LEFT JOIN `item-uri` AS `parent-item-uri` ON `parent-item-uri`.`id` = `post-user`.`parent-uri-id`
217 LEFT JOIN `item-uri` AS `external-item-uri` ON `external-item-uri`.`id` = `post-user`.`external-id`
218 LEFT JOIN `verb` ON `verb`.`id` = `post-user`.`vid`
219 LEFT JOIN `event` ON `event`.`id` = `post-user`.`event-id`
220 LEFT JOIN `diaspora-interaction` ON `diaspora-interaction`.`uri-id` = `post-user`.`uri-id`
221 LEFT JOIN `post-content` ON `post-content`.`uri-id` = `post-user`.`uri-id`
222 LEFT JOIN `post-delivery-data` ON `post-delivery-data`.`uri-id` = `post-user`.`uri-id` AND `post-user`.`origin`
223 LEFT JOIN `post-question` ON `post-question`.`uri-id` = `post-user`.`uri-id`
224 LEFT JOIN `permissionset` ON `permissionset`.`id` = `post-user`.`psid`
225 LEFT JOIN `post-user` AS `parent-post` ON `parent-post`.`uri-id` = `post-user`.`parent-uri-id` AND `parent-post`.`uid` = `post-user`.`uid`
226 LEFT JOIN `contact` AS `parent-post-author` ON `parent-post-author`.`id` = `parent-post`.`author-id`"
228 "post-thread-user-view" => [
230 "id" => ["post-user", "id"],
231 "post-user-id" => ["post-user", "id"],
232 "uid" => ["post-thread-user", "uid"],
233 "parent" => ["parent-post", "id"],
234 "uri" => ["item-uri", "uri"],
235 "uri-id" => ["post-thread-user", "uri-id"],
236 "parent-uri" => ["parent-item-uri", "uri"],
237 "parent-uri-id" => ["post-user", "parent-uri-id"],
238 "thr-parent" => ["thr-parent-item-uri", "uri"],
239 "thr-parent-id" => ["post-user", "thr-parent-id"],
240 "guid" => ["item-uri", "guid"],
241 "wall" => ["post-thread-user", "wall"],
242 "gravity" => ["post-user", "gravity"],
243 "extid" => ["external-item-uri", "uri"],
244 "external-id" => ["post-user", "external-id"],
245 "created" => ["post-thread-user", "created"],
246 "edited" => ["post-user", "edited"],
247 "commented" => ["post-thread-user", "commented"],
248 "received" => ["post-thread-user", "received"],
249 "changed" => ["post-thread-user", "changed"],
250 "post-type" => ["post-user", "post-type"],
251 "post-reason" => ["post-user", "post-reason"],
252 "private" => ["post-user", "private"],
253 "pubmail" => ["post-thread-user", "pubmail"],
254 "ignored" => ["post-thread-user", "ignored"],
255 "visible" => ["post-user", "visible"],
256 "starred" => ["post-thread-user", "starred"],
257 "unseen" => ["post-thread-user", "unseen"],
258 "deleted" => ["post-user", "deleted"],
259 "origin" => ["post-thread-user", "origin"],
260 "mention" => ["post-thread-user", "mention"],
261 "global" => ["post-user", "global"],
262 "featured" => "EXISTS(SELECT `type` FROM `post-collection` WHERE `type` = 0 AND `uri-id` = `post-thread-user`.`uri-id`)",
263 "network" => ["post-thread-user", "network"],
264 "vid" => ["post-user", "vid"],
265 "psid" => ["post-thread-user", "psid"],
266 "verb" => "IF (`post-user`.`vid` IS NULL, '', `verb`.`name`)",
267 "title" => ["post-content", "title"],
268 "content-warning" => ["post-content", "content-warning"],
269 "raw-body" => ["post-content", "raw-body"],
270 "body" => ["post-content", "body"],
271 "rendered-hash" => ["post-content", "rendered-hash"],
272 "rendered-html" => ["post-content", "rendered-html"],
273 "language" => ["post-content", "language"],
274 "plink" => ["post-content", "plink"],
275 "location" => ["post-content", "location"],
276 "coord" => ["post-content", "coord"],
277 "app" => ["post-content", "app"],
278 "object-type" => ["post-content", "object-type"],
279 "object" => ["post-content", "object"],
280 "target-type" => ["post-content", "target-type"],
281 "target" => ["post-content", "target"],
282 "resource-id" => ["post-content", "resource-id"],
283 "contact-id" => ["post-thread-user", "contact-id"],
284 "contact-link" => ["contact", "url"],
285 "contact-addr" => ["contact", "addr"],
286 "contact-name" => ["contact", "name"],
287 "contact-nick" => ["contact", "nick"],
288 "contact-avatar" => ["contact", "thumb"],
289 "contact-network" => ["contact", "network"],
290 "contact-blocked" => ["contact", "blocked"],
291 "contact-hidden" => ["contact", "hidden"],
292 "contact-readonly" => ["contact", "readonly"],
293 "contact-archive" => ["contact", "archive"],
294 "contact-pending" => ["contact", "pending"],
295 "contact-rel" => ["contact", "rel"],
296 "contact-uid" => ["contact", "uid"],
297 "contact-contact-type" => ["contact", "contact-type"],
298 "writable" => "IF (`post-user`.`network` IN ('apub', 'dfrn', 'dspr', 'stat'), true, `contact`.`writable`)",
299 "self" => ["contact", "self"],
300 "cid" => ["contact", "id"],
301 "alias" => ["contact", "alias"],
302 "photo" => ["contact", "photo"],
303 "name-date" => ["contact", "name-date"],
304 "uri-date" => ["contact", "uri-date"],
305 "avatar-date" => ["contact", "avatar-date"],
306 "thumb" => ["contact", "thumb"],
307 "author-id" => ["post-thread-user", "author-id"],
308 "author-link" => ["author", "url"],
309 "author-addr" => ["author", "addr"],
310 "author-name" => "IF (`contact`.`url` = `author`.`url` AND `contact`.`name` != '', `contact`.`name`, `author`.`name`)",
311 "author-nick" => ["author", "nick"],
312 "author-avatar" => "IF (`contact`.`url` = `author`.`url` AND `contact`.`thumb` != '', `contact`.`thumb`, `author`.`thumb`)",
313 "author-network" => ["author", "network"],
314 "author-blocked" => ["author", "blocked"],
315 "author-hidden" => ["author", "hidden"],
316 "author-updated" => ["author", "updated"],
317 "author-gsid" => ["author", "gsid"],
318 "author-uri-id" => ["author", "uri-id"],
319 "owner-id" => ["post-thread-user", "owner-id"],
320 "owner-link" => ["owner", "url"],
321 "owner-addr" => ["owner", "addr"],
322 "owner-name" => "IF (`contact`.`url` = `owner`.`url` AND `contact`.`name` != '', `contact`.`name`, `owner`.`name`)",
323 "owner-nick" => ["owner", "nick"],
324 "owner-avatar" => "IF (`contact`.`url` = `owner`.`url` AND `contact`.`thumb` != '', `contact`.`thumb`, `owner`.`thumb`)",
325 "owner-network" => ["owner", "network"],
326 "owner-blocked" => ["owner", "blocked"],
327 "owner-hidden" => ["owner", "hidden"],
328 "owner-updated" => ["owner", "updated"],
329 "owner-contact-type" => ["owner", "contact-type"],
330 "causer-id" => ["post-thread-user", "causer-id"],
331 "causer-link" => ["causer", "url"],
332 "causer-addr" => ["causer", "addr"],
333 "causer-name" => ["causer", "name"],
334 "causer-nick" => ["causer", "nick"],
335 "causer-avatar" => ["causer", "thumb"],
336 "causer-network" => ["causer", "network"],
337 "causer-blocked" => ["causer", "blocked"],
338 "causer-hidden" => ["causer", "hidden"],
339 "causer-contact-type" => ["causer", "contact-type"],
340 "postopts" => ["post-delivery-data", "postopts"],
341 "inform" => ["post-delivery-data", "inform"],
342 "delivery_queue_count" => ["post-delivery-data", "queue_count"],
343 "delivery_queue_done" => ["post-delivery-data", "queue_done"],
344 "delivery_queue_failed" => ["post-delivery-data", "queue_failed"],
345 "allow_cid" => "IF (`post-thread-user`.`psid` IS NULL, '', `permissionset`.`allow_cid`)",
346 "allow_gid" => "IF (`post-thread-user`.`psid` IS NULL, '', `permissionset`.`allow_gid`)",
347 "deny_cid" => "IF (`post-thread-user`.`psid` IS NULL, '', `permissionset`.`deny_cid`)",
348 "deny_gid" => "IF (`post-thread-user`.`psid` IS NULL, '', `permissionset`.`deny_gid`)",
349 "event-id" => ["post-user", "event-id"],
350 "event-created" => ["event", "created"],
351 "event-edited" => ["event", "edited"],
352 "event-start" => ["event", "start"],
353 "event-finish" => ["event", "finish"],
354 "event-summary" => ["event", "summary"],
355 "event-desc" => ["event", "desc"],
356 "event-location" => ["event", "location"],
357 "event-type" => ["event", "type"],
358 "event-nofinish" => ["event", "nofinish"],
359 "event-ignore" => ["event", "ignore"],
360 "question-id" => ["post-question", "id"],
361 "question-multiple" => ["post-question", "multiple"],
362 "question-voters" => ["post-question", "voters"],
363 "question-end-time" => ["post-question", "end-time"],
364 "signed_text" => ["diaspora-interaction", "interaction"],
365 "parent-guid" => ["parent-item-uri", "guid"],
366 "parent-network" => ["parent-post", "network"],
367 "parent-author-id" => ["parent-post", "author-id"],
368 "parent-author-link" => ["parent-post-author", "url"],
369 "parent-author-name" => ["parent-post-author", "name"],
370 "parent-author-network" => ["parent-post-author", "network"],
371 "parent-author-blocked" => ["parent-post-author", "blocked"],
372 "parent-author-hidden" => ["parent-post-author", "hidden"],
374 "query" => "FROM `post-thread-user`
375 INNER JOIN `post-user` ON `post-user`.`id` = `post-thread-user`.`post-user-id`
376 STRAIGHT_JOIN `contact` ON `contact`.`id` = `post-thread-user`.`contact-id`
377 STRAIGHT_JOIN `contact` AS `author` ON `author`.`id` = `post-thread-user`.`author-id`
378 STRAIGHT_JOIN `contact` AS `owner` ON `owner`.`id` = `post-thread-user`.`owner-id`
379 LEFT JOIN `contact` AS `causer` ON `causer`.`id` = `post-thread-user`.`causer-id`
380 LEFT JOIN `item-uri` ON `item-uri`.`id` = `post-thread-user`.`uri-id`
381 LEFT JOIN `item-uri` AS `thr-parent-item-uri` ON `thr-parent-item-uri`.`id` = `post-user`.`thr-parent-id`
382 LEFT JOIN `item-uri` AS `parent-item-uri` ON `parent-item-uri`.`id` = `post-user`.`parent-uri-id`
383 LEFT JOIN `item-uri` AS `external-item-uri` ON `external-item-uri`.`id` = `post-user`.`external-id`
384 LEFT JOIN `verb` ON `verb`.`id` = `post-user`.`vid`
385 LEFT JOIN `event` ON `event`.`id` = `post-user`.`event-id`
386 LEFT JOIN `diaspora-interaction` ON `diaspora-interaction`.`uri-id` = `post-thread-user`.`uri-id`
387 LEFT JOIN `post-content` ON `post-content`.`uri-id` = `post-thread-user`.`uri-id`
388 LEFT JOIN `post-delivery-data` ON `post-delivery-data`.`uri-id` = `post-thread-user`.`uri-id` AND `post-thread-user`.`origin`
389 LEFT JOIN `post-question` ON `post-question`.`uri-id` = `post-thread-user`.`uri-id`
390 LEFT JOIN `permissionset` ON `permissionset`.`id` = `post-thread-user`.`psid`
391 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`
392 LEFT JOIN `contact` AS `parent-post-author` ON `parent-post-author`.`id` = `parent-post`.`author-id`"
396 "uri" => ["item-uri", "uri"],
397 "uri-id" => ["post", "uri-id"],
398 "parent-uri" => ["parent-item-uri", "uri"],
399 "parent-uri-id" => ["post", "parent-uri-id"],
400 "thr-parent" => ["thr-parent-item-uri", "uri"],
401 "thr-parent-id" => ["post", "thr-parent-id"],
402 "guid" => ["item-uri", "guid"],
403 "gravity" => ["post", "gravity"],
404 "extid" => ["external-item-uri", "uri"],
405 "external-id" => ["post", "external-id"],
406 "created" => ["post", "created"],
407 "edited" => ["post", "edited"],
408 "commented" => ["post-thread", "commented"],
409 "received" => ["post", "received"],
410 "changed" => ["post-thread", "changed"],
411 "post-type" => ["post", "post-type"],
412 "private" => ["post", "private"],
413 "visible" => ["post", "visible"],
414 "deleted" => ["post", "deleted"],
415 "global" => ["post", "global"],
416 "featured" => "EXISTS(SELECT `type` FROM `post-collection` WHERE `type` = 0 AND `uri-id` = `post`.`uri-id`)",
417 "network" => ["post", "network"],
418 "vid" => ["post", "vid"],
419 "verb" => "IF (`post`.`vid` IS NULL, '', `verb`.`name`)",
420 "title" => ["post-content", "title"],
421 "content-warning" => ["post-content", "content-warning"],
422 "raw-body" => ["post-content", "raw-body"],
423 "body" => ["post-content", "body"],
424 "rendered-hash" => ["post-content", "rendered-hash"],
425 "rendered-html" => ["post-content", "rendered-html"],
426 "language" => ["post-content", "language"],
427 "plink" => ["post-content", "plink"],
428 "location" => ["post-content", "location"],
429 "coord" => ["post-content", "coord"],
430 "app" => ["post-content", "app"],
431 "object-type" => ["post-content", "object-type"],
432 "object" => ["post-content", "object"],
433 "target-type" => ["post-content", "target-type"],
434 "target" => ["post-content", "target"],
435 "resource-id" => ["post-content", "resource-id"],
436 "contact-id" => ["post", "author-id"],
437 "contact-link" => ["author", "url"],
438 "contact-addr" => ["author", "addr"],
439 "contact-name" => ["author", "name"],
440 "contact-nick" => ["author", "nick"],
441 "contact-avatar" => ["author", "thumb"],
442 "contact-network" => ["author", "network"],
443 "contact-blocked" => ["author", "blocked"],
444 "contact-hidden" => ["author", "hidden"],
445 "contact-readonly" => ["author", "readonly"],
446 "contact-archive" => ["author", "archive"],
447 "contact-pending" => ["author", "pending"],
448 "contact-rel" => ["author", "rel"],
449 "contact-uid" => ["author", "uid"],
450 "contact-contact-type" => ["author", "contact-type"],
451 "writable" => "IF (`post`.`network` IN ('apub', 'dfrn', 'dspr', 'stat'), true, `author`.`writable`)",
453 "cid" => ["author", "id"],
454 "alias" => ["author", "alias"],
455 "photo" => ["author", "photo"],
456 "name-date" => ["author", "name-date"],
457 "uri-date" => ["author", "uri-date"],
458 "avatar-date" => ["author", "avatar-date"],
459 "thumb" => ["author", "thumb"],
460 "author-id" => ["post", "author-id"],
461 "author-link" => ["author", "url"],
462 "author-addr" => ["author", "addr"],
463 "author-name" => ["author", "name"],
464 "author-nick" => ["author", "nick"],
465 "author-avatar" => ["author", "thumb"],
466 "author-network" => ["author", "network"],
467 "author-blocked" => ["author", "blocked"],
468 "author-hidden" => ["author", "hidden"],
469 "author-updated" => ["author", "updated"],
470 "author-gsid" => ["author", "gsid"],
471 "author-uri-id" => ["author", "uri-id"],
472 "owner-id" => ["post", "owner-id"],
473 "owner-link" => ["owner", "url"],
474 "owner-addr" => ["owner", "addr"],
475 "owner-name" => ["owner", "name"],
476 "owner-nick" => ["owner", "nick"],
477 "owner-avatar" => ["owner", "thumb"],
478 "owner-network" => ["owner", "network"],
479 "owner-blocked" => ["owner", "blocked"],
480 "owner-hidden" => ["owner", "hidden"],
481 "owner-updated" => ["owner", "updated"],
482 "owner-contact-type" => ["owner", "contact-type"],
483 "causer-id" => ["post", "causer-id"],
484 "causer-link" => ["causer", "url"],
485 "causer-addr" => ["causer", "addr"],
486 "causer-name" => ["causer", "name"],
487 "causer-nick" => ["causer", "nick"],
488 "causer-avatar" => ["causer", "thumb"],
489 "causer-network" => ["causer", "network"],
490 "causer-blocked" => ["causer", "blocked"],
491 "causer-hidden" => ["causer", "hidden"],
492 "causer-contact-type" => ["causer", "contact-type"],
493 "question-id" => ["post-question", "id"],
494 "question-multiple" => ["post-question", "multiple"],
495 "question-voters" => ["post-question", "voters"],
496 "question-end-time" => ["post-question", "end-time"],
497 "signed_text" => ["diaspora-interaction", "interaction"],
498 "parent-guid" => ["parent-item-uri", "guid"],
499 "parent-network" => ["parent-post", "network"],
500 "parent-author-id" => ["parent-post", "author-id"],
501 "parent-author-link" => ["parent-post-author", "url"],
502 "parent-author-name" => ["parent-post-author", "name"],
503 "parent-author-network" => ["parent-post-author", "network"],
504 "parent-author-blocked" => ["parent-post-author", "blocked"],
505 "parent-author-hidden" => ["parent-post-author", "hidden"],
507 "query" => "FROM `post`
508 STRAIGHT_JOIN `post-thread` ON `post-thread`.`uri-id` = `post`.`parent-uri-id`
509 STRAIGHT_JOIN `contact` AS `author` ON `author`.`id` = `post`.`author-id`
510 STRAIGHT_JOIN `contact` AS `owner` ON `owner`.`id` = `post`.`owner-id`
511 LEFT JOIN `contact` AS `causer` ON `causer`.`id` = `post`.`causer-id`
512 LEFT JOIN `item-uri` ON `item-uri`.`id` = `post`.`uri-id`
513 LEFT JOIN `item-uri` AS `thr-parent-item-uri` ON `thr-parent-item-uri`.`id` = `post`.`thr-parent-id`
514 LEFT JOIN `item-uri` AS `parent-item-uri` ON `parent-item-uri`.`id` = `post`.`parent-uri-id`
515 LEFT JOIN `item-uri` AS `external-item-uri` ON `external-item-uri`.`id` = `post`.`external-id`
516 LEFT JOIN `verb` ON `verb`.`id` = `post`.`vid`
517 LEFT JOIN `diaspora-interaction` ON `diaspora-interaction`.`uri-id` = `post`.`uri-id`
518 LEFT JOIN `post-content` ON `post-content`.`uri-id` = `post`.`uri-id`
519 LEFT JOIN `post-question` ON `post-question`.`uri-id` = `post`.`uri-id`
520 LEFT JOIN `post` AS `parent-post` ON `parent-post`.`uri-id` = `post`.`parent-uri-id`
521 LEFT JOIN `contact` AS `parent-post-author` ON `parent-post-author`.`id` = `parent-post`.`author-id`"
523 "post-thread-view" => [
525 "uri" => ["item-uri", "uri"],
526 "uri-id" => ["post-thread", "uri-id"],
527 "parent-uri" => ["parent-item-uri", "uri"],
528 "parent-uri-id" => ["post", "parent-uri-id"],
529 "thr-parent" => ["thr-parent-item-uri", "uri"],
530 "thr-parent-id" => ["post", "thr-parent-id"],
531 "guid" => ["item-uri", "guid"],
532 "gravity" => ["post", "gravity"],
533 "extid" => ["external-item-uri", "uri"],
534 "external-id" => ["post", "external-id"],
535 "created" => ["post-thread", "created"],
536 "edited" => ["post", "edited"],
537 "commented" => ["post-thread", "commented"],
538 "received" => ["post-thread", "received"],
539 "changed" => ["post-thread", "changed"],
540 "post-type" => ["post", "post-type"],
541 "private" => ["post", "private"],
542 "visible" => ["post", "visible"],
543 "deleted" => ["post", "deleted"],
544 "global" => ["post", "global"],
545 "featured" => "EXISTS(SELECT `type` FROM `post-collection` WHERE `type` = 0 AND `uri-id` = `post-thread`.`uri-id`)",
546 "network" => ["post-thread", "network"],
547 "vid" => ["post", "vid"],
548 "verb" => "IF (`post`.`vid` IS NULL, '', `verb`.`name`)",
549 "title" => ["post-content", "title"],
550 "content-warning" => ["post-content", "content-warning"],
551 "raw-body" => ["post-content", "raw-body"],
552 "body" => ["post-content", "body"],
553 "rendered-hash" => ["post-content", "rendered-hash"],
554 "rendered-html" => ["post-content", "rendered-html"],
555 "language" => ["post-content", "language"],
556 "plink" => ["post-content", "plink"],
557 "location" => ["post-content", "location"],
558 "coord" => ["post-content", "coord"],
559 "app" => ["post-content", "app"],
560 "object-type" => ["post-content", "object-type"],
561 "object" => ["post-content", "object"],
562 "target-type" => ["post-content", "target-type"],
563 "target" => ["post-content", "target"],
564 "resource-id" => ["post-content", "resource-id"],
565 "contact-id" => ["post-thread", "author-id"],
566 "contact-link" => ["author", "url"],
567 "contact-addr" => ["author", "addr"],
568 "contact-name" => ["author", "name"],
569 "contact-nick" => ["author", "nick"],
570 "contact-avatar" => ["author", "thumb"],
571 "contact-network" => ["author", "network"],
572 "contact-blocked" => ["author", "blocked"],
573 "contact-hidden" => ["author", "hidden"],
574 "contact-readonly" => ["author", "readonly"],
575 "contact-archive" => ["author", "archive"],
576 "contact-pending" => ["author", "pending"],
577 "contact-rel" => ["author", "rel"],
578 "contact-uid" => ["author", "uid"],
579 "contact-contact-type" => ["author", "contact-type"],
580 "writable" => "IF (`post`.`network` IN ('apub', 'dfrn', 'dspr', 'stat'), true, `author`.`writable`)",
582 "cid" => ["author", "id"],
583 "alias" => ["author", "alias"],
584 "photo" => ["author", "photo"],
585 "name-date" => ["author", "name-date"],
586 "uri-date" => ["author", "uri-date"],
587 "avatar-date" => ["author", "avatar-date"],
588 "thumb" => ["author", "thumb"],
589 "author-id" => ["post-thread", "author-id"],
590 "author-link" => ["author", "url"],
591 "author-addr" => ["author", "addr"],
592 "author-name" => ["author", "name"],
593 "author-nick" => ["author", "nick"],
594 "author-avatar" => ["author", "thumb"],
595 "author-network" => ["author", "network"],
596 "author-blocked" => ["author", "blocked"],
597 "author-hidden" => ["author", "hidden"],
598 "author-updated" => ["author", "updated"],
599 "author-gsid" => ["author", "gsid"],
600 "author-uri-id" => ["author", "uri-id"],
601 "owner-id" => ["post-thread", "owner-id"],
602 "owner-link" => ["owner", "url"],
603 "owner-addr" => ["owner", "addr"],
604 "owner-name" => ["owner", "name"],
605 "owner-nick" => ["owner", "nick"],
606 "owner-avatar" => ["owner", "thumb"],
607 "owner-network" => ["owner", "network"],
608 "owner-blocked" => ["owner", "blocked"],
609 "owner-hidden" => ["owner", "hidden"],
610 "owner-updated" => ["owner", "updated"],
611 "owner-contact-type" => ["owner", "contact-type"],
612 "causer-id" => ["post-thread", "causer-id"],
613 "causer-link" => ["causer", "url"],
614 "causer-addr" => ["causer", "addr"],
615 "causer-name" => ["causer", "name"],
616 "causer-nick" => ["causer", "nick"],
617 "causer-avatar" => ["causer", "thumb"],
618 "causer-network" => ["causer", "network"],
619 "causer-blocked" => ["causer", "blocked"],
620 "causer-hidden" => ["causer", "hidden"],
621 "causer-contact-type" => ["causer", "contact-type"],
622 "question-id" => ["post-question", "id"],
623 "question-multiple" => ["post-question", "multiple"],
624 "question-voters" => ["post-question", "voters"],
625 "question-end-time" => ["post-question", "end-time"],
626 "signed_text" => ["diaspora-interaction", "interaction"],
627 "parent-guid" => ["parent-item-uri", "guid"],
628 "parent-network" => ["parent-post", "network"],
629 "parent-author-id" => ["parent-post", "author-id"],
630 "parent-author-link" => ["parent-post-author", "url"],
631 "parent-author-name" => ["parent-post-author", "name"],
632 "parent-author-network" => ["parent-post-author", "network"],
633 "parent-author-blocked" => ["parent-post-author", "blocked"],
634 "parent-author-hidden" => ["parent-post-author", "hidden"],
636 "query" => "FROM `post-thread`
637 INNER JOIN `post` ON `post`.`uri-id` = `post-thread`.`uri-id`
638 STRAIGHT_JOIN `contact` AS `author` ON `author`.`id` = `post-thread`.`author-id`
639 STRAIGHT_JOIN `contact` AS `owner` ON `owner`.`id` = `post-thread`.`owner-id`
640 LEFT JOIN `contact` AS `causer` ON `causer`.`id` = `post-thread`.`causer-id`
641 LEFT JOIN `item-uri` ON `item-uri`.`id` = `post-thread`.`uri-id`
642 LEFT JOIN `item-uri` AS `thr-parent-item-uri` ON `thr-parent-item-uri`.`id` = `post`.`thr-parent-id`
643 LEFT JOIN `item-uri` AS `parent-item-uri` ON `parent-item-uri`.`id` = `post`.`parent-uri-id`
644 LEFT JOIN `item-uri` AS `external-item-uri` ON `external-item-uri`.`id` = `post`.`external-id`
645 LEFT JOIN `verb` ON `verb`.`id` = `post`.`vid`
646 LEFT JOIN `diaspora-interaction` ON `diaspora-interaction`.`uri-id` = `post-thread`.`uri-id`
647 LEFT JOIN `post-content` ON `post-content`.`uri-id` = `post-thread`.`uri-id`
648 LEFT JOIN `post-question` ON `post-question`.`uri-id` = `post-thread`.`uri-id`
649 LEFT JOIN `post` AS `parent-post` ON `parent-post`.`uri-id` = `post`.`parent-uri-id`
650 LEFT JOIN `contact` AS `parent-post-author` ON `parent-post-author`.`id` = `parent-post`.`author-id`"
654 "uri-id" => ["post-category", "uri-id"],
655 "uid" => ["post-category", "uid"],
656 "type" => ["post-category", "type"],
657 "tid" => ["post-category", "tid"],
658 "name" => ["tag", "name"],
659 "url" => ["tag", "url"],
661 "query" => "FROM `post-category`
662 LEFT JOIN `tag` ON `post-category`.`tid` = `tag`.`id`"
664 "collection-view" => [
666 "uri-id" => ["post-collection", "uri-id"],
667 "type" => ["post-collection", "type"],
668 "cid" => ["post", "author-id"],
669 "received" => ["post", "received"],
670 "created" => ["post", "created"],
671 "commented" => ["post-thread", "commented"],
672 "thr-parent-id" => ["post", "thr-parent-id"],
673 "author-id" => ["post", "author-id"],
674 "gravity" => ["post", "gravity"],
676 "query" => "FROM `post-collection`
677 INNER JOIN `post` ON `post-collection`.`uri-id` = `post`.`uri-id`
678 INNER JOIN `post-thread` ON `post-thread`.`uri-id` = `post`.`parent-uri-id`"
682 "uri-id" => ["post-tag", "uri-id"],
683 "type" => ["post-tag", "type"],
684 "tid" => ["post-tag", "tid"],
685 "cid" => ["post-tag", "cid"],
686 "name" => "CASE `cid` WHEN 0 THEN `tag`.`name` ELSE `contact`.`name` END",
687 "url" => "CASE `cid` WHEN 0 THEN `tag`.`url` ELSE `contact`.`url` END",
688 "tag-type" => "CASE `cid` WHEN 0 THEN `tag`.`type` ELSE 1 END",
690 "query" => "FROM `post-tag`
691 LEFT JOIN `tag` ON `post-tag`.`tid` = `tag`.`id`
692 LEFT JOIN `contact` ON `post-tag`.`cid` = `contact`.`id`"
694 "network-item-view" => [
696 "uri-id" => ["post-user", "uri-id"],
697 "parent" => ["parent-post", "id"],
698 "received" => ["post-user", "received"],
699 "commented" => ["post-thread-user", "commented"],
700 "created" => ["post-user", "created"],
701 "uid" => ["post-user", "uid"],
702 "starred" => ["post-thread-user", "starred"],
703 "mention" => ["post-thread-user", "mention"],
704 "network" => ["post-user", "network"],
705 "unseen" => ["post-user", "unseen"],
706 "gravity" => ["post-user", "gravity"],
707 "contact-id" => ["post-user", "contact-id"],
708 "contact-type" => ["ownercontact", "contact-type"],
710 "query" => "FROM `post-user`
711 STRAIGHT_JOIN `post-thread-user` ON `post-thread-user`.`uri-id` = `post-user`.`parent-uri-id` AND `post-thread-user`.`uid` = `post-user`.`uid`
712 INNER JOIN `contact` ON `contact`.`id` = `post-thread-user`.`contact-id`
713 LEFT JOIN `user-contact` AS `author` ON `author`.`uid` = `post-thread-user`.`uid` AND `author`.`cid` = `post-thread-user`.`author-id`
714 LEFT JOIN `user-contact` AS `owner` ON `owner`.`uid` = `post-thread-user`.`uid` AND `owner`.`cid` = `post-thread-user`.`owner-id`
715 INNER JOIN `contact` AS `ownercontact` ON `ownercontact`.`id` = `post-thread-user`.`owner-id`
716 LEFT JOIN `post-user` AS `parent-post` ON `parent-post`.`uri-id` = `post-user`.`parent-uri-id` AND `parent-post`.`uid` = `post-user`.`uid`
717 WHERE `post-user`.`visible` AND NOT `post-user`.`deleted`
718 AND (NOT `contact`.`readonly` AND NOT `contact`.`blocked` AND NOT `contact`.`pending`)
719 AND (`post-user`.`hidden` IS NULL OR NOT `post-user`.`hidden`)
720 AND (`author`.`blocked` IS NULL OR NOT `author`.`blocked`)
721 AND (`owner`.`blocked` IS NULL OR NOT `owner`.`blocked`)"
723 "network-thread-view" => [
725 "uri-id" => ["post-thread-user", "uri-id"],
726 "parent" => ["parent-post", "id"],
727 "received" => ["post-thread-user", "received"],
728 "commented" => ["post-thread-user", "commented"],
729 "created" => ["post-thread-user", "created"],
730 "uid" => ["post-thread-user", "uid"],
731 "starred" => ["post-thread-user", "starred"],
732 "mention" => ["post-thread-user", "mention"],
733 "network" => ["post-thread-user", "network"],
734 "contact-id" => ["post-thread-user", "contact-id"],
735 "contact-type" => ["ownercontact", "contact-type"],
737 "query" => "FROM `post-thread-user`
738 INNER JOIN `post-user` ON `post-user`.`id` = `post-thread-user`.`post-user-id`
739 STRAIGHT_JOIN `contact` ON `contact`.`id` = `post-thread-user`.`contact-id`
740 LEFT JOIN `user-contact` AS `author` ON `author`.`uid` = `post-thread-user`.`uid` AND `author`.`cid` = `post-thread-user`.`author-id`
741 LEFT JOIN `user-contact` AS `owner` ON `owner`.`uid` = `post-thread-user`.`uid` AND `owner`.`cid` = `post-thread-user`.`owner-id`
742 LEFT JOIN `contact` AS `ownercontact` ON `ownercontact`.`id` = `post-thread-user`.`owner-id`
743 LEFT JOIN `post-user` AS `parent-post` ON `parent-post`.`uri-id` = `post-user`.`parent-uri-id` AND `parent-post`.`uid` = `post-user`.`uid`
744 WHERE `post-user`.`visible` AND NOT `post-user`.`deleted`
745 AND (NOT `contact`.`readonly` AND NOT `contact`.`blocked` AND NOT `contact`.`pending`)
746 AND (`post-thread-user`.`hidden` IS NULL OR NOT `post-thread-user`.`hidden`)
747 AND (`author`.`blocked` IS NULL OR NOT `author`.`blocked`)
748 AND (`owner`.`blocked` IS NULL OR NOT `owner`.`blocked`)"
752 "id" => ["contact", "id"],
753 "uid" => ["contact", "uid"],
754 "created" => ["contact", "created"],
755 "updated" => ["contact", "updated"],
756 "self" => ["contact", "self"],
757 "remote_self" => ["contact", "remote_self"],
758 "rel" => ["contact", "rel"],
759 "network" => ["contact", "network"],
760 "protocol" => ["contact", "protocol"],
761 "name" => ["contact", "name"],
762 "nick" => ["contact", "nick"],
763 "location" => ["contact", "location"],
764 "about" => ["contact", "about"],
765 "keywords" => ["contact", "keywords"],
766 "xmpp" => ["contact", "xmpp"],
767 "matrix" => ["contact", "matrix"],
768 "attag" => ["contact", "attag"],
769 "avatar" => ["contact", "avatar"],
770 "photo" => ["contact", "photo"],
771 "thumb" => ["contact", "thumb"],
772 "micro" => ["contact", "micro"],
773 "header" => ["contact", "header"],
774 "url" => ["contact", "url"],
775 "nurl" => ["contact", "nurl"],
776 "uri-id" => ["contact", "uri-id"],
777 "addr" => ["contact", "addr"],
778 "alias" => ["contact", "alias"],
779 "pubkey" => ["contact", "pubkey"],
780 "prvkey" => ["contact", "prvkey"],
781 "batch" => ["contact", "batch"],
782 "request" => ["contact", "request"],
783 "notify" => ["contact", "notify"],
784 "poll" => ["contact", "poll"],
785 "confirm" => ["contact", "confirm"],
786 "poco" => ["contact", "poco"],
787 "subhub" => ["contact", "subhub"],
788 "hub-verify" => ["contact", "hub-verify"],
789 "last-update" => ["contact", "last-update"],
790 "success_update" => ["contact", "success_update"],
791 "failure_update" => ["contact", "failure_update"],
792 "name-date" => ["contact", "name-date"],
793 "uri-date" => ["contact", "uri-date"],
794 "avatar-date" => ["contact", "avatar-date"],
795 "picdate" => ["contact", "avatar-date"], /// @todo Replaces all uses of "picdate" with "avatar-date"
796 "term-date" => ["contact", "term-date"],
797 "last-item" => ["contact", "last-item"],
798 "priority" => ["contact", "priority"],
799 "blocked" => ["user", "blocked"],
800 "block_reason" => ["contact", "block_reason"],
801 "readonly" => ["contact", "readonly"],
802 "writable" => ["contact", "writable"],
803 "forum" => ["contact", "forum"],
804 "prv" => ["contact", "prv"],
805 "contact-type" => ["contact", "contact-type"],
806 "manually-approve" => ["contact", "manually-approve"],
807 "hidden" => ["contact", "hidden"],
808 "archive" => ["contact", "archive"],
809 "pending" => ["contact", "pending"],
810 "deleted" => ["contact", "deleted"],
811 "unsearchable" => ["contact", "unsearchable"],
812 "sensitive" => ["contact", "sensitive"],
813 "baseurl" => ["contact", "baseurl"],
814 "reason" => ["contact", "reason"],
815 "info" => ["contact", "info"],
816 "bdyear" => ["contact", "bdyear"],
817 "bd" => ["contact", "bd"],
818 "notify_new_posts" => ["contact", "notify_new_posts"],
819 "fetch_further_information" => ["contact", "fetch_further_information"],
820 "ffi_keyword_denylist" => ["contact", "ffi_keyword_denylist"],
821 "parent-uid" => ["user", "parent-uid"],
822 "guid" => ["user", "guid"],
823 "nickname" => ["user", "nickname"], /// @todo Replaces all uses of "nickname" with "nick"
824 "email" => ["user", "email"],
825 "openid" => ["user", "openid"],
826 "timezone" => ["user", "timezone"],
827 "language" => ["user", "language"],
828 "register_date" => ["user", "register_date"],
829 "login_date" => ["user", "login_date"],
830 "default-location" => ["user", "default-location"],
831 "allow_location" => ["user", "allow_location"],
832 "theme" => ["user", "theme"],
833 "upubkey" => ["user", "pubkey"],
834 "uprvkey" => ["user", "prvkey"],
835 "sprvkey" => ["user", "sprvkey"],
836 "spubkey" => ["user", "spubkey"],
837 "verified" => ["user", "verified"],
838 "blockwall" => ["user", "blockwall"],
839 "hidewall" => ["user", "hidewall"],
840 "blocktags" => ["user", "blocktags"],
841 "unkmail" => ["user", "unkmail"],
842 "cntunkmail" => ["user", "cntunkmail"],
843 "notify-flags" => ["user", "notify-flags"],
844 "page-flags" => ["user", "page-flags"],
845 "account-type" => ["user", "account-type"],
846 "prvnets" => ["user", "prvnets"],
847 "maxreq" => ["user", "maxreq"],
848 "expire" => ["user", "expire"],
849 "account_removed" => ["user", "account_removed"],
850 "account_expired" => ["user", "account_expired"],
851 "account_expires_on" => ["user", "account_expires_on"],
852 "expire_notification_sent" => ["user", "expire_notification_sent"],
853 "def_gid" => ["user", "def_gid"],
854 "allow_cid" => ["user", "allow_cid"],
855 "allow_gid" => ["user", "allow_gid"],
856 "deny_cid" => ["user", "deny_cid"],
857 "deny_gid" => ["user", "deny_gid"],
858 "openidserver" => ["user", "openidserver"],
859 "publish" => ["profile", "publish"],
860 "net-publish" => ["profile", "net-publish"],
861 "hide-friends" => ["profile", "hide-friends"],
862 "prv_keywords" => ["profile", "prv_keywords"],
863 "pub_keywords" => ["profile", "pub_keywords"],
864 "address" => ["profile", "address"],
865 "locality" => ["profile", "locality"],
866 "region" => ["profile", "region"],
867 "postal-code" => ["profile", "postal-code"],
868 "country-name" => ["profile", "country-name"],
869 "homepage" => ["profile", "homepage"],
870 "dob" => ["profile", "dob"],
872 "query" => "FROM `user`
873 INNER JOIN `contact` ON `contact`.`uid` = `user`.`uid` AND `contact`.`self`
874 INNER JOIN `profile` ON `profile`.`uid` = `user`.`uid`"
878 "id" => ["contact", "id"],
879 "url" => ["contact", "url"],
880 "nurl" => ["contact", "nurl"],
881 "uri-id" => ["contact", "uri-id"],
882 "guid" => ["item-uri", "guid"],
883 "addr" => ["contact", "addr"],
884 "alias" => ["contact", "alias"],
885 "name" => ["contact", "name"],
886 "nick" => ["contact", "nick"],
887 "about" => ["contact", "about"],
888 "keywords" => ["contact", "keywords"],
889 "xmpp" => ["contact", "xmpp"],
890 "matrix" => ["contact", "matrix"],
891 "avatar" => ["contact", "avatar"],
892 "photo" => ["contact", "photo"],
893 "thumb" => ["contact", "thumb"],
894 "micro" => ["contact", "micro"],
895 "header" => ["contact", "header"],
896 "created" => ["contact", "created"],
897 "updated" => ["contact", "updated"],
898 "network" => ["contact", "network"],
899 "protocol" => ["contact", "protocol"],
900 "location" => ["contact", "location"],
901 "attag" => ["contact", "attag"],
902 "pubkey" => ["contact", "pubkey"],
903 "prvkey" => ["contact", "prvkey"],
904 "subscribe" => ["contact", "subscribe"],
905 "last-update" => ["contact", "last-update"],
906 "success_update" => ["contact", "success_update"],
907 "failure_update" => ["contact", "failure_update"],
908 "failed" => ["contact", "failed"],
909 "last-item" => ["contact", "last-item"],
910 "last-discovery" => ["contact", "last-discovery"],
911 "contact-type" => ["contact", "contact-type"],
912 "manually-approve" => ["contact", "manually-approve"],
913 "unsearchable" => ["contact", "unsearchable"],
914 "sensitive" => ["contact", "sensitive"],
915 "baseurl" => ["contact", "baseurl"],
916 "gsid" => ["contact", "gsid"],
917 "info" => ["contact", "info"],
918 "bdyear" => ["contact", "bdyear"],
919 "bd" => ["contact", "bd"],
920 "poco" => ["contact", "poco"],
921 "name-date" => ["contact", "name-date"],
922 "uri-date" => ["contact", "uri-date"],
923 "avatar-date" => ["contact", "avatar-date"],
924 "term-date" => ["contact", "term-date"],
925 "global-ignored" => ["contact", "hidden"],
926 "global-blocked" => ["contact", "blocked"],
927 "hidden" => ["contact", "hidden"],
928 "archive" => ["contact", "archive"],
929 "deleted" => ["contact", "deleted"],
930 "blocked" => ["contact", "blocked"],
931 "dfrn-notify" => ["contact", "notify"],
932 "dfrn-poll" => ["contact", "poll"],
933 "diaspora-guid" => ["fcontact", "guid"],
934 "diaspora-batch" => ["fcontact", "batch"],
935 "diaspora-notify" => ["fcontact", "notify"],
936 "diaspora-poll" => ["fcontact", "poll"],
937 "diaspora-alias" => ["fcontact", "alias"],
938 "ap-uuid" => ["apcontact", "uuid"],
939 "ap-type" => ["apcontact", "type"],
940 "ap-following" => ["apcontact", "following"],
941 "ap-followers" => ["apcontact", "followers"],
942 "ap-inbox" => ["apcontact", "inbox"],
943 "ap-outbox" => ["apcontact", "outbox"],
944 "ap-sharedinbox" => ["apcontact", "sharedinbox"],
945 "ap-generator" => ["apcontact", "generator"],
946 "ap-following_count" => ["apcontact", "following_count"],
947 "ap-followers_count" => ["apcontact", "followers_count"],
948 "ap-statuses_count" => ["apcontact", "statuses_count"],
949 "site_name" => ["gserver", "site_name"],
950 "platform" => ["gserver", "platform"],
951 "version" => ["gserver", "version"],
953 "query" => "FROM `contact`
954 LEFT JOIN `item-uri` ON `item-uri`.`id` = `contact`.`uri-id`
955 LEFT JOIN `apcontact` ON `apcontact`.`uri-id` = `contact`.`uri-id`
956 LEFT JOIN `fcontact` ON `fcontact`.`uri-id` = contact.`uri-id`
957 LEFT JOIN `gserver` ON `gserver`.`id` = contact.`gsid`
958 WHERE `contact`.`uid` = 0"
960 "account-user-view" => [
962 "id" => ["ucontact", "id"],
963 "pid" => ["contact", "id"],
964 "uid" => ["ucontact", "uid"],
965 "url" => ["contact", "url"],
966 "nurl" => ["contact", "nurl"],
967 "uri-id" => ["contact", "uri-id"],
968 "guid" => ["item-uri", "guid"],
969 "addr" => ["contact", "addr"],
970 "alias" => ["contact", "alias"],
971 "name" => ["contact", "name"],
972 "nick" => ["contact", "nick"],
973 "about" => ["contact", "about"],
974 "keywords" => ["contact", "keywords"],
975 "xmpp" => ["contact", "xmpp"],
976 "matrix" => ["contact", "matrix"],
977 "avatar" => ["contact", "avatar"],
978 "photo" => ["contact", "photo"],
979 "thumb" => ["contact", "thumb"],
980 "micro" => ["contact", "micro"],
981 "header" => ["contact", "header"],
982 "created" => ["contact", "created"],
983 "updated" => ["contact", "updated"],
984 "self" => ["ucontact", "self"],
985 "remote_self" => ["ucontact", "remote_self"],
986 "rel" => ["ucontact", "rel"],
987 "network" => ["contact", "network"],
988 "protocol" => ["ucontact", "protocol"],
989 "location" => ["contact", "location"],
990 "attag" => ["ucontact", "attag"],
991 "pubkey" => ["contact", "pubkey"],
992 "prvkey" => ["contact", "prvkey"],
993 "subscribe" => ["contact", "subscribe"],
994 "last-update" => ["contact", "last-update"],
995 "success_update" => ["contact", "success_update"],
996 "failure_update" => ["contact", "failure_update"],
997 "failed" => ["contact", "failed"],
998 "last-item" => ["contact", "last-item"],
999 "last-discovery" => ["contact", "last-discovery"],
1000 "contact-type" => ["contact", "contact-type"],
1001 "manually-approve" => ["contact", "manually-approve"],
1002 "unsearchable" => ["contact", "unsearchable"],
1003 "sensitive" => ["contact", "sensitive"],
1004 "baseurl" => ["contact", "baseurl"],
1005 "gsid" => ["contact", "gsid"],
1006 "info" => ["ucontact", "info"],
1007 "bdyear" => ["contact", "bdyear"],
1008 "bd" => ["contact", "bd"],
1009 "poco" => ["contact", "poco"],
1010 "name-date" => ["contact", "name-date"],
1011 "uri-date" => ["contact", "uri-date"],
1012 "avatar-date" => ["contact", "avatar-date"],
1013 "term-date" => ["contact", "term-date"],
1014 "global-ignored" => ["contact", "hidden"],
1015 "global-blocked" => ["contact", "blocked"],
1016 "hidden" => ["ucontact", "hidden"],
1017 "archive" => ["ucontact", "archive"],
1018 "pending" => ["ucontact", "pending"],
1019 "deleted" => ["ucontact", "deleted"],
1020 "notify_new_posts" => ["ucontact", "notify_new_posts"],
1021 "fetch_further_information" => ["ucontact", "fetch_further_information"],
1022 "ffi_keyword_denylist" => ["ucontact", "ffi_keyword_denylist"],
1023 "rating" => ["ucontact", "rating"],
1024 "readonly" => ["ucontact", "readonly"],
1025 "blocked" => ["ucontact", "blocked"],
1026 "block_reason" => ["ucontact", "block_reason"],
1027 "subhub" => ["ucontact", "subhub"],
1028 "hub-verify" => ["ucontact", "hub-verify"],
1029 "reason" => ["ucontact", "reason"],
1030 "dfrn-notify" => ["contact", "notify"],
1031 "dfrn-poll" => ["contact", "poll"],
1032 "diaspora-guid" => ["fcontact", "guid"],
1033 "diaspora-batch" => ["fcontact", "batch"],
1034 "diaspora-notify" => ["fcontact", "notify"],
1035 "diaspora-poll" => ["fcontact", "poll"],
1036 "diaspora-alias" => ["fcontact", "alias"],
1037 "ap-uuid" => ["apcontact", "uuid"],
1038 "ap-type" => ["apcontact", "type"],
1039 "ap-following" => ["apcontact", "following"],
1040 "ap-followers" => ["apcontact", "followers"],
1041 "ap-inbox" => ["apcontact", "inbox"],
1042 "ap-outbox" => ["apcontact", "outbox"],
1043 "ap-sharedinbox" => ["apcontact", "sharedinbox"],
1044 "ap-generator" => ["apcontact", "generator"],
1045 "ap-following_count" => ["apcontact", "following_count"],
1046 "ap-followers_count" => ["apcontact", "followers_count"],
1047 "ap-statuses_count" => ["apcontact", "statuses_count"],
1048 "site_name" => ["gserver", "site_name"],
1049 "platform" => ["gserver", "platform"],
1050 "version" => ["gserver", "version"],
1052 "query" => "FROM `contact` AS `ucontact`
1053 INNER JOIN `contact` ON `contact`.`uri-id` = `ucontact`.`uri-id` AND `contact`.`uid` = 0
1054 LEFT JOIN `item-uri` ON `item-uri`.`id` = `ucontact`.`uri-id`
1055 LEFT JOIN `apcontact` ON `apcontact`.`uri-id` = `ucontact`.`uri-id`
1056 LEFT JOIN `fcontact` ON `fcontact`.`uri-id` = `ucontact`.`uri-id` AND `fcontact`.`network` = 'dspr'
1057 LEFT JOIN `gserver` ON `gserver`.`id` = contact.`gsid`"
1061 "id" => ["register", "id"],
1062 "hash" => ["register", "hash"],
1063 "created" => ["register", "created"],
1064 "uid" => ["register", "uid"],
1065 "password" => ["register", "password"],
1066 "language" => ["register", "language"],
1067 "note" => ["register", "note"],
1068 "self" => ["contact", "self"],
1069 "name" => ["contact", "name"],
1070 "url" => ["contact", "url"],
1071 "micro" => ["contact", "micro"],
1072 "email" => ["user", "email"],
1073 "nick" => ["contact", "nick"],
1075 "query" => "FROM `register`
1076 INNER JOIN `contact` ON `register`.`uid` = `contact`.`uid`
1077 INNER JOIN `user` ON `register`.`uid` = `user`.`uid`"
1079 "tag-search-view" => [
1081 "uri-id" => ["post-tag", "uri-id"],
1082 "uid" => ["post-user", "uid"],
1083 "iid" => ["post-user", "id"],
1084 "private" => ["post-user", "private"],
1085 "wall" => ["post-user", "wall"],
1086 "origin" => ["post-user", "origin"],
1087 "global" => ["post-user", "global"],
1088 "gravity" => ["post-user", "gravity"],
1089 "received" => ["post-user", "received"],
1090 "network" => ["post-user", "network"],
1091 "author-id" => ["post-user", "author-id"],
1092 "name" => ["tag", "name"],
1094 "query" => "FROM `post-tag`
1095 INNER JOIN `tag` ON `tag`.`id` = `post-tag`.`tid`
1096 STRAIGHT_JOIN `post-user` ON `post-user`.`uri-id` = `post-tag`.`uri-id`
1097 WHERE `post-tag`.`type` = 1"
1099 "workerqueue-view" => [
1101 "pid" => ["process", "pid"],
1102 "priority" => ["workerqueue", "priority"],
1104 "query" => "FROM `process`
1105 INNER JOIN `workerqueue` ON `workerqueue`.`pid` = `process`.`pid`
1106 WHERE NOT `workerqueue`.`done`"
1108 "profile_field-view" => [
1110 "id" => ["profile_field", "id"],
1111 "uid" => ["profile_field", "uid"],
1112 "label" => ["profile_field", "label"],
1113 "value" => ["profile_field", "value"],
1114 "order" => ["profile_field", "order"],
1115 "psid"=> ["profile_field", "psid"],
1116 "allow_cid" => ["permissionset", "allow_cid"],
1117 "allow_gid" => ["permissionset", "allow_gid"],
1118 "deny_cid" => ["permissionset", "deny_cid"],
1119 "deny_gid" => ["permissionset", "deny_gid"],
1120 "created" => ["profile_field", "created"],
1121 "edited" => ["profile_field", "edited"],
1123 "query" => "FROM `profile_field`
1124 INNER JOIN `permissionset` ON `permissionset`.`id` = `profile_field`.`psid`"