248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
...
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
|
else
conf = data.view.confirm {
title = lib.str.plit 'cancel retweet';
query = lib.str.plit 'are you sure you want to undo this retweet?';
cancel = lib.str.plit'/';
}
end
var body = conf:tostr() defer body:free()
co:stdpage([lib.srv.convo.page] {
title = lib.str.plit 'post :: delete';
class = lib.str.plit 'query';
body = body; cache = false;
})
return
elseif meth == method.post then
var act = co:ppostv('act')
if act:cmp(lib.str.plit 'confirm') then
if post:ref() then
post(0).source:post_destroy(post(0).id)
elseif rt.kind ~= 0 then
................................................................................
terra http.media_manager(co: &lib.srv.convo, path: hpath, meth: method.t, uid: uint64)
if co.aid ~= 0 and co.who.id == uid and path.ct == 2 and path(1):cmp(lib.str.lit'upload') and co.who.rights.powers.artifact() then
if meth == method.get then
var view = data.view.media_upload {
folders = ''
}
var pg = view:tostr() defer pg:free()
co:stdpage([lib.srv.convo.page] {
title = lib.str.plit'media :: upload';
class = lib.str.plit'media upload';
cache = false; body = pg;
})
elseif meth == method.post_file then
var desc = pstring.null()
|
|
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
...
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
|
else
conf = data.view.confirm {
title = lib.str.plit 'cancel retweet';
query = lib.str.plit 'are you sure you want to undo this retweet?';
cancel = lib.str.plit'/';
}
end
var fr = co.srv.pool:frame()
var body = conf:poolstr(&co.srv.pool) --defer body:free()
co:stdpage([lib.srv.convo.page] {
title = lib.str.plit 'post :: delete';
class = lib.str.plit 'query';
body = body; cache = false;
})
co.srv.pool:reset(fr)
return
elseif meth == method.post then
var act = co:ppostv('act')
if act:cmp(lib.str.plit 'confirm') then
if post:ref() then
post(0).source:post_destroy(post(0).id)
elseif rt.kind ~= 0 then
................................................................................
terra http.media_manager(co: &lib.srv.convo, path: hpath, meth: method.t, uid: uint64)
if co.aid ~= 0 and co.who.id == uid and path.ct == 2 and path(1):cmp(lib.str.lit'upload') and co.who.rights.powers.artifact() then
if meth == method.get then
var view = data.view.media_upload {
folders = ''
}
var pg = view:poolstr(&co.srv.pool) -- defer pg:free()
co:stdpage([lib.srv.convo.page] {
title = lib.str.plit'media :: upload';
class = lib.str.plit'media upload';
cache = false; body = pg;
})
elseif meth == method.post_file then
var desc = pstring.null()
|