3 * @copyright Copyright (C) 2010-2024, 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`"
61 "circle-member-view" => [
63 "id" => ["group_member", "id"],
64 "uid" => ["group", "uid"],
65 "contact-id" => ["group_member", "contact-id"],
66 "contact-uri-id" => ["contact", "uri-id"],
67 "contact-link" => ["contact", "url"],
68 "contact-addr" => ["contact", "addr"],
69 "contact-name" => ["contact", "name"],
70 "contact-nick" => ["contact", "nick"],
71 "contact-avatar" => ["contact", "thumb"],
72 "contact-network" => ["contact", "network"],
73 "contact-blocked" => ["contact", "blocked"],
74 "contact-hidden" => ["contact", "hidden"],
75 "contact-readonly" => ["contact", "readonly"],
76 "contact-archive" => ["contact", "archive"],
77 "contact-pending" => ["contact", "pending"],
78 "contact-self" => ["contact", "self"],
79 "contact-rel" => ["contact", "rel"],
80 "contact-contact-type" => ["contact", "contact-type"],
81 "circle-id" => ["group_member", "gid"],
82 "circle-visible" => ["group", "visible"],
83 "circle-deleted" => ["group", "deleted"],
84 "circle-name" => ["group", "name"],
86 "query" => "FROM `group_member`
87 INNER JOIN `contact` ON `group_member`.`contact-id` = `contact`.`id`
88 INNER JOIN `group` ON `group_member`.`gid` = `group`.`id`"
90 "post-counts-view" => [
92 "uri-id" => ["post-counts", "uri-id"],
93 "vid" => ["post-counts", "vid"],
94 "verb" => ["verb", "name"],
95 "reaction" => ["post-counts", "reaction"],
96 "parent-uri-id" => ["post-counts", "parent-uri-id"],
97 "count" => ["post-counts", "count"],
99 "query" => "FROM `post-counts`
100 INNER JOIN `verb` ON `verb`.`id` = `post-counts`.`vid`"
102 "post-timeline-view" => [
104 "uid" => ["post-user", "uid"],
105 "uri-id" => ["post-user", "uri-id"],
106 "gravity" => ["post-user", "gravity"],
107 "created" => ["post-user", "created"],
108 "edited" => ["post-user", "edited"],
109 "commented" => ["post-thread-user", "commented"],
110 "received" => ["post-user", "received"],
111 "changed" => ["post-thread-user", "changed"],
112 "private" => ["post-user", "private"],
113 "visible" => ["post-user", "visible"],
114 "deleted" => ["post-user", "deleted"],
115 "origin" => ["post-user", "origin"],
116 "global" => ["post-user", "global"],
117 "network" => ["post-user", "network"],
118 "protocol" => ["post-user", "protocol"],
119 "vid" => ["post-user", "vid"],
120 "contact-id" => ["post-user", "contact-id"],
121 "contact-blocked" => ["contact", "blocked"],
122 "contact-readonly" => ["contact", "readonly"],
123 "contact-pending" => ["contact", "pending"],
124 "contact-rel" => ["contact", "rel"],
125 "contact-uid" => ["contact", "uid"],
126 "self" => ["contact", "self"],
127 "author-id" => ["post-user", "author-id"],
128 "author-blocked" => ["author", "blocked"],
129 "author-hidden" => ["author", "hidden"],
130 "author-gsid" => ["author", "gsid"],
131 "owner-id" => ["post-user", "owner-id"],
132 "owner-blocked" => ["owner", "blocked"],
133 "owner-gsid" => ["owner", "gsid"],
134 "causer-id" => ["post-user", "causer-id"],
135 "causer-blocked" => ["causer", "blocked"],
136 "causer-gsid" => ["causer", "gsid"],
138 "query" => "FROM `post-user`
139 LEFT JOIN `post-thread-user` ON `post-thread-user`.`uri-id` = `post-user`.`parent-uri-id` AND `post-thread-user`.`uid` = `post-user`.`uid`
140 STRAIGHT_JOIN `contact` ON `contact`.`id` = `post-user`.`contact-id`
141 STRAIGHT_JOIN `contact` AS `author` ON `author`.`id` = `post-user`.`author-id`
142 STRAIGHT_JOIN `contact` AS `owner` ON `owner`.`id` = `post-user`.`owner-id`
143 LEFT JOIN `contact` AS `causer` ON `causer`.`id` = `post-user`.`causer-id`"
145 "post-user-view" => [
147 "id" => ["post-user", "id"],
148 "post-user-id" => ["post-user", "id"],
149 "uid" => ["post-user", "uid"],
150 "parent" => ["post-thread-user", "post-user-id"],
151 "uri" => ["item-uri", "uri"],
152 "uri-id" => ["post-user", "uri-id"],
153 "parent-uri" => ["parent-item-uri", "uri"],
154 "parent-uri-id" => ["post-user", "parent-uri-id"],
155 "thr-parent" => ["thr-parent-item-uri", "uri"],
156 "thr-parent-id" => ["post-user", "thr-parent-id"],
157 "conversation" => ["conversation-item-uri", "uri"],
158 "conversation-id" => ["post-thread-user", "conversation-id"],
159 "quote-uri" => ["quote-item-uri", "uri"],
160 "quote-uri-id" => ["post-content", "quote-uri-id"],
161 "guid" => ["item-uri", "guid"],
162 "wall" => ["post-user", "wall"],
163 "gravity" => ["post-user", "gravity"],
164 "extid" => ["external-item-uri", "uri"],
165 "external-id" => ["post-user", "external-id"],
166 "created" => ["post-user", "created"],
167 "edited" => ["post-user", "edited"],
168 "commented" => ["post-thread-user", "commented"],
169 "received" => ["post-user", "received"],
170 "changed" => ["post-thread-user", "changed"],
171 "post-type" => ["post-user", "post-type"],
172 "post-reason" => ["post-user", "post-reason"],
173 "private" => ["post-user", "private"],
174 "pubmail" => ["post-thread-user", "pubmail"],
175 "visible" => ["post-user", "visible"],
176 "starred" => ["post-thread-user", "starred"],
177 "unseen" => ["post-user", "unseen"],
178 "deleted" => ["post-user", "deleted"],
179 "origin" => ["post-user", "origin"],
180 "parent-origin" => ["post-thread-user", "origin"],
181 "mention" => ["post-thread-user", "mention"],
182 "global" => ["post-user", "global"],
183 "featured" => "EXISTS(SELECT `type` FROM `post-collection` WHERE `type` = 0 AND `uri-id` = `post-user`.`uri-id`)",
184 "network" => ["post-user", "network"],
185 "protocol" => ["post-user", "protocol"],
186 "vid" => ["post-user", "vid"],
187 "psid" => ["post-user", "psid"],
188 "verb" => "IF (`post-user`.`vid` IS NULL, '', `verb`.`name`)",
189 "title" => ["post-content", "title"],
190 "content-warning" => ["post-content", "content-warning"],
191 "raw-body" => ["post-content", "raw-body"],
192 "body" => "IFNULL (`post-content`.`body`, '')",
193 "rendered-hash" => ["post-content", "rendered-hash"],
194 "rendered-html" => ["post-content", "rendered-html"],
195 "language" => ["post-content", "language"],
196 "plink" => ["post-content", "plink"],
197 "location" => ["post-content", "location"],
198 "coord" => ["post-content", "coord"],
199 "app" => ["post-content", "app"],
200 "object-type" => ["post-content", "object-type"],
201 "object" => ["post-content", "object"],
202 "target-type" => ["post-content", "target-type"],
203 "target" => ["post-content", "target"],
204 "resource-id" => ["post-content", "resource-id"],
205 "contact-id" => ["post-user", "contact-id"],
206 "contact-uri-id" => ["contact", "uri-id"],
207 "contact-link" => ["contact", "url"],
208 "contact-addr" => ["contact", "addr"],
209 "contact-name" => ["contact", "name"],
210 "contact-nick" => ["contact", "nick"],
211 "contact-avatar" => ["contact", "thumb"],
212 "contact-network" => ["contact", "network"],
213 "contact-blocked" => ["contact", "blocked"],
214 "contact-hidden" => ["contact", "hidden"],
215 "contact-readonly" => ["contact", "readonly"],
216 "contact-archive" => ["contact", "archive"],
217 "contact-pending" => ["contact", "pending"],
218 "contact-rel" => ["contact", "rel"],
219 "contact-uid" => ["contact", "uid"],
220 "contact-contact-type" => ["contact", "contact-type"],
221 "writable" => "IF (`post-user`.`network` IN ('apub', 'dfrn', 'dspr', 'stat'), true, `contact`.`writable`)",
222 "self" => ["contact", "self"],
223 "cid" => ["contact", "id"],
224 "alias" => ["contact", "alias"],
225 "photo" => ["contact", "photo"],
226 "name-date" => ["contact", "name-date"],
227 "uri-date" => ["contact", "uri-date"],
228 "avatar-date" => ["contact", "avatar-date"],
229 "thumb" => ["contact", "thumb"],
230 "author-id" => ["post-user", "author-id"],
231 "author-uri-id" => ["author", "uri-id"],
232 "author-link" => ["author", "url"],
233 "author-addr" => ["author", "addr"],
234 "author-name" => "IF (`contact`.`url` = `author`.`url` AND `contact`.`name` != '', `contact`.`name`, `author`.`name`)",
235 "author-nick" => ["author", "nick"],
236 "author-alias" => ["author", "alias"],
237 "author-avatar" => "IF (`contact`.`url` = `author`.`url` AND `contact`.`thumb` != '', `contact`.`thumb`, `author`.`thumb`)",
238 "author-network" => ["author", "network"],
239 "author-blocked" => ["author", "blocked"],
240 "author-hidden" => ["author", "hidden"],
241 "author-updated" => ["author", "updated"],
242 "author-contact-type" => ["author", "contact-type"],
243 "author-gsid" => ["author", "gsid"],
244 "author-baseurl" => ["author", "baseurl"],
245 "owner-id" => ["post-user", "owner-id"],
246 "owner-uri-id" => ["owner", "uri-id"],
247 "owner-link" => ["owner", "url"],
248 "owner-addr" => ["owner", "addr"],
249 "owner-name" => "IF (`contact`.`url` = `owner`.`url` AND `contact`.`name` != '', `contact`.`name`, `owner`.`name`)",
250 "owner-nick" => ["owner", "nick"],
251 "owner-alias" => ["owner", "alias"],
252 "owner-avatar" => "IF (`contact`.`url` = `owner`.`url` AND `contact`.`thumb` != '', `contact`.`thumb`, `owner`.`thumb`)",
253 "owner-network" => ["owner", "network"],
254 "owner-blocked" => ["owner", "blocked"],
255 "owner-hidden" => ["owner", "hidden"],
256 "owner-updated" => ["owner", "updated"],
257 "owner-gsid" => ["owner", "gsid"],
258 "owner-contact-type" => ["owner", "contact-type"],
259 "causer-id" => ["post-user", "causer-id"],
260 "causer-uri-id" => ["causer", "uri-id"],
261 "causer-link" => ["causer", "url"],
262 "causer-addr" => ["causer", "addr"],
263 "causer-name" => ["causer", "name"],
264 "causer-nick" => ["causer", "nick"],
265 "causer-alias" => ["causer", "alias"],
266 "causer-avatar" => ["causer", "thumb"],
267 "causer-network" => ["causer", "network"],
268 "causer-blocked" => ["causer", "blocked"],
269 "causer-hidden" => ["causer", "hidden"],
270 "causer-gsid" => ["causer", "gsid"],
271 "causer-contact-type" => ["causer", "contact-type"],
272 "postopts" => ["post-delivery-data", "postopts"],
273 "inform" => ["post-delivery-data", "inform"],
274 "delivery_queue_count" => ["post-delivery-data", "queue_count"],
275 "delivery_queue_done" => ["post-delivery-data", "queue_done"],
276 "delivery_queue_failed" => ["post-delivery-data", "queue_failed"],
277 "allow_cid" => "IF (`post-user`.`psid` IS NULL, '', `permissionset`.`allow_cid`)",
278 "allow_gid" => "IF (`post-user`.`psid` IS NULL, '', `permissionset`.`allow_gid`)",
279 "deny_cid" => "IF (`post-user`.`psid` IS NULL, '', `permissionset`.`deny_cid`)",
280 "deny_gid" => "IF (`post-user`.`psid` IS NULL, '', `permissionset`.`deny_gid`)",
281 "event-id" => ["post-user", "event-id"],
282 "event-created" => ["event", "created"],
283 "event-edited" => ["event", "edited"],
284 "event-start" => ["event", "start"],
285 "event-finish" => ["event", "finish"],
286 "event-summary" => ["event", "summary"],
287 "event-desc" => ["event", "desc"],
288 "event-location" => ["event", "location"],
289 "event-type" => ["event", "type"],
290 "event-nofinish" => ["event", "nofinish"],
291 "event-ignore" => ["event", "ignore"],
292 "question-id" => ["post-question", "id"],
293 "question-multiple" => ["post-question", "multiple"],
294 "question-voters" => ["post-question", "voters"],
295 "question-end-time" => ["post-question", "end-time"],
296 "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`)",
297 "has-media" => "EXISTS(SELECT `id` FROM `post-media` WHERE `post-media`.`uri-id` = `post-user`.`uri-id`)",
298 "signed_text" => ["diaspora-interaction", "interaction"],
299 "parent-guid" => ["parent-item-uri", "guid"],
300 "parent-network" => ["post-thread-user", "network"],
301 "parent-author-id" => ["post-thread-user", "author-id"],
302 "parent-author-link" => ["parent-post-author", "url"],
303 "parent-author-name" => ["parent-post-author", "name"],
304 "parent-author-nick" => ["parent-post-author", "nick"],
305 "parent-author-network" => ["parent-post-author", "network"],
307 "query" => "FROM `post-user`
308 INNER JOIN `post-thread-user` ON `post-thread-user`.`uri-id` = `post-user`.`parent-uri-id` AND `post-thread-user`.`uid` = `post-user`.`uid`
309 STRAIGHT_JOIN `contact` ON `contact`.`id` = `post-user`.`contact-id`
310 STRAIGHT_JOIN `contact` AS `author` ON `author`.`id` = `post-user`.`author-id`
311 STRAIGHT_JOIN `contact` AS `owner` ON `owner`.`id` = `post-user`.`owner-id`
312 LEFT JOIN `contact` AS `causer` ON `causer`.`id` = `post-user`.`causer-id`
313 LEFT JOIN `item-uri` ON `item-uri`.`id` = `post-user`.`uri-id`
314 LEFT JOIN `item-uri` AS `thr-parent-item-uri` ON `thr-parent-item-uri`.`id` = `post-user`.`thr-parent-id`
315 LEFT JOIN `item-uri` AS `parent-item-uri` ON `parent-item-uri`.`id` = `post-user`.`parent-uri-id`
316 LEFT JOIN `item-uri` AS `conversation-item-uri` ON `conversation-item-uri`.`id` = `post-thread-user`.`conversation-id`
317 LEFT JOIN `item-uri` AS `external-item-uri` ON `external-item-uri`.`id` = `post-user`.`external-id`
318 LEFT JOIN `verb` ON `verb`.`id` = `post-user`.`vid`
319 LEFT JOIN `event` ON `event`.`id` = `post-user`.`event-id`
320 LEFT JOIN `diaspora-interaction` ON `diaspora-interaction`.`uri-id` = `post-user`.`uri-id`
321 LEFT JOIN `post-content` ON `post-content`.`uri-id` = `post-user`.`uri-id`
322 LEFT JOIN `item-uri` AS `quote-item-uri` ON `quote-item-uri`.`id` = `post-content`.`quote-uri-id`
323 LEFT JOIN `post-delivery-data` ON `post-delivery-data`.`uri-id` = `post-user`.`uri-id` AND `post-user`.`origin`
324 LEFT JOIN `post-question` ON `post-question`.`uri-id` = `post-user`.`uri-id`
325 LEFT JOIN `permissionset` ON `permissionset`.`id` = `post-user`.`psid`
326 LEFT JOIN `contact` AS `parent-post-author` ON `parent-post-author`.`id` = `post-thread-user`.`author-id`"
328 "post-thread-user-view" => [
330 "id" => ["post-user", "id"],
331 "post-user-id" => ["post-user", "id"],
332 "uid" => ["post-thread-user", "uid"],
333 "parent" => ["post-thread-user", "post-user-id"],
334 "uri" => ["item-uri", "uri"],
335 "uri-id" => ["post-thread-user", "uri-id"],
336 "parent-uri" => ["parent-item-uri", "uri"],
337 "parent-uri-id" => ["post-user", "parent-uri-id"],
338 "thr-parent" => ["thr-parent-item-uri", "uri"],
339 "thr-parent-id" => ["post-user", "thr-parent-id"],
340 "conversation" => ["conversation-item-uri", "uri"],
341 "conversation-id" => ["post-thread-user", "conversation-id"],
342 "quote-uri" => ["quote-item-uri", "uri"],
343 "quote-uri-id" => ["post-content", "quote-uri-id"],
344 "guid" => ["item-uri", "guid"],
345 "wall" => ["post-thread-user", "wall"],
346 "gravity" => ["post-user", "gravity"],
347 "extid" => ["external-item-uri", "uri"],
348 "external-id" => ["post-user", "external-id"],
349 "created" => ["post-thread-user", "created"],
350 "edited" => ["post-user", "edited"],
351 "commented" => ["post-thread-user", "commented"],
352 "received" => ["post-thread-user", "received"],
353 "changed" => ["post-thread-user", "changed"],
354 "post-type" => ["post-user", "post-type"],
355 "post-reason" => ["post-user", "post-reason"],
356 "private" => ["post-user", "private"],
357 "pubmail" => ["post-thread-user", "pubmail"],
358 "ignored" => ["post-thread-user", "ignored"],
359 "visible" => ["post-user", "visible"],
360 "starred" => ["post-thread-user", "starred"],
361 "unseen" => ["post-thread-user", "unseen"],
362 "deleted" => ["post-user", "deleted"],
363 "origin" => ["post-thread-user", "origin"],
364 "mention" => ["post-thread-user", "mention"],
365 "global" => ["post-user", "global"],
366 "featured" => "EXISTS(SELECT `type` FROM `post-collection` WHERE `type` = 0 AND `uri-id` = `post-thread-user`.`uri-id`)",
367 "network" => ["post-thread-user", "network"],
368 "vid" => ["post-user", "vid"],
369 "psid" => ["post-thread-user", "psid"],
370 "verb" => "IF (`post-user`.`vid` IS NULL, '', `verb`.`name`)",
371 "title" => ["post-content", "title"],
372 "content-warning" => ["post-content", "content-warning"],
373 "raw-body" => ["post-content", "raw-body"],
374 "body" => ["post-content", "body"],
375 "rendered-hash" => ["post-content", "rendered-hash"],
376 "rendered-html" => ["post-content", "rendered-html"],
377 "language" => ["post-content", "language"],
378 "plink" => ["post-content", "plink"],
379 "location" => ["post-content", "location"],
380 "coord" => ["post-content", "coord"],
381 "app" => ["post-content", "app"],
382 "object-type" => ["post-content", "object-type"],
383 "object" => ["post-content", "object"],
384 "target-type" => ["post-content", "target-type"],
385 "target" => ["post-content", "target"],
386 "resource-id" => ["post-content", "resource-id"],
387 "contact-id" => ["post-thread-user", "contact-id"],
388 "contact-uri-id" => ["contact", "uri-id"],
389 "contact-link" => ["contact", "url"],
390 "contact-addr" => ["contact", "addr"],
391 "contact-name" => ["contact", "name"],
392 "contact-nick" => ["contact", "nick"],
393 "contact-avatar" => ["contact", "thumb"],
394 "contact-network" => ["contact", "network"],
395 "contact-blocked" => ["contact", "blocked"],
396 "contact-hidden" => ["contact", "hidden"],
397 "contact-readonly" => ["contact", "readonly"],
398 "contact-archive" => ["contact", "archive"],
399 "contact-pending" => ["contact", "pending"],
400 "contact-rel" => ["contact", "rel"],
401 "contact-uid" => ["contact", "uid"],
402 "contact-gsid" => ["contact", "gsid"],
403 "contact-contact-type" => ["contact", "contact-type"],
404 "writable" => "IF (`post-user`.`network` IN ('apub', 'dfrn', 'dspr', 'stat'), true, `contact`.`writable`)",
405 "self" => ["contact", "self"],
406 "cid" => ["contact", "id"],
407 "alias" => ["contact", "alias"],
408 "photo" => ["contact", "photo"],
409 "name-date" => ["contact", "name-date"],
410 "uri-date" => ["contact", "uri-date"],
411 "avatar-date" => ["contact", "avatar-date"],
412 "thumb" => ["contact", "thumb"],
413 "author-id" => ["post-thread-user", "author-id"],
414 "author-uri-id" => ["author", "uri-id"],
415 "author-link" => ["author", "url"],
416 "author-addr" => ["author", "addr"],
417 "author-name" => "IF (`contact`.`url` = `author`.`url` AND `contact`.`name` != '', `contact`.`name`, `author`.`name`)",
418 "author-nick" => ["author", "nick"],
419 "author-alias" => ["author", "alias"],
420 "author-avatar" => "IF (`contact`.`url` = `author`.`url` AND `contact`.`thumb` != '', `contact`.`thumb`, `author`.`thumb`)",
421 "author-network" => ["author", "network"],
422 "author-blocked" => ["author", "blocked"],
423 "author-hidden" => ["author", "hidden"],
424 "author-updated" => ["author", "updated"],
425 "author-contact-type" => ["author", "contact-type"],
426 "author-gsid" => ["author", "gsid"],
427 "owner-id" => ["post-thread-user", "owner-id"],
428 "owner-uri-id" => ["owner", "uri-id"],
429 "owner-link" => ["owner", "url"],
430 "owner-addr" => ["owner", "addr"],
431 "owner-name" => "IF (`contact`.`url` = `owner`.`url` AND `contact`.`name` != '', `contact`.`name`, `owner`.`name`)",
432 "owner-nick" => ["owner", "nick"],
433 "owner-alias" => ["owner", "alias"],
434 "owner-avatar" => "IF (`contact`.`url` = `owner`.`url` AND `contact`.`thumb` != '', `contact`.`thumb`, `owner`.`thumb`)",
435 "owner-network" => ["owner", "network"],
436 "owner-blocked" => ["owner", "blocked"],
437 "owner-hidden" => ["owner", "hidden"],
438 "owner-updated" => ["owner", "updated"],
439 "owner-gsid" => ["owner", "gsid"],
440 "owner-contact-type" => ["owner", "contact-type"],
441 "causer-id" => ["post-thread-user", "causer-id"],
442 "causer-uri-id" => ["causer", "uri-id"],
443 "causer-link" => ["causer", "url"],
444 "causer-addr" => ["causer", "addr"],
445 "causer-name" => ["causer", "name"],
446 "causer-nick" => ["causer", "nick"],
447 "causer-alias" => ["causer", "alias"],
448 "causer-avatar" => ["causer", "thumb"],
449 "causer-network" => ["causer", "network"],
450 "causer-blocked" => ["causer", "blocked"],
451 "causer-hidden" => ["causer", "hidden"],
452 "causer-gsid" => ["causer", "gsid"],
453 "causer-contact-type" => ["causer", "contact-type"],
454 "postopts" => ["post-delivery-data", "postopts"],
455 "inform" => ["post-delivery-data", "inform"],
456 "delivery_queue_count" => ["post-delivery-data", "queue_count"],
457 "delivery_queue_done" => ["post-delivery-data", "queue_done"],
458 "delivery_queue_failed" => ["post-delivery-data", "queue_failed"],
459 "allow_cid" => "IF (`post-thread-user`.`psid` IS NULL, '', `permissionset`.`allow_cid`)",
460 "allow_gid" => "IF (`post-thread-user`.`psid` IS NULL, '', `permissionset`.`allow_gid`)",
461 "deny_cid" => "IF (`post-thread-user`.`psid` IS NULL, '', `permissionset`.`deny_cid`)",
462 "deny_gid" => "IF (`post-thread-user`.`psid` IS NULL, '', `permissionset`.`deny_gid`)",
463 "event-id" => ["post-user", "event-id"],
464 "event-created" => ["event", "created"],
465 "event-edited" => ["event", "edited"],
466 "event-start" => ["event", "start"],
467 "event-finish" => ["event", "finish"],
468 "event-summary" => ["event", "summary"],
469 "event-desc" => ["event", "desc"],
470 "event-location" => ["event", "location"],
471 "event-type" => ["event", "type"],
472 "event-nofinish" => ["event", "nofinish"],
473 "event-ignore" => ["event", "ignore"],
474 "question-id" => ["post-question", "id"],
475 "question-multiple" => ["post-question", "multiple"],
476 "question-voters" => ["post-question", "voters"],
477 "question-end-time" => ["post-question", "end-time"],
478 "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`)",
479 "has-media" => "EXISTS(SELECT `id` FROM `post-media` WHERE `post-media`.`uri-id` = `post-thread-user`.`uri-id`)",
480 "signed_text" => ["diaspora-interaction", "interaction"],
481 "parent-guid" => ["parent-item-uri", "guid"],
482 "parent-network" => ["post-thread-user", "network"],
483 "parent-author-id" => ["post-thread-user", "author-id"],
484 "parent-author-link" => ["author", "url"],
485 "parent-author-name" => ["author", "name"],
486 "parent-author-nick" => ["author", "nick"],
487 "parent-author-network" => ["author", "network"],
489 "query" => "FROM `post-thread-user`
490 INNER JOIN `post-user` ON `post-user`.`id` = `post-thread-user`.`post-user-id`
491 STRAIGHT_JOIN `contact` ON `contact`.`id` = `post-thread-user`.`contact-id`
492 STRAIGHT_JOIN `contact` AS `author` ON `author`.`id` = `post-thread-user`.`author-id`
493 STRAIGHT_JOIN `contact` AS `owner` ON `owner`.`id` = `post-thread-user`.`owner-id`
494 LEFT JOIN `contact` AS `causer` ON `causer`.`id` = `post-thread-user`.`causer-id`
495 LEFT JOIN `item-uri` ON `item-uri`.`id` = `post-thread-user`.`uri-id`
496 LEFT JOIN `item-uri` AS `thr-parent-item-uri` ON `thr-parent-item-uri`.`id` = `post-user`.`thr-parent-id`
497 LEFT JOIN `item-uri` AS `parent-item-uri` ON `parent-item-uri`.`id` = `post-user`.`parent-uri-id`
498 LEFT JOIN `item-uri` AS `conversation-item-uri` ON `conversation-item-uri`.`id` = `post-thread-user`.`conversation-id`
499 LEFT JOIN `item-uri` AS `external-item-uri` ON `external-item-uri`.`id` = `post-user`.`external-id`
500 LEFT JOIN `verb` ON `verb`.`id` = `post-user`.`vid`
501 LEFT JOIN `event` ON `event`.`id` = `post-user`.`event-id`
502 LEFT JOIN `diaspora-interaction` ON `diaspora-interaction`.`uri-id` = `post-thread-user`.`uri-id`
503 LEFT JOIN `post-content` ON `post-content`.`uri-id` = `post-thread-user`.`uri-id`
504 LEFT JOIN `item-uri` AS `quote-item-uri` ON `quote-item-uri`.`id` = `post-content`.`quote-uri-id`
505 LEFT JOIN `post-delivery-data` ON `post-delivery-data`.`uri-id` = `post-thread-user`.`uri-id` AND `post-thread-user`.`origin`
506 LEFT JOIN `post-question` ON `post-question`.`uri-id` = `post-thread-user`.`uri-id`
507 LEFT JOIN `permissionset` ON `permissionset`.`id` = `post-thread-user`.`psid`"
511 "uri" => ["item-uri", "uri"],
512 "uri-id" => ["post", "uri-id"],
513 "parent-uri" => ["parent-item-uri", "uri"],
514 "parent-uri-id" => ["post", "parent-uri-id"],
515 "thr-parent" => ["thr-parent-item-uri", "uri"],
516 "thr-parent-id" => ["post", "thr-parent-id"],
517 "conversation" => ["conversation-item-uri", "uri"],
518 "conversation-id" => ["post-thread", "conversation-id"],
519 "quote-uri" => ["quote-item-uri", "uri"],
520 "quote-uri-id" => ["post-content", "quote-uri-id"],
521 "guid" => ["item-uri", "guid"],
522 "gravity" => ["post", "gravity"],
523 "extid" => ["external-item-uri", "uri"],
524 "external-id" => ["post", "external-id"],
525 "created" => ["post", "created"],
526 "edited" => ["post", "edited"],
527 "commented" => ["post-thread", "commented"],
528 "received" => ["post", "received"],
529 "changed" => ["post-thread", "changed"],
530 "post-type" => ["post", "post-type"],
531 "private" => ["post", "private"],
532 "visible" => ["post", "visible"],
533 "deleted" => ["post", "deleted"],
534 "global" => ["post", "global"],
535 "featured" => "EXISTS(SELECT `type` FROM `post-collection` WHERE `type` = 0 AND `uri-id` = `post`.`uri-id`)",
536 "network" => ["post", "network"],
537 "vid" => ["post", "vid"],
538 "verb" => "IF (`post`.`vid` IS NULL, '', `verb`.`name`)",
539 "title" => ["post-content", "title"],
540 "content-warning" => ["post-content", "content-warning"],
541 "raw-body" => ["post-content", "raw-body"],
542 "body" => ["post-content", "body"],
543 "rendered-hash" => ["post-content", "rendered-hash"],
544 "rendered-html" => ["post-content", "rendered-html"],
545 "language" => ["post-content", "language"],
546 "plink" => ["post-content", "plink"],
547 "location" => ["post-content", "location"],
548 "coord" => ["post-content", "coord"],
549 "app" => ["post-content", "app"],
550 "object-type" => ["post-content", "object-type"],
551 "object" => ["post-content", "object"],
552 "target-type" => ["post-content", "target-type"],
553 "target" => ["post-content", "target"],
554 "resource-id" => ["post-content", "resource-id"],
555 "contact-id" => ["post", "author-id"],
556 "contact-uri-id" => ["author", "uri-id"],
557 "contact-link" => ["author", "url"],
558 "contact-addr" => ["author", "addr"],
559 "contact-name" => ["author", "name"],
560 "contact-nick" => ["author", "nick"],
561 "contact-avatar" => ["author", "thumb"],
562 "contact-network" => ["author", "network"],
563 "contact-blocked" => ["author", "blocked"],
564 "contact-hidden" => ["author", "hidden"],
565 "contact-readonly" => ["author", "readonly"],
566 "contact-archive" => ["author", "archive"],
567 "contact-pending" => ["author", "pending"],
568 "contact-rel" => ["author", "rel"],
569 "contact-uid" => ["author", "uid"],
570 "contact-contact-type" => ["author", "contact-type"],
571 "writable" => "IF (`post`.`network` IN ('apub', 'dfrn', 'dspr', 'stat'), true, `author`.`writable`)",
573 "cid" => ["author", "id"],
574 "alias" => ["author", "alias"],
575 "photo" => ["author", "photo"],
576 "name-date" => ["author", "name-date"],
577 "uri-date" => ["author", "uri-date"],
578 "avatar-date" => ["author", "avatar-date"],
579 "thumb" => ["author", "thumb"],
580 "author-id" => ["post", "author-id"],
581 "author-uri-id" => ["author", "uri-id"],
582 "author-link" => ["author", "url"],
583 "author-addr" => ["author", "addr"],
584 "author-name" => ["author", "name"],
585 "author-nick" => ["author", "nick"],
586 "author-alias" => ["author", "alias"],
587 "author-avatar" => ["author", "thumb"],
588 "author-network" => ["author", "network"],
589 "author-blocked" => ["author", "blocked"],
590 "author-hidden" => ["author", "hidden"],
591 "author-updated" => ["author", "updated"],
592 "author-contact-type" => ["author", "contact-type"],
593 "author-gsid" => ["author", "gsid"],
594 "owner-id" => ["post", "owner-id"],
595 "owner-uri-id" => ["owner", "uri-id"],
596 "owner-link" => ["owner", "url"],
597 "owner-addr" => ["owner", "addr"],
598 "owner-name" => ["owner", "name"],
599 "owner-nick" => ["owner", "nick"],
600 "owner-alias" => ["owner", "alias"],
601 "owner-avatar" => ["owner", "thumb"],
602 "owner-network" => ["owner", "network"],
603 "owner-blocked" => ["owner", "blocked"],
604 "owner-hidden" => ["owner", "hidden"],
605 "owner-updated" => ["owner", "updated"],
606 "owner-contact-type" => ["owner", "contact-type"],
607 "owner-gsid" => ["owner", "gsid"],
608 "causer-id" => ["post", "causer-id"],
609 "causer-uri-id" => ["causer", "uri-id"],
610 "causer-link" => ["causer", "url"],
611 "causer-addr" => ["causer", "addr"],
612 "causer-name" => ["causer", "name"],
613 "causer-nick" => ["causer", "nick"],
614 "causer-alias" => ["causer", "alias"],
615 "causer-avatar" => ["causer", "thumb"],
616 "causer-network" => ["causer", "network"],
617 "causer-blocked" => ["causer", "blocked"],
618 "causer-hidden" => ["causer", "hidden"],
619 "causer-contact-type" => ["causer", "contact-type"],
620 "causer-gsid" => ["causer", "gsid"],
621 "question-id" => ["post-question", "id"],
622 "question-multiple" => ["post-question", "multiple"],
623 "question-voters" => ["post-question", "voters"],
624 "question-end-time" => ["post-question", "end-time"],
625 "has-categories" => "0",
626 "has-media" => "EXISTS(SELECT `id` FROM `post-media` WHERE `post-media`.`uri-id` = `post`.`uri-id`)",
627 "signed_text" => ["diaspora-interaction", "interaction"],
628 "parent-guid" => ["parent-item-uri", "guid"],
629 "parent-network" => ["post-thread", "network"],
630 "parent-author-id" => ["post-thread", "author-id"],
631 "parent-author-link" => ["parent-post-author", "url"],
632 "parent-author-name" => ["parent-post-author", "name"],
633 "parent-author-nick" => ["parent-post-author", "nick"],
634 "parent-author-network" => ["parent-post-author", "network"],
636 "query" => "FROM `post`
637 STRAIGHT_JOIN `post-thread` ON `post-thread`.`uri-id` = `post`.`parent-uri-id`
638 STRAIGHT_JOIN `contact` AS `author` ON `author`.`id` = `post`.`author-id`
639 STRAIGHT_JOIN `contact` AS `owner` ON `owner`.`id` = `post`.`owner-id`
640 LEFT JOIN `contact` AS `causer` ON `causer`.`id` = `post`.`causer-id`
641 LEFT JOIN `item-uri` ON `item-uri`.`id` = `post`.`uri-id`
642 LEFT JOIN `item-uri` AS `thr-parent-item-uri` ON `thr-parent-item-uri`.`id` = `post`.`thr-parent-id`
643 LEFT JOIN `item-uri` AS `parent-item-uri` ON `parent-item-uri`.`id` = `post`.`parent-uri-id`
644 LEFT JOIN `item-uri` AS `conversation-item-uri` ON `conversation-item-uri`.`id` = `post-thread`.`conversation-id`
645 LEFT JOIN `item-uri` AS `external-item-uri` ON `external-item-uri`.`id` = `post`.`external-id`
646 LEFT JOIN `verb` ON `verb`.`id` = `post`.`vid`
647 LEFT JOIN `diaspora-interaction` ON `diaspora-interaction`.`uri-id` = `post`.`uri-id`
648 LEFT JOIN `post-content` ON `post-content`.`uri-id` = `post`.`uri-id`
649 LEFT JOIN `item-uri` AS `quote-item-uri` ON `quote-item-uri`.`id` = `post-content`.`quote-uri-id`
650 LEFT JOIN `post-question` ON `post-question`.`uri-id` = `post`.`uri-id`
651 LEFT JOIN `contact` AS `parent-post-author` ON `parent-post-author`.`id` = `post-thread`.`author-id`"
653 "post-thread-view" => [
655 "uri" => ["item-uri", "uri"],
656 "uri-id" => ["post-thread", "uri-id"],
657 "parent-uri" => ["parent-item-uri", "uri"],
658 "parent-uri-id" => ["post", "parent-uri-id"],
659 "thr-parent" => ["thr-parent-item-uri", "uri"],
660 "thr-parent-id" => ["post", "thr-parent-id"],
661 "conversation" => ["conversation-item-uri", "uri"],
662 "conversation-id" => ["post-thread", "conversation-id"],
663 "quote-uri" => ["quote-item-uri", "uri"],
664 "quote-uri-id" => ["post-content", "quote-uri-id"],
665 "guid" => ["item-uri", "guid"],
666 "gravity" => ["post", "gravity"],
667 "extid" => ["external-item-uri", "uri"],
668 "external-id" => ["post", "external-id"],
669 "created" => ["post-thread", "created"],
670 "edited" => ["post", "edited"],
671 "commented" => ["post-thread", "commented"],
672 "received" => ["post-thread", "received"],
673 "changed" => ["post-thread", "changed"],
674 "post-type" => ["post", "post-type"],
675 "private" => ["post", "private"],
676 "visible" => ["post", "visible"],
677 "deleted" => ["post", "deleted"],
678 "global" => ["post", "global"],
679 "featured" => "EXISTS(SELECT `type` FROM `post-collection` WHERE `type` = 0 AND `uri-id` = `post-thread`.`uri-id`)",
680 "network" => ["post-thread", "network"],
681 "vid" => ["post", "vid"],
682 "verb" => "IF (`post`.`vid` IS NULL, '', `verb`.`name`)",
683 "title" => ["post-content", "title"],
684 "content-warning" => ["post-content", "content-warning"],
685 "raw-body" => ["post-content", "raw-body"],
686 "body" => ["post-content", "body"],
687 "rendered-hash" => ["post-content", "rendered-hash"],
688 "rendered-html" => ["post-content", "rendered-html"],
689 "language" => ["post-content", "language"],
690 "plink" => ["post-content", "plink"],
691 "location" => ["post-content", "location"],
692 "coord" => ["post-content", "coord"],
693 "app" => ["post-content", "app"],
694 "object-type" => ["post-content", "object-type"],
695 "object" => ["post-content", "object"],
696 "target-type" => ["post-content", "target-type"],
697 "target" => ["post-content", "target"],
698 "resource-id" => ["post-content", "resource-id"],
699 "contact-id" => ["post-thread", "author-id"],
700 "contact-uri-id" => ["author", "uri-id"],
701 "contact-link" => ["author", "url"],
702 "contact-addr" => ["author", "addr"],
703 "contact-name" => ["author", "name"],
704 "contact-nick" => ["author", "nick"],
705 "contact-avatar" => ["author", "thumb"],
706 "contact-network" => ["author", "network"],
707 "contact-blocked" => ["author", "blocked"],
708 "contact-hidden" => ["author", "hidden"],
709 "contact-readonly" => ["author", "readonly"],
710 "contact-archive" => ["author", "archive"],
711 "contact-pending" => ["author", "pending"],
712 "contact-rel" => ["author", "rel"],
713 "contact-uid" => ["author", "uid"],
714 "contact-contact-type" => ["author", "contact-type"],
715 "writable" => "IF (`post`.`network` IN ('apub', 'dfrn', 'dspr', 'stat'), true, `author`.`writable`)",
717 "cid" => ["author", "id"],
718 "alias" => ["author", "alias"],
719 "photo" => ["author", "photo"],
720 "name-date" => ["author", "name-date"],
721 "uri-date" => ["author", "uri-date"],
722 "avatar-date" => ["author", "avatar-date"],
723 "thumb" => ["author", "thumb"],
724 "author-id" => ["post-thread", "author-id"],
725 "author-uri-id" => ["author", "uri-id"],
726 "author-link" => ["author", "url"],
727 "author-addr" => ["author", "addr"],
728 "author-name" => ["author", "name"],
729 "author-nick" => ["author", "nick"],
730 "author-alias" => ["author", "alias"],
731 "author-avatar" => ["author", "thumb"],
732 "author-network" => ["author", "network"],
733 "author-blocked" => ["author", "blocked"],
734 "author-hidden" => ["author", "hidden"],
735 "author-updated" => ["author", "updated"],
736 "author-contact-type" => ["author", "contact-type"],
737 "author-gsid" => ["author", "gsid"],
738 "owner-id" => ["post-thread", "owner-id"],
739 "owner-uri-id" => ["owner", "uri-id"],
740 "owner-link" => ["owner", "url"],
741 "owner-addr" => ["owner", "addr"],
742 "owner-name" => ["owner", "name"],
743 "owner-nick" => ["owner", "nick"],
744 "owner-alias" => ["owner", "alias"],
745 "owner-avatar" => ["owner", "thumb"],
746 "owner-network" => ["owner", "network"],
747 "owner-blocked" => ["owner", "blocked"],
748 "owner-hidden" => ["owner", "hidden"],
749 "owner-updated" => ["owner", "updated"],
750 "owner-gsid" => ["owner", "gsid"],
751 "owner-contact-type" => ["owner", "contact-type"],
752 "causer-id" => ["post-thread", "causer-id"],
753 "causer-uri-id" => ["causer", "uri-id"],
754 "causer-link" => ["causer", "url"],
755 "causer-addr" => ["causer", "addr"],
756 "causer-name" => ["causer", "name"],
757 "causer-nick" => ["causer", "nick"],
758 "causer-alias" => ["causer", "alias"],
759 "causer-avatar" => ["causer", "thumb"],
760 "causer-network" => ["causer", "network"],
761 "causer-blocked" => ["causer", "blocked"],
762 "causer-hidden" => ["causer", "hidden"],
763 "causer-gsid" => ["causer", "gsid"],
764 "causer-contact-type" => ["causer", "contact-type"],
765 "question-id" => ["post-question", "id"],
766 "question-multiple" => ["post-question", "multiple"],
767 "question-voters" => ["post-question", "voters"],
768 "question-end-time" => ["post-question", "end-time"],
769 "has-categories" => "0",
770 "has-media" => "EXISTS(SELECT `id` FROM `post-media` WHERE `post-media`.`uri-id` = `post-thread`.`uri-id`)",
771 "total-comments" => "(SELECT COUNT(*) FROM `post` WHERE `parent-uri-id` = `post-thread`.`uri-id` AND `gravity` = 6)",
772 "total-actors" => "(SELECT COUNT(DISTINCT(`author-id`)) FROM `post` WHERE `parent-uri-id` = `post-thread`.`uri-id` AND `gravity` = 6)",
773 "signed_text" => ["diaspora-interaction", "interaction"],
774 "parent-guid" => ["parent-item-uri", "guid"],
775 "parent-network" => ["post-thread", "network"],
776 "parent-author-id" => ["post-thread", "author-id"],
777 "parent-author-link" => ["author", "url"],
778 "parent-author-name" => ["author", "name"],
779 "parent-author-nick" => ["author", "nick"],
780 "parent-author-network" => ["author", "network"],
782 "query" => "FROM `post-thread`
783 INNER JOIN `post` ON `post`.`uri-id` = `post-thread`.`uri-id`
784 STRAIGHT_JOIN `contact` AS `author` ON `author`.`id` = `post-thread`.`author-id`
785 STRAIGHT_JOIN `contact` AS `owner` ON `owner`.`id` = `post-thread`.`owner-id`
786 LEFT JOIN `contact` AS `causer` ON `causer`.`id` = `post-thread`.`causer-id`
787 LEFT JOIN `item-uri` ON `item-uri`.`id` = `post-thread`.`uri-id`
788 LEFT JOIN `item-uri` AS `thr-parent-item-uri` ON `thr-parent-item-uri`.`id` = `post`.`thr-parent-id`
789 LEFT JOIN `item-uri` AS `parent-item-uri` ON `parent-item-uri`.`id` = `post`.`parent-uri-id`
790 LEFT JOIN `item-uri` AS `conversation-item-uri` ON `conversation-item-uri`.`id` = `post-thread`.`conversation-id`
791 LEFT JOIN `item-uri` AS `external-item-uri` ON `external-item-uri`.`id` = `post`.`external-id`
792 LEFT JOIN `verb` ON `verb`.`id` = `post`.`vid`
793 LEFT JOIN `diaspora-interaction` ON `diaspora-interaction`.`uri-id` = `post-thread`.`uri-id`
794 LEFT JOIN `post-content` ON `post-content`.`uri-id` = `post-thread`.`uri-id`
795 LEFT JOIN `item-uri` AS `quote-item-uri` ON `quote-item-uri`.`id` = `post-content`.`quote-uri-id`
796 LEFT JOIN `post-question` ON `post-question`.`uri-id` = `post-thread`.`uri-id`"
800 "uri-id" => ["post-category", "uri-id"],
801 "uid" => ["post-category", "uid"],
802 "type" => ["post-category", "type"],
803 "tid" => ["post-category", "tid"],
804 "name" => ["tag", "name"],
805 "url" => ["tag", "url"],
807 "query" => "FROM `post-category`
808 LEFT JOIN `tag` ON `post-category`.`tid` = `tag`.`id`"
810 "collection-view" => [
812 "uri-id" => ["post-collection", "uri-id"],
813 "type" => ["post-collection", "type"],
814 "cid" => ["post-collection", "author-id"],
815 "received" => ["post", "received"],
816 "created" => ["post", "created"],
817 "commented" => ["post-thread", "commented"],
818 "private" => ["post", "private"],
819 "visible" => ["post", "visible"],
820 "deleted" => ["post", "deleted"],
821 "thr-parent-id" => ["post", "thr-parent-id"],
822 "author-id" => ["post-collection", "author-id"],
823 "gravity" => ["post", "gravity"],
825 "query" => "FROM `post-collection`
826 INNER JOIN `post` ON `post-collection`.`uri-id` = `post`.`uri-id`
827 INNER JOIN `post-thread` ON `post-thread`.`uri-id` = `post`.`parent-uri-id`"
831 "uri-id" => ["post-media", "uri-id"],
832 "type" => ["post-media", "type"],
833 "received" => ["post", "received"],
834 "created" => ["post", "created"],
835 "private" => ["post", "private"],
836 "visible" => ["post", "visible"],
837 "deleted" => ["post", "deleted"],
838 "thr-parent-id" => ["post", "thr-parent-id"],
839 "author-id" => ["post", "author-id"],
840 "gravity" => ["post", "gravity"],
842 "query" => "FROM `post-media`
843 INNER JOIN `post` ON `post-media`.`uri-id` = `post`.`uri-id`"
847 "uri-id" => ["post-tag", "uri-id"],
848 "type" => ["post-tag", "type"],
849 "tid" => ["post-tag", "tid"],
850 "cid" => ["post-tag", "cid"],
851 "name" => "CASE `cid` WHEN 0 THEN `tag`.`name` ELSE `contact`.`name` END",
852 "url" => "CASE `cid` WHEN 0 THEN `tag`.`url` ELSE `contact`.`url` END",
853 "tag-type" => "CASE `cid` WHEN 0 THEN `tag`.`type` ELSE 1 END",
855 "query" => "FROM `post-tag`
856 LEFT JOIN `tag` ON `post-tag`.`tid` = `tag`.`id`
857 LEFT JOIN `contact` ON `post-tag`.`cid` = `contact`.`id`"
859 "network-item-view" => [
861 "uri-id" => ["post-user", "uri-id"],
862 "parent" => ["post-thread-user", "post-user-id"],
863 "received" => ["post-user", "received"],
864 "commented" => ["post-thread-user", "commented"],
865 "created" => ["post-user", "created"],
866 "uid" => ["post-user", "uid"],
867 "starred" => ["post-thread-user", "starred"],
868 "mention" => ["post-thread-user", "mention"],
869 "network" => ["post-user", "network"],
870 "unseen" => ["post-user", "unseen"],
871 "gravity" => ["post-user", "gravity"],
872 "contact-id" => ["post-user", "contact-id"],
873 "contact-type" => ["ownercontact", "contact-type"],
875 "query" => "FROM `post-user`
876 INNER JOIN `post-thread-user` ON `post-thread-user`.`uri-id` = `post-user`.`parent-uri-id` AND `post-thread-user`.`uid` = `post-user`.`uid`
877 STRAIGHT_JOIN `contact` ON `contact`.`id` = `post-thread-user`.`contact-id`
878 STRAIGHT_JOIN `contact` AS `authorcontact` ON `authorcontact`.`id` = `post-thread-user`.`author-id`
879 STRAIGHT_JOIN `contact` AS `ownercontact` ON `ownercontact`.`id` = `post-thread-user`.`owner-id`
880 WHERE `post-user`.`visible` AND NOT `post-user`.`deleted`
881 AND (NOT `contact`.`readonly` AND NOT `contact`.`blocked` AND NOT `contact`.`pending`)
882 AND (`post-user`.`hidden` IS NULL OR NOT `post-user`.`hidden`)
883 AND NOT `authorcontact`.`blocked` AND NOT `ownercontact`.`blocked`
884 AND NOT EXISTS(SELECT `cid` FROM `user-contact` WHERE `uid` = `post-thread-user`.`uid` AND `cid` IN (`authorcontact`.`id`, `ownercontact`.`id`) AND (`blocked` OR `ignored`))
885 AND NOT EXISTS(SELECT `gsid` FROM `user-gserver` WHERE `uid` = `post-thread-user`.`uid` AND `gsid` IN (`authorcontact`.`gsid`, `ownercontact`.`gsid`) AND `ignored`)"
887 "network-thread-view" => [
889 "uri-id" => ["post-thread-user", "uri-id"],
890 "parent" => ["post-thread-user", "post-user-id"],
891 "received" => ["post-thread-user", "received"],
892 "commented" => ["post-thread-user", "commented"],
893 "created" => ["post-thread-user", "created"],
894 "uid" => ["post-thread-user", "uid"],
895 "starred" => ["post-thread-user", "starred"],
896 "mention" => ["post-thread-user", "mention"],
897 "network" => ["post-thread-user", "network"],
898 "contact-id" => ["post-thread-user", "contact-id"],
899 "contact-type" => ["ownercontact", "contact-type"],
901 "query" => "FROM `post-thread-user`
902 INNER JOIN `post-user` ON `post-user`.`id` = `post-thread-user`.`post-user-id`
903 STRAIGHT_JOIN `contact` ON `contact`.`id` = `post-thread-user`.`contact-id`
904 STRAIGHT_JOIN `contact` AS `authorcontact` ON `authorcontact`.`id` = `post-thread-user`.`author-id`
905 STRAIGHT_JOIN `contact` AS `ownercontact` ON `ownercontact`.`id` = `post-thread-user`.`owner-id`
906 WHERE `post-user`.`visible` AND NOT `post-user`.`deleted`
907 AND (NOT `contact`.`readonly` AND NOT `contact`.`blocked` AND NOT `contact`.`pending`)
908 AND (`post-thread-user`.`hidden` IS NULL OR NOT `post-thread-user`.`hidden`)
909 AND NOT `authorcontact`.`blocked` AND NOT `ownercontact`.`blocked`
910 AND NOT EXISTS(SELECT `cid` FROM `user-contact` WHERE `uid` = `post-thread-user`.`uid` AND `cid` IN (`authorcontact`.`id`, `ownercontact`.`id`) AND (`blocked` OR `ignored`))
911 AND NOT EXISTS(SELECT `gsid` FROM `user-gserver` WHERE `uid` = `post-thread-user`.`uid` AND `gsid` IN (`authorcontact`.`gsid`, `ownercontact`.`gsid`) AND `ignored`)"
915 "id" => ["contact", "id"],
916 "uid" => ["contact", "uid"],
917 "created" => ["contact", "created"],
918 "updated" => ["contact", "updated"],
919 "self" => ["contact", "self"],
920 "remote_self" => ["contact", "remote_self"],
921 "rel" => ["contact", "rel"],
922 "network" => ["contact", "network"],
923 "protocol" => ["contact", "protocol"],
924 "name" => ["contact", "name"],
925 "nick" => ["contact", "nick"],
926 "location" => ["contact", "location"],
927 "about" => ["contact", "about"],
928 "keywords" => ["contact", "keywords"],
929 "xmpp" => ["contact", "xmpp"],
930 "matrix" => ["contact", "matrix"],
931 "attag" => ["contact", "attag"],
932 "avatar" => ["contact", "avatar"],
933 "photo" => ["contact", "photo"],
934 "thumb" => ["contact", "thumb"],
935 "micro" => ["contact", "micro"],
936 "header" => ["contact", "header"],
937 "url" => ["contact", "url"],
938 "nurl" => ["contact", "nurl"],
939 "uri-id" => ["contact", "uri-id"],
940 "addr" => ["contact", "addr"],
941 "alias" => ["contact", "alias"],
942 "pubkey" => ["contact", "pubkey"],
943 "prvkey" => ["contact", "prvkey"],
944 "batch" => ["contact", "batch"],
945 "request" => ["contact", "request"],
946 "notify" => ["contact", "notify"],
947 "poll" => ["contact", "poll"],
948 "confirm" => ["contact", "confirm"],
949 "poco" => ["contact", "poco"],
950 "subhub" => ["contact", "subhub"],
951 "hub-verify" => ["contact", "hub-verify"],
952 "last-update" => ["contact", "last-update"],
953 "success_update" => ["contact", "success_update"],
954 "failure_update" => ["contact", "failure_update"],
955 "name-date" => ["contact", "name-date"],
956 "uri-date" => ["contact", "uri-date"],
957 "avatar-date" => ["contact", "avatar-date"],
958 "picdate" => ["contact", "avatar-date"], /// @todo Replaces all uses of "picdate" with "avatar-date"
959 "term-date" => ["contact", "term-date"],
960 "last-item" => ["contact", "last-item"],
961 "priority" => ["contact", "priority"],
962 "blocked" => ["user", "blocked"],
963 "block_reason" => ["contact", "block_reason"],
964 "readonly" => ["contact", "readonly"],
965 "writable" => ["contact", "writable"],
966 "forum" => ["contact", "forum"],
967 "prv" => ["contact", "prv"],
968 "contact-type" => ["contact", "contact-type"],
969 "manually-approve" => ["contact", "manually-approve"],
970 "hidden" => ["contact", "hidden"],
971 "archive" => ["contact", "archive"],
972 "pending" => ["contact", "pending"],
973 "deleted" => ["contact", "deleted"],
974 "unsearchable" => ["contact", "unsearchable"],
975 "sensitive" => ["contact", "sensitive"],
976 "baseurl" => ["contact", "baseurl"],
977 "reason" => ["contact", "reason"],
978 "info" => ["contact", "info"],
979 "bdyear" => ["contact", "bdyear"],
980 "bd" => ["contact", "bd"],
981 "notify_new_posts" => ["contact", "notify_new_posts"],
982 "fetch_further_information" => ["contact", "fetch_further_information"],
983 "ffi_keyword_denylist" => ["contact", "ffi_keyword_denylist"],
984 "parent-uid" => ["user", "parent-uid"],
985 "guid" => ["user", "guid"],
986 "nickname" => ["user", "nickname"], /// @todo Replaces all uses of "nickname" with "nick"
987 "email" => ["user", "email"],
988 "openid" => ["user", "openid"],
989 "timezone" => ["user", "timezone"],
990 "language" => ["user", "language"],
991 "register_date" => ["user", "register_date"],
992 "login_date" => ["user", "login_date"],
993 "last-activity" => ["user", "last-activity"],
994 "default-location" => ["user", "default-location"],
995 "allow_location" => ["user", "allow_location"],
996 "theme" => ["user", "theme"],
997 "upubkey" => ["user", "pubkey"],
998 "uprvkey" => ["user", "prvkey"],
999 "sprvkey" => ["user", "sprvkey"],
1000 "spubkey" => ["user", "spubkey"],
1001 "verified" => ["user", "verified"],
1002 "blockwall" => ["user", "blockwall"],
1003 "hidewall" => ["user", "hidewall"],
1004 "blocktags" => ["user", "blocktags"],
1005 "unkmail" => ["user", "unkmail"],
1006 "cntunkmail" => ["user", "cntunkmail"],
1007 "notify-flags" => ["user", "notify-flags"],
1008 "page-flags" => ["user", "page-flags"],
1009 "account-type" => ["user", "account-type"],
1010 "prvnets" => ["user", "prvnets"],
1011 "maxreq" => ["user", "maxreq"],
1012 "expire" => ["user", "expire"],
1013 "account_removed" => ["user", "account_removed"],
1014 "account_expired" => ["user", "account_expired"],
1015 "account_expires_on" => ["user", "account_expires_on"],
1016 "expire_notification_sent" => ["user", "expire_notification_sent"],
1017 "def_gid" => ["user", "def_gid"],
1018 "allow_cid" => ["user", "allow_cid"],
1019 "allow_gid" => ["user", "allow_gid"],
1020 "deny_cid" => ["user", "deny_cid"],
1021 "deny_gid" => ["user", "deny_gid"],
1022 "openidserver" => ["user", "openidserver"],
1023 "publish" => ["profile", "publish"],
1024 "net-publish" => ["profile", "net-publish"],
1025 "hide-friends" => ["profile", "hide-friends"],
1026 "prv_keywords" => ["profile", "prv_keywords"],
1027 "pub_keywords" => ["profile", "pub_keywords"],
1028 "address" => ["profile", "address"],
1029 "locality" => ["profile", "locality"],
1030 "region" => ["profile", "region"],
1031 "postal-code" => ["profile", "postal-code"],
1032 "country-name" => ["profile", "country-name"],
1033 "homepage" => ["profile", "homepage"],
1034 "homepage_verified" => ["profile", "homepage_verified"],
1035 "dob" => ["profile", "dob"],
1037 "query" => "FROM `user`
1038 INNER JOIN `contact` ON `contact`.`uid` = `user`.`uid` AND `contact`.`self`
1039 INNER JOIN `profile` ON `profile`.`uid` = `user`.`uid`"
1043 "id" => ["contact", "id"],
1044 "url" => ["contact", "url"],
1045 "nurl" => ["contact", "nurl"],
1046 "uri-id" => ["contact", "uri-id"],
1047 "guid" => ["item-uri", "guid"],
1048 "addr" => ["contact", "addr"],
1049 "alias" => ["contact", "alias"],
1050 "name" => ["contact", "name"],
1051 "nick" => ["contact", "nick"],
1052 "about" => ["contact", "about"],
1053 "keywords" => ["contact", "keywords"],
1054 "xmpp" => ["contact", "xmpp"],
1055 "matrix" => ["contact", "matrix"],
1056 "avatar" => ["contact", "avatar"],
1057 "photo" => ["contact", "photo"],
1058 "thumb" => ["contact", "thumb"],
1059 "micro" => ["contact", "micro"],
1060 "header" => ["contact", "header"],
1061 "created" => ["contact", "created"],
1062 "updated" => ["contact", "updated"],
1063 "network" => ["contact", "network"],
1064 "protocol" => ["contact", "protocol"],
1065 "location" => ["contact", "location"],
1066 "attag" => ["contact", "attag"],
1067 "pubkey" => ["contact", "pubkey"],
1068 "prvkey" => ["contact", "prvkey"],
1069 "subscribe" => ["contact", "subscribe"],
1070 "last-update" => ["contact", "last-update"],
1071 "success_update" => ["contact", "success_update"],
1072 "failure_update" => ["contact", "failure_update"],
1073 "failed" => ["contact", "failed"],
1074 "last-item" => ["contact", "last-item"],
1075 "last-discovery" => ["contact", "last-discovery"],
1076 "contact-type" => ["contact", "contact-type"],
1077 "manually-approve" => ["contact", "manually-approve"],
1078 "unsearchable" => ["contact", "unsearchable"],
1079 "sensitive" => ["contact", "sensitive"],
1080 "baseurl" => ["contact", "baseurl"],
1081 "gsid" => ["contact", "gsid"],
1082 "info" => ["contact", "info"],
1083 "bdyear" => ["contact", "bdyear"],
1084 "bd" => ["contact", "bd"],
1085 "poco" => ["contact", "poco"],
1086 "name-date" => ["contact", "name-date"],
1087 "uri-date" => ["contact", "uri-date"],
1088 "avatar-date" => ["contact", "avatar-date"],
1089 "term-date" => ["contact", "term-date"],
1090 "global-ignored" => ["contact", "hidden"],
1091 "global-blocked" => ["contact", "blocked"],
1092 "hidden" => ["contact", "hidden"],
1093 "archive" => ["contact", "archive"],
1094 "deleted" => ["contact", "deleted"],
1095 "blocked" => ["contact", "blocked"],
1096 "dfrn-notify" => ["contact", "notify"],
1097 "dfrn-poll" => ["contact", "poll"],
1098 "diaspora-guid" => ["item-uri", "guid"],
1099 "diaspora-batch" => ["diaspora-contact", "batch"],
1100 "diaspora-notify" => ["diaspora-contact", "notify"],
1101 "diaspora-poll" => ["diaspora-contact", "poll"],
1102 "diaspora-alias" => ["diaspora-contact", "alias"],
1103 "ap-uuid" => ["apcontact", "uuid"],
1104 "ap-type" => ["apcontact", "type"],
1105 "ap-following" => ["apcontact", "following"],
1106 "ap-followers" => ["apcontact", "followers"],
1107 "ap-inbox" => ["apcontact", "inbox"],
1108 "ap-outbox" => ["apcontact", "outbox"],
1109 "ap-sharedinbox" => ["apcontact", "sharedinbox"],
1110 "ap-generator" => ["apcontact", "generator"],
1111 "ap-following_count" => ["apcontact", "following_count"],
1112 "ap-followers_count" => ["apcontact", "followers_count"],
1113 "ap-statuses_count" => ["apcontact", "statuses_count"],
1114 "site_name" => ["gserver", "site_name"],
1115 "platform" => ["gserver", "platform"],
1116 "version" => ["gserver", "version"],
1117 "server-blocked" => ["gserver", "blocked"],
1118 "server-failed" => ["gserver", "failed"],
1120 "query" => "FROM `contact`
1121 LEFT JOIN `item-uri` ON `item-uri`.`id` = `contact`.`uri-id`
1122 LEFT JOIN `apcontact` ON `apcontact`.`uri-id` = `contact`.`uri-id`
1123 LEFT JOIN `diaspora-contact` ON `diaspora-contact`.`uri-id` = contact.`uri-id`
1124 LEFT JOIN `gserver` ON `gserver`.`id` = contact.`gsid`
1125 WHERE `contact`.`uid` = 0"
1127 "account-user-view" => [
1129 "id" => ["ucontact", "id"],
1130 "pid" => ["contact", "id"],
1131 "uid" => ["ucontact", "uid"],
1132 "url" => ["contact", "url"],
1133 "nurl" => ["contact", "nurl"],
1134 "uri-id" => ["contact", "uri-id"],
1135 "guid" => ["item-uri", "guid"],
1136 "addr" => ["contact", "addr"],
1137 "alias" => ["contact", "alias"],
1138 "name" => ["contact", "name"],
1139 "nick" => ["contact", "nick"],
1140 "about" => ["contact", "about"],
1141 "keywords" => ["contact", "keywords"],
1142 "xmpp" => ["contact", "xmpp"],
1143 "matrix" => ["contact", "matrix"],
1144 "avatar" => ["contact", "avatar"],
1145 "photo" => ["contact", "photo"],
1146 "thumb" => ["contact", "thumb"],
1147 "micro" => ["contact", "micro"],
1148 "header" => ["contact", "header"],
1149 "created" => ["contact", "created"],
1150 "updated" => ["contact", "updated"],
1151 "self" => ["ucontact", "self"],
1152 "remote_self" => ["ucontact", "remote_self"],
1153 "rel" => ["ucontact", "rel"],
1154 "network" => ["contact", "network"],
1155 "protocol" => ["ucontact", "protocol"],
1156 "location" => ["contact", "location"],
1157 "attag" => ["ucontact", "attag"],
1158 "pubkey" => ["contact", "pubkey"],
1159 "prvkey" => ["contact", "prvkey"],
1160 "subscribe" => ["contact", "subscribe"],
1161 "last-update" => ["contact", "last-update"],
1162 "success_update" => ["contact", "success_update"],
1163 "failure_update" => ["contact", "failure_update"],
1164 "failed" => ["contact", "failed"],
1165 "last-item" => ["contact", "last-item"],
1166 "last-discovery" => ["contact", "last-discovery"],
1167 "contact-type" => ["contact", "contact-type"],
1168 "manually-approve" => ["contact", "manually-approve"],
1169 "unsearchable" => ["contact", "unsearchable"],
1170 "sensitive" => ["contact", "sensitive"],
1171 "baseurl" => ["contact", "baseurl"],
1172 "gsid" => ["contact", "gsid"],
1173 "info" => ["ucontact", "info"],
1174 "bdyear" => ["contact", "bdyear"],
1175 "bd" => ["contact", "bd"],
1176 "poco" => ["contact", "poco"],
1177 "name-date" => ["contact", "name-date"],
1178 "uri-date" => ["contact", "uri-date"],
1179 "avatar-date" => ["contact", "avatar-date"],
1180 "term-date" => ["contact", "term-date"],
1181 "global-ignored" => ["contact", "hidden"],
1182 "global-blocked" => ["contact", "blocked"],
1183 "hidden" => ["ucontact", "hidden"],
1184 "archive" => ["ucontact", "archive"],
1185 "pending" => ["ucontact", "pending"],
1186 "deleted" => ["ucontact", "deleted"],
1187 "notify_new_posts" => ["ucontact", "notify_new_posts"],
1188 "fetch_further_information" => ["ucontact", "fetch_further_information"],
1189 "ffi_keyword_denylist" => ["ucontact", "ffi_keyword_denylist"],
1190 "rating" => ["ucontact", "rating"],
1191 "readonly" => ["ucontact", "readonly"],
1192 "blocked" => ["ucontact", "blocked"],
1193 "block_reason" => ["ucontact", "block_reason"],
1194 "subhub" => ["ucontact", "subhub"],
1195 "hub-verify" => ["ucontact", "hub-verify"],
1196 "reason" => ["ucontact", "reason"],
1197 "dfrn-notify" => ["contact", "notify"],
1198 "dfrn-poll" => ["contact", "poll"],
1199 "diaspora-guid" => ["item-uri", "guid"],
1200 "diaspora-batch" => ["diaspora-contact", "batch"],
1201 "diaspora-notify" => ["diaspora-contact", "notify"],
1202 "diaspora-poll" => ["diaspora-contact", "poll"],
1203 "diaspora-alias" => ["diaspora-contact", "alias"],
1204 "diaspora-interacting_count" => ["diaspora-contact", "interacting_count"],
1205 "diaspora-interacted_count" => ["diaspora-contact", "interacted_count"],
1206 "diaspora-post_count" => ["diaspora-contact", "post_count"],
1207 "ap-uuid" => ["apcontact", "uuid"],
1208 "ap-type" => ["apcontact", "type"],
1209 "ap-following" => ["apcontact", "following"],
1210 "ap-followers" => ["apcontact", "followers"],
1211 "ap-inbox" => ["apcontact", "inbox"],
1212 "ap-outbox" => ["apcontact", "outbox"],
1213 "ap-sharedinbox" => ["apcontact", "sharedinbox"],
1214 "ap-generator" => ["apcontact", "generator"],
1215 "ap-following_count" => ["apcontact", "following_count"],
1216 "ap-followers_count" => ["apcontact", "followers_count"],
1217 "ap-statuses_count" => ["apcontact", "statuses_count"],
1218 "site_name" => ["gserver", "site_name"],
1219 "platform" => ["gserver", "platform"],
1220 "version" => ["gserver", "version"],
1221 "server-blocked" => ["gserver", "blocked"],
1222 "server-failed" => ["gserver", "failed"],
1224 "query" => "FROM `contact` AS `ucontact`
1225 INNER JOIN `contact` ON `contact`.`uri-id` = `ucontact`.`uri-id` AND `contact`.`uid` = 0
1226 LEFT JOIN `item-uri` ON `item-uri`.`id` = `ucontact`.`uri-id`
1227 LEFT JOIN `apcontact` ON `apcontact`.`uri-id` = `ucontact`.`uri-id`
1228 LEFT JOIN `diaspora-contact` ON `diaspora-contact`.`uri-id` = `ucontact`.`uri-id`
1229 LEFT JOIN `gserver` ON `gserver`.`id` = contact.`gsid`"
1233 "id" => ["register", "id"],
1234 "hash" => ["register", "hash"],
1235 "created" => ["register", "created"],
1236 "uid" => ["register", "uid"],
1237 "password" => ["register", "password"],
1238 "language" => ["register", "language"],
1239 "note" => ["register", "note"],
1240 "self" => ["contact", "self"],
1241 "name" => ["contact", "name"],
1242 "url" => ["contact", "url"],
1243 "micro" => ["contact", "micro"],
1244 "email" => ["user", "email"],
1245 "nick" => ["contact", "nick"],
1247 "query" => "FROM `register`
1248 INNER JOIN `contact` ON `register`.`uid` = `contact`.`uid`
1249 INNER JOIN `user` ON `register`.`uid` = `user`.`uid`"
1251 "tag-search-view" => [
1253 "uri-id" => ["post-tag", "uri-id"],
1254 "uid" => ["post-user", "uid"],
1255 "iid" => ["post-user", "id"],
1256 "private" => ["post-user", "private"],
1257 "wall" => ["post-user", "wall"],
1258 "origin" => ["post-user", "origin"],
1259 "global" => ["post-user", "global"],
1260 "gravity" => ["post-user", "gravity"],
1261 "received" => ["post-user", "received"],
1262 "network" => ["post-user", "network"],
1263 "author-id" => ["post-user", "author-id"],
1264 "name" => ["tag", "name"],
1266 "query" => "FROM `post-tag`
1267 INNER JOIN `tag` ON `tag`.`id` = `post-tag`.`tid`
1268 STRAIGHT_JOIN `post-user` ON `post-user`.`uri-id` = `post-tag`.`uri-id`
1269 WHERE `post-tag`.`type` = 1"
1271 "workerqueue-view" => [
1273 "pid" => ["process", "pid"],
1274 "priority" => ["workerqueue", "priority"],
1276 "query" => "FROM `process`
1277 INNER JOIN `workerqueue` ON `workerqueue`.`pid` = `process`.`pid`
1278 WHERE NOT `workerqueue`.`done`"
1280 "profile_field-view" => [
1282 "id" => ["profile_field", "id"],
1283 "uid" => ["profile_field", "uid"],
1284 "label" => ["profile_field", "label"],
1285 "value" => ["profile_field", "value"],
1286 "order" => ["profile_field", "order"],
1287 "psid"=> ["profile_field", "psid"],
1288 "allow_cid" => ["permissionset", "allow_cid"],
1289 "allow_gid" => ["permissionset", "allow_gid"],
1290 "deny_cid" => ["permissionset", "deny_cid"],
1291 "deny_gid" => ["permissionset", "deny_gid"],
1292 "created" => ["profile_field", "created"],
1293 "edited" => ["profile_field", "edited"],
1295 "query" => "FROM `profile_field`
1296 INNER JOIN `permissionset` ON `permissionset`.`id` = `profile_field`.`psid`"
1298 "diaspora-contact-view" => [
1300 "uri-id" => ["diaspora-contact", "uri-id"],
1301 "url" => ["item-uri", "uri"],
1302 "guid" => ["item-uri", "guid"],
1303 "addr" => ["diaspora-contact", "addr"],
1304 "alias" => ["diaspora-contact", "alias"],
1305 "nick" => ["diaspora-contact", "nick"],
1306 "name" => ["diaspora-contact", "name"],
1307 "given-name" => ["diaspora-contact", "given-name"],
1308 "family-name" => ["diaspora-contact", "family-name"],
1309 "photo" => ["diaspora-contact", "photo"],
1310 "photo-medium" => ["diaspora-contact", "photo-medium"],
1311 "photo-small" => ["diaspora-contact", "photo-small"],
1312 "batch" => ["diaspora-contact", "batch"],
1313 "notify" => ["diaspora-contact", "notify"],
1314 "poll" => ["diaspora-contact", "poll"],
1315 "subscribe" => ["diaspora-contact", "subscribe"],
1316 "searchable" => ["diaspora-contact", "searchable"],
1317 "pubkey" => ["diaspora-contact", "pubkey"],
1318 "baseurl" => ["gserver", "url"],
1319 "gsid" => ["diaspora-contact", "gsid"],
1320 "created" => ["diaspora-contact", "created"],
1321 "updated" => ["diaspora-contact", "updated"],
1322 "interacting_count" => ["diaspora-contact", "interacting_count"],
1323 "interacted_count" => ["diaspora-contact", "interacted_count"],
1324 "post_count" => ["diaspora-contact", "post_count"],
1326 "query" => "FROM `diaspora-contact`
1327 INNER JOIN `item-uri` ON `item-uri`.`id` = `diaspora-contact`.`uri-id`
1328 LEFT JOIN `gserver` ON `gserver`.`id` = `diaspora-contact`.`gsid`"