-- vim: ft=terra
local pstr = lib.mem.ptr(int8)
local pref = lib.mem.ref(int8)

local terra 
render_conf_avi(co: &lib.srv.convo, path: lib.mem.ptr(pref)): pstr
	var a = co:stra(128)
	a:lpush '<form method="post"><p>this is your current avatar. if you want to change it, you can reset it to the default, or pick a new image in your <a href="/media">media library</a> to represent yourself with.</p><img class="avatar big" src="/avi/':push(co.who.handle,0):lpush '">'
	if co.who.avatarid ~= 0 then
		a:lpush '<menu class="vertical choice"><button name="act" value="clear">use default avatar</button><a class="button" href="/media/a/':shpush(co.who.avatarid):lpush '">open image</a></menu>'
	end
	return a:finalize()
end

return render_conf_avi
