22 end |
22 end |
23 local function on_connect(conn) |
23 local function on_connect(conn) |
24 -- Required: id, title, updated, author (which must have a name) |
24 -- Required: id, title, updated, author (which must have a name) |
25 local entry_id = opts.id or new_uuid(); |
25 local entry_id = opts.id or new_uuid(); |
26 local atom_entry = verse.stanza("entry", { xmlns = xmlns_atom}) |
26 local atom_entry = verse.stanza("entry", { xmlns = xmlns_atom}) |
27 :tag("id"):text(entry_id):up(id) |
27 :tag("id"):text(entry_id):up() |
28 :tag("title"):text(opts.title or ""):up() |
28 :tag("title"):text(opts.title or ""):up() |
29 :tag("updated"):text(opts.updated or datetime()):up(); |
29 :tag("updated"):text(opts.updated or datetime()):up(); |
30 atom_entry:tag("author"):tag("name"):text(opts.author or os.getenv("USER") or "Unknown author"):up(); |
30 atom_entry:tag("author"):tag("name"):text(opts.author or os.getenv("USER") or "Unknown author"):up(); |
31 atom_entry:up(); |
31 atom_entry:up(); |
32 atom_entry:tag("source") |
32 atom_entry:tag("source") |