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