3 * @copyright Copyright (C) 2020, Friendica
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.
42 "id" => ["item", "id"],
43 "item_id" => ["item", "id"],
44 "uid" => ["item", "uid"],
45 "internal-uid" => ["item", "uid"],
46 "parent" => ["item", "parent"],
47 "uri" => ["item", "uri"],
48 "uri-id" => ["item", "uri-id"],
49 "internal-uri-id" => ["item", "uri-id"],
50 "parent-uri" => ["item", "parent-uri"],
51 "parent-uri-id" => ["item", "parent-uri-id"],
52 "thr-parent" => ["item", "thr-parent"],
53 "thr-parent-id" => ["item", "thr-parent-id"],
54 "guid" => ["item", "guid"],
55 "type" => ["item", "type"],
56 "wall" => ["item", "wall"],
57 "gravity" => ["item", "gravity"],
58 "extid" => ["item", "extid"],
59 "created" => ["item", "created"],
60 "edited" => ["item", "edited"],
61 "commented" => ["item", "commented"],
62 "received" => ["item", "received"],
63 "changed" => ["item", "changed"],
64 "resource-id" => ["item", "resource-id"],
65 "post-type" => ["item", "post-type"],
66 "private" => ["item", "private"],
67 "pubmail" => ["item", "pubmail"],
68 "moderated" => ["item", "moderated"],
69 "visible" => ["item", "visible"],
70 "starred" => ["item", "starred"],
71 "bookmark" => ["item", "bookmark"],
72 "unseen" => ["item", "unseen"],
73 "deleted" => ["item", "deleted"],
74 "origin" => ["item", "origin"],
75 "forum_mode" => ["item", "forum_mode"],
76 "mention" => ["item", "mention"],
77 "global" => ["item", "global"],
78 "network" => ["item", "network"],
79 "icid" => ["item", "icid"],
80 "vid" => ["item", "vid"],
81 "psid" => ["item", "psid"],
82 "attach" => ["item", "attach"],
83 "internal-file-count" => "(SELECT COUNT(*) FROM `post-category` WHERE `post-category`.`uri-id` = `item`.`uri-id`)",
85 "verb" => "IF (`item`.`vid` IS NULL, '', `verb`.`name`)",
86 "title" => ["item-content", "title"],
87 "content-warning" => ["item-content", "content-warning"],
88 "raw-body" => ["item-content", "raw-body"],
89 "body" => ["item-content", "body"],
90 "rendered-hash" => ["item-content", "rendered-hash"],
91 "rendered-html" => ["item-content", "rendered-html"],
92 "language" => ["item-content", "language"],
93 "plink" => ["item-content", "plink"],
94 "location" => ["item-content", "location"],
95 "coord" => ["item-content", "coord"],
96 "app" => ["item-content", "app"],
97 "object-type" => ["item-content", "object-type"],
98 "object" => ["item-content", "object"],
99 "target-type" => ["item-content", "target-type"],
100 "target" => ["item-content", "target"],
101 "contact-id" => ["item", "contact-id"],
102 "contact-link" => ["contact", "url"],
103 "contact-addr" => ["contact", "addr"],
104 "contact-name" => ["contact", "name"],
105 "contact-nick" => ["contact", "nick"],
106 "contact-avatar" => ["contact", "thumb"],
107 "contact-network" => ["contact", "network"],
108 "contact-blocked" => ["contact", "blocked"],
109 "contact-hidden" => ["contact", "hidden"],
110 "contact-readonly" => ["contact", "readonly"],
111 "contact-archive" => ["contact", "archive"],
112 "contact-pending" => ["contact", "pending"],
113 "contact-rel" => ["contact", "rel"],
114 "contact-uid" => ["contact", "uid"],
115 "contact-contact-type" => ["contact", "contact-type"],
116 "writable" => "IF (`item`.`network` IN ('apub', 'dfrn', 'dspr', 'stat'), true, `contact`.`writable`)",
117 "self" => ["contact", "self"],
118 "cid" => ["contact", "id"],
119 "alias" => ["contact", "alias"],
120 "photo" => ["contact", "photo"],
121 "name-date" => ["contact", "name-date"],
122 "uri-date" => ["contact", "uri-date"],
123 "avatar-date" => ["contact", "avatar-date"],
124 "thumb" => ["contact", "thumb"],
125 "dfrn-id" => ["contact", "dfrn-id"],
126 "group-id" => ["group_member", "gid"],
127 "author-id" => ["item", "author-id"],
128 "author-link" => ["author", "url"],
129 "author-addr" => ["author", "addr"],
130 "author-name" => "IF (`contact`.`url` = `author`.`url`, `contact`.`name`, `author`.`name`)",
131 "author-nick" => ["author", "nick"],
132 "author-avatar" => "IF (`contact`.`url` = `author`.`url`, `contact`.`thumb`, `author`.`thumb`)",
133 "author-network" => ["author", "network"],
134 "author-blocked" => ["author", "blocked"],
135 "author-hidden" => ["author", "hidden"],
136 "owner-id" => ["item", "owner-id"],
137 "owner-link" => ["owner", "url"],
138 "owner-addr" => ["owner", "addr"],
139 "owner-name" => "IF (`contact`.`url` = `owner`.`url`, `contact`.`name`, `owner`.`name`)",
140 "owner-nick" => ["owner", "nick"],
141 "owner-avatar" => "IF (`contact`.`url` = `owner`.`url`, `contact`.`thumb`, `owner`.`thumb`)",
142 "owner-network" => ["owner", "network"],
143 "owner-blocked" => ["owner", "blocked"],
144 "owner-hidden" => ["owner", "hidden"],
145 "causer-id" => ["item", "causer-id"],
146 "causer-link" => ["causer", "url"],
147 "causer-addr" => ["causer", "addr"],
148 "causer-name" => ["causer", "name"],
149 "causer-nick" => ["causer", "nick"],
150 "causer-avatar" => ["causer", "thumb"],
151 "causer-network" => ["causer", "network"],
152 "causer-blocked" => ["causer", "blocked"],
153 "causer-hidden" => ["causer", "hidden"],
154 "causer-contact-type" => ["causer", "contact-type"],
155 "postopts" => ["post-delivery-data", "postopts"],
156 "inform" => ["post-delivery-data", "inform"],
157 "delivery_queue_count" => ["post-delivery-data", "queue_count"],
158 "delivery_queue_done" => ["post-delivery-data", "queue_done"],
159 "delivery_queue_failed" => ["post-delivery-data", "queue_failed"],
160 "allow_cid" => "IF (`item`.`psid` IS NULL, '', `permissionset`.`allow_cid`)",
161 "allow_gid" => "IF (`item`.`psid` IS NULL, '', `permissionset`.`allow_gid`)",
162 "deny_cid" => "IF (`item`.`psid` IS NULL, '', `permissionset`.`deny_cid`)",
163 "deny_gid" => "IF (`item`.`psid` IS NULL, '', `permissionset`.`deny_gid`)",
164 "event-id" => ["item", "event-id"],
165 "event-created" => ["event", "created"],
166 "event-edited" => ["event", "edited"],
167 "event-start" => ["event", "start"],
168 "event-finish" => ["event", "finish"],
169 "event-summary" => ["event", "summary"],
170 "event-desc" => ["event", "desc"],
171 "event-location" => ["event", "location"],
172 "event-type" => ["event", "type"],
173 "event-nofinish" => ["event", "nofinish"],
174 "event-adjust" => ["event", "adjust"],
175 "event-ignore" => ["event", "ignore"],
176 "signed_text" => ["diaspora-interaction", "interaction"],
177 "parent-guid" => ["parent-item", "guid"],
178 "parent-network" => ["parent-item", "network"],
179 "parent-author-id" => ["parent-item", "author-id"],
180 "parent-author-link" => ["parent-item-author", "url"],
181 "parent-author-name" => ["parent-item-author", "name"],
182 "parent-author-network" => ["parent-item-author", "network"],
184 "query" => "FROM `item`
185 STRAIGHT_JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
186 STRAIGHT_JOIN `contact` AS `author` ON `author`.`id` = `item`.`author-id`
187 STRAIGHT_JOIN `contact` AS `owner` ON `owner`.`id` = `item`.`owner-id`
188 STRAIGHT_JOIN `contact` AS `causer` ON `causer`.`id` = `item`.`causer-id`
189 LEFT JOIN `group_member` ON `group_member`.`contact-id` = `item`.`contact-id`
190 LEFT JOIN `verb` ON `verb`.`id` = `item`.`vid`
191 LEFT JOIN `event` ON `event`.`id` = `item`.`event-id`
192 LEFT JOIN `diaspora-interaction` ON `diaspora-interaction`.`uri-id` = `item`.`uri-id`
193 LEFT JOIN `item-content` ON `item-content`.`uri-id` = `item`.`uri-id`
194 LEFT JOIN `post-delivery-data` ON `post-delivery-data`.`uri-id` = `item`.`uri-id` AND `item`.`origin`
195 LEFT JOIN `permissionset` ON `permissionset`.`id` = `item`.`psid`
196 STRAIGHT_JOIN `item` AS `parent-item` ON `parent-item`.`uri-id` = `item`.`parent-uri-id` AND `parent-item`.`uid` = `item`.`uid`
197 STRAIGHT_JOIN `contact` AS `parent-item-author` ON `parent-item-author`.`id` = `parent-item`.`author-id`"
199 "post-thread-view" => [
201 "id" => ["item", "id"],
202 "iid" => ["thread", "iid"],
203 "item_id" => ["item", "id"],
204 "uid" => ["thread", "uid"],
205 "internal-uid" => ["item", "uid"],
206 "parent" => ["item", "parent"],
207 "uri" => ["item", "uri"],
208 "uri-id" => ["item", "uri-id"],
209 "internal-uri-id" => ["item", "uri-id"],
210 "parent-uri" => ["item", "parent-uri"],
211 "parent-uri-id" => ["item", "parent-uri-id"],
212 "thr-parent" => ["item", "thr-parent"],
213 "thr-parent-id" => ["item", "thr-parent-id"],
214 "guid" => ["item", "guid"],
215 "type" => ["item", "type"],
216 "wall" => ["thread", "wall"],
217 "gravity" => ["item", "gravity"],
218 "extid" => ["item", "extid"],
219 "created" => ["thread", "created"],
220 "edited" => ["item", "edited"],
221 "commented" => ["thread", "commented"],
222 "received" => ["thread", "received"],
223 "changed" => ["thread", "changed"],
224 "edited" => ["thread", "edited"],
225 "resource-id" => ["item", "resource-id"],
226 "post-type" => ["thread", "post-type"],
227 "private" => ["thread", "private"],
228 "pubmail" => ["thread", "pubmail"],
229 "moderated" => ["thread", "moderated"],
230 "ignored" => ["thread", "ignored"],
231 "visible" => ["thread", "visible"],
232 "starred" => ["thread", "starred"],
233 "bookmark" => ["item", "bookmark"],
234 "unseen" => ["item", "unseen"],
235 "deleted" => ["thread", "deleted"],
236 "origin" => ["thread", "origin"],
237 "forum_mode" => ["thread", "forum_mode"],
238 "mention" => ["thread", "mention"],
239 "global" => ["item", "global"],
240 "network" => ["thread", "network"],
241 "icid" => ["item", "icid"],
242 "vid" => ["item", "vid"],
243 "psid" => ["item", "psid"],
244 "attach" => ["item", "attach"],
245 "internal-file-count" => "(SELECT COUNT(*) FROM `post-category` WHERE `post-category`.`uri-id` = `item`.`uri-id`)",
247 "verb" => "IF (`item`.`vid` IS NULL, '', `verb`.`name`)",
248 "title" => ["item-content", "title"],
249 "content-warning" => ["item-content", "content-warning"],
250 "raw-body" => ["item-content", "raw-body"],
251 "body" => ["item-content", "body"],
252 "rendered-hash" => ["item-content", "rendered-hash"],
253 "rendered-html" => ["item-content", "rendered-html"],
254 "language" => ["item-content", "language"],
255 "plink" => ["item-content", "plink"],
256 "location" => ["item-content", "location"],
257 "coord" => ["item-content", "coord"],
258 "app" => ["item-content", "app"],
259 "object-type" => ["item-content", "object-type"],
260 "object" => ["item-content", "object"],
261 "target-type" => ["item-content", "target-type"],
262 "target" => ["item-content", "target"],
263 "contact-id" => ["thread", "contact-id"],
264 "contact-link" => ["contact", "url"],
265 "contact-addr" => ["contact", "addr"],
266 "contact-name" => ["contact", "name"],
267 "contact-nick" => ["contact", "nick"],
268 "contact-avatar" => ["contact", "thumb"],
269 "contact-network" => ["contact", "network"],
270 "contact-blocked" => ["contact", "blocked"],
271 "contact-hidden" => ["contact", "hidden"],
272 "contact-readonly" => ["contact", "readonly"],
273 "contact-archive" => ["contact", "archive"],
274 "contact-pending" => ["contact", "pending"],
275 "contact-rel" => ["contact", "rel"],
276 "contact-uid" => ["contact", "uid"],
277 "contact-contact-type" => ["contact", "contact-type"],
278 "writable" => "IF (`item`.`network` IN ('apub', 'dfrn', 'dspr', 'stat'), true, `contact`.`writable`)",
279 "self" => ["contact", "self"],
280 "cid" => ["contact", "id"],
281 "alias" => ["contact", "alias"],
282 "photo" => ["contact", "photo"],
283 "name-date" => ["contact", "name-date"],
284 "uri-date" => ["contact", "uri-date"],
285 "avatar-date" => ["contact", "avatar-date"],
286 "thumb" => ["contact", "thumb"],
287 "dfrn-id" => ["contact", "dfrn-id"],
288 "group-id" => ["group_member", "gid"],
289 "author-id" => ["thread", "author-id"],
290 "author-link" => ["author", "url"],
291 "author-addr" => ["author", "addr"],
292 "author-name" => "IF (`contact`.`url` = `author`.`url`, `contact`.`name`, `author`.`name`)",
293 "author-nick" => ["author", "nick"],
294 "author-avatar" => "IF (`contact`.`url` = `author`.`url`, `contact`.`thumb`, `author`.`thumb`)",
295 "author-network" => ["author", "network"],
296 "author-blocked" => ["author", "blocked"],
297 "author-hidden" => ["author", "hidden"],
298 "owner-id" => ["thread", "owner-id"],
299 "owner-link" => ["owner", "url"],
300 "owner-addr" => ["owner", "addr"],
301 "owner-name" => "IF (`contact`.`url` = `owner`.`url`, `contact`.`name`, `owner`.`name`)",
302 "owner-nick" => ["owner", "nick"],
303 "owner-avatar" => "IF (`contact`.`url` = `owner`.`url`, `contact`.`thumb`, `owner`.`thumb`)",
304 "owner-network" => ["owner", "network"],
305 "owner-blocked" => ["owner", "blocked"],
306 "owner-hidden" => ["owner", "hidden"],
307 "causer-id" => ["item", "causer-id"],
308 "causer-link" => ["causer", "url"],
309 "causer-addr" => ["causer", "addr"],
310 "causer-name" => ["causer", "name"],
311 "causer-nick" => ["causer", "nick"],
312 "causer-avatar" => ["causer", "thumb"],
313 "causer-network" => ["causer", "network"],
314 "causer-blocked" => ["causer", "blocked"],
315 "causer-hidden" => ["causer", "hidden"],
316 "causer-contact-type" => ["causer", "contact-type"],
317 "postopts" => ["post-delivery-data", "postopts"],
318 "inform" => ["post-delivery-data", "inform"],
319 "delivery_queue_count" => ["post-delivery-data", "queue_count"],
320 "delivery_queue_done" => ["post-delivery-data", "queue_done"],
321 "delivery_queue_failed" => ["post-delivery-data", "queue_failed"],
322 "allow_cid" => "IF (`item`.`psid` IS NULL, '', `permissionset`.`allow_cid`)",
323 "allow_gid" => "IF (`item`.`psid` IS NULL, '', `permissionset`.`allow_gid`)",
324 "deny_cid" => "IF (`item`.`psid` IS NULL, '', `permissionset`.`deny_cid`)",
325 "deny_gid" => "IF (`item`.`psid` IS NULL, '', `permissionset`.`deny_gid`)",
326 "event-id" => ["item", "event-id"],
327 "event-created" => ["event", "created"],
328 "event-edited" => ["event", "edited"],
329 "event-start" => ["event", "start"],
330 "event-finish" => ["event", "finish"],
331 "event-summary" => ["event", "summary"],
332 "event-desc" => ["event", "desc"],
333 "event-location" => ["event", "location"],
334 "event-type" => ["event", "type"],
335 "event-nofinish" => ["event", "nofinish"],
336 "event-adjust" => ["event", "adjust"],
337 "event-ignore" => ["event", "ignore"],
338 "signed_text" => ["diaspora-interaction", "interaction"],
339 "parent-guid" => ["parent-item", "guid"],
340 "parent-network" => ["parent-item", "network"],
341 "parent-author-id" => ["parent-item", "author-id"],
342 "parent-author-link" => ["parent-item-author", "url"],
343 "parent-author-name" => ["parent-item-author", "name"],
344 "parent-author-network" => ["parent-item-author", "network"],
346 "query" => "FROM `thread`
347 STRAIGHT_JOIN `item` ON `item`.`id` = `thread`.`iid`
348 STRAIGHT_JOIN `contact` ON `contact`.`id` = `thread`.`contact-id`
349 STRAIGHT_JOIN `contact` AS `author` ON `author`.`id` = `thread`.`author-id`
350 STRAIGHT_JOIN `contact` AS `owner` ON `owner`.`id` = `thread`.`owner-id`
351 STRAIGHT_JOIN `contact` AS `causer` ON `causer`.`id` = `item`.`causer-id`
352 LEFT JOIN `group_member` ON `group_member`.`contact-id` = `thread`.`contact-id`
353 LEFT JOIN `verb` ON `verb`.`id` = `item`.`vid`
354 LEFT JOIN `event` ON `event`.`id` = `item`.`event-id`
355 LEFT JOIN `diaspora-interaction` ON `diaspora-interaction`.`uri-id` = `thread`.`uri-id`
356 LEFT JOIN `item-content` ON `item-content`.`uri-id` = `thread`.`uri-id`
357 LEFT JOIN `post-delivery-data` ON `post-delivery-data`.`uri-id` = `thread`.`uri-id` AND `thread`.`origin`
358 LEFT JOIN `permissionset` ON `permissionset`.`id` = `item`.`psid`
359 STRAIGHT_JOIN `item` AS `parent-item` ON `parent-item`.`uri-id` = `item`.`parent-uri-id` AND `parent-item`.`uid` = `item`.`uid`
360 STRAIGHT_JOIN `contact` AS `parent-item-author` ON `parent-item-author`.`id` = `parent-item`.`author-id`"
364 "uri-id" => ["post-category", "uri-id"],
365 "uid" => ["post-category", "uid"],
366 "uri" => ["item-uri", "uri"],
367 "guid" => ["item-uri", "guid"],
368 "type" => ["post-category", "type"],
369 "tid" => ["post-category", "tid"],
370 "name" => ["tag", "name"],
371 "url" => ["tag", "url"],
373 "query" => "FROM `post-category`
374 INNER JOIN `item-uri` ON `item-uri`.id = `post-category`.`uri-id`
375 LEFT JOIN `tag` ON `post-category`.`tid` = `tag`.`id`"
379 "uri-id" => ["post-tag", "uri-id"],
380 "uri" => ["item-uri", "uri"],
381 "guid" => ["item-uri", "guid"],
382 "type" => ["post-tag", "type"],
383 "tid" => ["post-tag", "tid"],
384 "cid" => ["post-tag", "cid"],
385 "name" => "CASE `cid` WHEN 0 THEN `tag`.`name` ELSE `contact`.`name` END",
386 "url" => "CASE `cid` WHEN 0 THEN `tag`.`url` ELSE `contact`.`url` END",
388 "query" => "FROM `post-tag`
389 INNER JOIN `item-uri` ON `item-uri`.id = `post-tag`.`uri-id`
390 LEFT JOIN `tag` ON `post-tag`.`tid` = `tag`.`id`
391 LEFT JOIN `contact` ON `post-tag`.`cid` = `contact`.`id`"
393 "network-item-view" => [
395 "uri-id" => ["item", "parent-uri-id"],
396 "uri" => ["item", "parent-uri"],
397 "parent" => ["item", "parent"],
398 "received" => ["item", "received"],
399 "commented" => ["item", "commented"],
400 "created" => ["item", "created"],
401 "uid" => ["item", "uid"],
402 "starred" => ["item", "starred"],
403 "mention" => ["item", "mention"],
404 "network" => ["item", "network"],
405 "unseen" => ["item", "unseen"],
406 "gravity" => ["item", "gravity"],
407 "contact-id" => ["item", "contact-id"],
408 "contact-type" => ["ownercontact", "contact-type"],
410 "query" => "FROM `item`
411 INNER JOIN `thread` ON `thread`.`iid` = `item`.`parent`
412 STRAIGHT_JOIN `contact` ON `contact`.`id` = `thread`.`contact-id`
413 LEFT JOIN `user-item` ON `user-item`.`iid` = `item`.`id` AND `user-item`.`uid` = `thread`.`uid`
414 LEFT JOIN `user-contact` AS `author` ON `author`.`uid` = `thread`.`uid` AND `author`.`cid` = `thread`.`author-id`
415 LEFT JOIN `user-contact` AS `owner` ON `owner`.`uid` = `thread`.`uid` AND `owner`.`cid` = `thread`.`owner-id`
416 LEFT JOIN `contact` AS `ownercontact` ON `ownercontact`.`id` = `thread`.`owner-id`
417 WHERE `thread`.`visible` AND NOT `thread`.`deleted` AND NOT `thread`.`moderated`
418 AND (NOT `contact`.`readonly` AND NOT `contact`.`blocked` AND NOT `contact`.`pending`)
419 AND (`user-item`.`hidden` IS NULL OR NOT `user-item`.`hidden`)
420 AND (`author`.`blocked` IS NULL OR NOT `author`.`blocked`)
421 AND (`owner`.`blocked` IS NULL OR NOT `owner`.`blocked`)"
423 "network-thread-view" => [
425 "uri-id" => ["item", "uri-id"],
426 "uri" => ["item", "uri"],
427 "parent-uri-id" => ["item", "parent-uri-id"],
428 "parent" => ["thread", "iid"],
429 "received" => ["thread", "received"],
430 "commented" => ["thread", "commented"],
431 "created" => ["thread", "created"],
432 "uid" => ["thread", "uid"],
433 "starred" => ["thread", "starred"],
434 "mention" => ["thread", "mention"],
435 "network" => ["thread", "network"],
436 "contact-id" => ["thread", "contact-id"],
437 "contact-type" => ["ownercontact", "contact-type"],
439 "query" => "FROM `thread`
440 STRAIGHT_JOIN `contact` ON `contact`.`id` = `thread`.`contact-id`
441 STRAIGHT_JOIN `item` ON `item`.`id` = `thread`.`iid`
442 LEFT JOIN `user-item` ON `user-item`.`iid` = `item`.`id` AND `user-item`.`uid` = `thread`.`uid`
443 LEFT JOIN `user-contact` AS `author` ON `author`.`uid` = `thread`.`uid` AND `author`.`cid` = `thread`.`author-id`
444 LEFT JOIN `user-contact` AS `owner` ON `owner`.`uid` = `thread`.`uid` AND `owner`.`cid` = `thread`.`owner-id`
445 LEFT JOIN `contact` AS `ownercontact` ON `ownercontact`.`id` = `thread`.`owner-id`
446 WHERE `thread`.`visible` AND NOT `thread`.`deleted` AND NOT `thread`.`moderated`
447 AND (NOT `contact`.`readonly` AND NOT `contact`.`blocked` AND NOT `contact`.`pending`)
448 AND (`user-item`.`hidden` IS NULL OR NOT `user-item`.`hidden`)
449 AND (`author`.`blocked` IS NULL OR NOT `author`.`blocked`)
450 AND (`owner`.`blocked` IS NULL OR NOT `owner`.`blocked`)"
454 "id" => ["contact", "id"],
455 "uid" => ["contact", "uid"],
456 "created" => ["contact", "created"],
457 "updated" => ["contact", "updated"],
458 "self" => ["contact", "self"],
459 "remote_self" => ["contact", "remote_self"],
460 "rel" => ["contact", "rel"],
461 "duplex" => ["contact", "duplex"],
462 "network" => ["contact", "network"],
463 "protocol" => ["contact", "protocol"],
464 "name" => ["contact", "name"],
465 "nick" => ["contact", "nick"],
466 "location" => ["contact", "location"],
467 "about" => ["contact", "about"],
468 "keywords" => ["contact", "keywords"],
469 "gender" => ["contact", "gender"],
470 "xmpp" => ["contact", "xmpp"],
471 "attag" => ["contact", "attag"],
472 "avatar" => ["contact", "avatar"],
473 "photo" => ["contact", "photo"],
474 "thumb" => ["contact", "thumb"],
475 "micro" => ["contact", "micro"],
476 "site-pubkey" => ["contact", "site-pubkey"],
477 "issued-id" => ["contact", "issued-id"],
478 "dfrn-id" => ["contact", "dfrn-id"],
479 "url" => ["contact", "url"],
480 "nurl" => ["contact", "nurl"],
481 "addr" => ["contact", "addr"],
482 "alias" => ["contact", "alias"],
483 "pubkey" => ["contact", "pubkey"],
484 "prvkey" => ["contact", "prvkey"],
485 "batch" => ["contact", "batch"],
486 "request" => ["contact", "request"],
487 "notify" => ["contact", "notify"],
488 "poll" => ["contact", "poll"],
489 "confirm" => ["contact", "confirm"],
490 "poco" => ["contact", "poco"],
491 "aes_allow" => ["contact", "aes_allow"],
492 "ret-aes" => ["contact", "ret-aes"],
493 "usehub" => ["contact", "usehub"],
494 "subhub" => ["contact", "subhub"],
495 "hub-verify" => ["contact", "hub-verify"],
496 "last-update" => ["contact", "last-update"],
497 "success_update" => ["contact", "success_update"],
498 "failure_update" => ["contact", "failure_update"],
499 "name-date" => ["contact", "name-date"],
500 "uri-date" => ["contact", "uri-date"],
501 "avatar-date" => ["contact", "avatar-date"],
502 "picdate" => ["contact", "avatar-date"], /// @todo Replaces all uses of "picdate" with "avatar-date"
503 "term-date" => ["contact", "term-date"],
504 "last-item" => ["contact", "last-item"],
505 "priority" => ["contact", "priority"],
506 "blocked" => ["user", "blocked"],
507 "block_reason" => ["contact", "block_reason"],
508 "readonly" => ["contact", "readonly"],
509 "writable" => ["contact", "writable"],
510 "forum" => ["contact", "forum"],
511 "prv" => ["contact", "prv"],
512 "contact-type" => ["contact", "contact-type"],
513 "manually-approve" => ["contact", "manually-approve"],
514 "hidden" => ["contact", "hidden"],
515 "archive" => ["contact", "archive"],
516 "pending" => ["contact", "pending"],
517 "deleted" => ["contact", "deleted"],
518 "unsearchable" => ["contact", "unsearchable"],
519 "sensitive" => ["contact", "sensitive"],
520 "baseurl" => ["contact", "baseurl"],
521 "reason" => ["contact", "reason"],
522 "closeness" => ["contact", "closeness"],
523 "info" => ["contact", "info"],
524 "profile-id" => ["contact", "profile-id"],
525 "bdyear" => ["contact", "bdyear"],
526 "bd" => ["contact", "bd"],
527 "notify_new_posts" => ["contact", "notify_new_posts"],
528 "fetch_further_information" => ["contact", "fetch_further_information"],
529 "ffi_keyword_denylist" => ["contact", "ffi_keyword_denylist"],
530 "parent-uid" => ["user", "parent-uid"],
531 "guid" => ["user", "guid"],
532 "nickname" => ["user", "nickname"], /// @todo Replaces all uses of "nickname" with "nick"
533 "email" => ["user", "email"],
534 "openid" => ["user", "openid"],
535 "timezone" => ["user", "timezone"],
536 "language" => ["user", "language"],
537 "register_date" => ["user", "register_date"],
538 "login_date" => ["user", "login_date"],
539 "default-location" => ["user", "default-location"],
540 "allow_location" => ["user", "allow_location"],
541 "theme" => ["user", "theme"],
542 "upubkey" => ["user", "pubkey"],
543 "uprvkey" => ["user", "prvkey"],
544 "sprvkey" => ["user", "sprvkey"],
545 "spubkey" => ["user", "spubkey"],
546 "verified" => ["user", "verified"],
547 "blockwall" => ["user", "blockwall"],
548 "hidewall" => ["user", "hidewall"],
549 "blocktags" => ["user", "blocktags"],
550 "unkmail" => ["user", "unkmail"],
551 "cntunkmail" => ["user", "cntunkmail"],
552 "notify-flags" => ["user", "notify-flags"],
553 "page-flags" => ["user", "page-flags"],
554 "account-type" => ["user", "account-type"],
555 "prvnets" => ["user", "prvnets"],
556 "maxreq" => ["user", "maxreq"],
557 "expire" => ["user", "expire"],
558 "account_removed" => ["user", "account_removed"],
559 "account_expired" => ["user", "account_expired"],
560 "account_expires_on" => ["user", "account_expires_on"],
561 "expire_notification_sent" => ["user", "expire_notification_sent"],
562 "def_gid" => ["user", "def_gid"],
563 "allow_cid" => ["user", "allow_cid"],
564 "allow_gid" => ["user", "allow_gid"],
565 "deny_cid" => ["user", "deny_cid"],
566 "deny_gid" => ["user", "deny_gid"],
567 "openidserver" => ["user", "openidserver"],
568 "publish" => ["profile", "publish"],
569 "net-publish" => ["profile", "net-publish"],
570 "hide-friends" => ["profile", "hide-friends"],
571 "prv_keywords" => ["profile", "prv_keywords"],
572 "pub_keywords" => ["profile", "pub_keywords"],
573 "address" => ["profile", "address"],
574 "locality" => ["profile", "locality"],
575 "region" => ["profile", "region"],
576 "postal-code" => ["profile", "postal-code"],
577 "country-name" => ["profile", "country-name"],
578 "homepage" => ["profile", "homepage"],
579 "dob" => ["profile", "dob"],
581 "query" => "FROM `user`
582 INNER JOIN `contact` ON `contact`.`uid` = `user`.`uid` AND `contact`.`self`
583 INNER JOIN `profile` ON `profile`.`uid` = `user`.`uid`"
587 "id" => ["register", "id"],
588 "hash" => ["register", "hash"],
589 "created" => ["register", "created"],
590 "uid" => ["register", "uid"],
591 "password" => ["register", "password"],
592 "language" => ["register", "language"],
593 "note" => ["register", "note"],
594 "self" => ["contact", "self"],
595 "name" => ["contact", "name"],
596 "url" => ["contact", "url"],
597 "micro" => ["contact", "micro"],
598 "email" => ["user", "email"],
599 "nick" => ["contact", "nick"],
601 "query" => "FROM `register`
602 INNER JOIN `contact` ON `register`.`uid` = `contact`.`uid`
603 INNER JOIN `user` ON `register`.`uid` = `user`.`uid`"
605 "tag-search-view" => [
607 "uri-id" => ["post-tag", "uri-id"],
608 "iid" => ["item", "id"],
609 "uri" => ["item", "uri"],
610 "guid" => ["item", "guid"],
611 "uid" => ["item", "uid"],
612 "private" => ["item", "private"],
613 "wall" => ["item", "wall"],
614 "origin" => ["item", "origin"],
615 "gravity" => ["item", "gravity"],
616 "received" => ["item", "received"],
617 "name" => ["tag", "name"],
619 "query" => "FROM `post-tag`
620 INNER JOIN `tag` ON `tag`.`id` = `post-tag`.`tid`
621 INNER JOIN `item` ON `item`.`uri-id` = `post-tag`.`uri-id`
622 WHERE `post-tag`.`type` = 1"
624 "workerqueue-view" => [
626 "pid" => ["process", "pid"],
627 "priority" => ["workerqueue", "priority"],
629 "query" => "FROM `process`
630 INNER JOIN `workerqueue` ON `workerqueue`.`pid` = `process`.`pid`
631 WHERE NOT `workerqueue`.`done`"