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