Differences From
Artifact [d79d41c9fe]:
156 156 chgcount: uint
157 157 mentions: lib.mem.ptr(uint64)
158 158 circles: lib.mem.ptr(uint64) --only meaningful if scope is set to circle
159 159 convoheaduri: str
160 160 parent: uint64
161 161 -- ephemera
162 162 localpost: bool
163 + accent: int16
164 + depth: uint16 -- used in conversations to indicate tree depth
163 165 source: &m.source
164 166
165 167 -- save :: bool -> {} (defined in acl.t due to dep. hell)
166 168 }
167 169
168 -local cnf = terralib.memoize(function(ty,rty)
170 +m.user_conf_funcs = function(be,n,ty,rty,rty2)
169 171 rty = rty or ty
170 - return struct {
171 - enum: {&opaque, uint64, rawstring} -> intptr
172 - get: {&opaque, uint64, rawstring} -> rty
173 - set: {&opaque, uint64, rawstring, ty} -> {}
174 - reset: {&opaque, uint64, rawstring} -> {}
175 - }
176 -end)
172 + local gt
173 + if not rty2 -- what the fuck?
174 + then gt = {&m.source, uint64, rawstring} -> rty;
175 + else gt = {&m.source, uint64, rawstring} -> {rty, rty2};
176 + end
177 + for k, t in pairs {
178 + enum = {&m.source, uint64, rawstring} -> lib.mem.ptr(rty);
179 + get = gt;
180 + set = {&m.source, uint64, rawstring, ty} -> {};
181 + reset = {&m.source, uint64, rawstring} -> {};
182 + } do
183 + be.entries[#be.entries+1] = {
184 + field = 'actor_conf_'..n..'_'..k, type = t
185 + }
186 + end
187 +end
177 188
178 189 struct m.notif {
179 190 kind: m.notiftype.t
180 191 when: uint64
181 192 union {
182 193 post: uint64
183 - reaction: int8[8]
194 + reaction: int8[16]
184 195 }
185 196 }
186 197
187 198 struct m.inet {
188 199 pv: uint8 -- 0 = null, 4 = ipv4, 6 = ipv6
189 200 union {
190 201 v4: uint8[4]
................................................................................
232 243 context: str
233 244 }
234 245
235 246 struct m.auth {
236 247 -- a credential record
237 248 aid: uint64
238 249 uid: uint64
250 + kind: str
239 251 aname: str
252 + comment: str
240 253 netmask: m.inet
241 254 privs: m.privset
242 255 blacklist: bool
243 256 }
244 257
245 258 struct m.relationship {
246 259 agent: uint64
................................................................................
313 326 -- cookie issue time: m.timepoint
314 327 actor_auth_register_uid: {&m.source, uint64, uint64} -> {}
315 328 -- notifies the backend module of the UID that has been assigned for
316 329 -- an authentication ID
317 330 -- aid: uint64
318 331 -- uid: uint64
319 332
320 - actor_conf_str: cnf(rawstring, lib.mem.ptr(int8))
321 - actor_conf_int: cnf(intptr, lib.stat(intptr))
322 -
323 - auth_create_pw: {&m.source, uint64, bool, lib.mem.ptr(int8)} -> {}
333 + auth_enum_uid: {&m.source, uint64} -> lib.mem.ptr(lib.mem.ptr(m.auth))
334 + auth_enum_handle: {&m.source, rawstring} -> lib.mem.ptr(lib.mem.ptr(m.auth))
335 + auth_attach_pw: {&m.source, uint64, bool, pstr, pstr} -> {}
324 336 -- uid: uint64
325 337 -- reset: bool (delete other passwords?)
326 338 -- pw: pstring
339 + -- comment: pstring
327 340 auth_purge_pw: {&m.source, uint64, rawstring} -> {}
328 341 auth_purge_otp: {&m.source, uint64, rawstring} -> {}
329 342 auth_purge_trust: {&m.source, uint64, rawstring} -> {}
330 343 auth_sigtime_user_fetch: {&m.source, uint64} -> m.timepoint
331 344 -- authentication tokens and accounts have a property that controls
332 345 -- whether auth cookies dated to a certain point are valid. cookies
333 346 -- that are generated before the timepoint are considered invalid.
................................................................................
338 351 -- timestamp: timepoint
339 352
340 353 post_save: {&m.source, &m.post} -> {}
341 354 post_create: {&m.source, &m.post} -> uint64
342 355 post_destroy: {&m.source, uint64} -> {}
343 356 post_fetch: {&m.source, uint64} -> lib.mem.ptr(m.post)
344 357 post_enum_author_uid: {&m.source, uint64, m.range} -> lib.mem.ptr(lib.mem.ptr(m.post))
358 + post_enum_parent: {&m.source, uint64} -> lib.mem.ptr(lib.mem.ptr(m.post))
345 359 post_attach_ctl: {&m.source, uint64, uint64, bool} -> {}
346 360 -- attaches or detaches an existing database artifact
347 361 -- post id: uint64
348 362 -- artifact id: uint64
349 363 -- detach: bool
364 +
365 + thread_latest_arrival_calc: {&m.source, uint64} -> m.timepoint
366 +
350 367 artifact_instantiate: {&m.source, lib.mem.ptr(uint8), lib.mem.ptr(int8)} -> uint64
351 368 -- instantiate an artifact in the database, either installing a new
352 369 -- artifact or returning the id of an existing artifact with the same hash
353 370 -- artifact: bytea
354 371 -- mime: pstring
355 372 artifact_quicksearch: {&m.source, lib.mem.ptr(uint8)} -> {uint64,bool}
356 373 -- checks whether a hash is already in the database without uploading
................................................................................
385 402 -- proto: kompromat (null for all records, or a prototype describing the records to return)
386 403 nkvd_sanction_issue: {&m.source, &m.sanction} -> uint64
387 404 nkvd_sanction_vacate: {&m.source, uint64} -> {}
388 405 nkvd_sanction_enum_target: {&m.source, uint64} -> {}
389 406 nkvd_sanction_enum_issuer: {&m.source, uint64} -> {}
390 407 nkvd_sanction_review: {&m.source, m.timepoint} -> {}
391 408
392 - convo_fetch_xid: {&m.source,rawstring} -> lib.mem.ptr(m.post)
393 - convo_fetch_cid: {&m.source,uint64} -> lib.mem.ptr(m.post)
394 -
395 409 timeline_actor_fetch_uid: {&m.source, uint64, m.range} -> lib.mem.ptr(lib.mem.ptr(m.post))
396 410 timeline_instance_fetch: {&m.source, m.range} -> lib.mem.ptr(lib.mem.ptr(m.post))
397 411 }
412 +
413 +m.user_conf_funcs(m.backend, 'str', rawstring, lib.mem.ptr(int8))
414 +m.user_conf_funcs(m.backend, 'int', intptr, intptr, bool)
398 415
399 416 struct m.source {
400 417 backend: &m.backend
401 418 id: lib.mem.ptr(int8)
402 419 handle: &opaque
403 420 string: lib.mem.ptr(int8)
404 421 }