comparison mod_http_muc_log/mod_http_muc_log.lua @ 3715:f03a023cd523

mod_http_muc_log: Compose page title from room data More flexible than composing the title from name and date in the controller. Also opens the door to using other room data fields.
author Kim Alvefur <zash@zash.se>
date Sun, 13 Oct 2019 16:16:14 +0200
parents 04ff0de40ba9
children cc6f7e2e4a59
comparison
equal deleted inserted replaced
3714:04ff0de40ba9 3715:f03a023cd523
238 238
239 -- Phew, all wrangled, all that's left is rendering it with the template 239 -- Phew, all wrangled, all that's left is rendering it with the template
240 240
241 response.headers.content_type = "text/html; charset=utf-8"; 241 response.headers.content_type = "text/html; charset=utf-8";
242 return render(template, { 242 return render(template, {
243 title = get_room(room):get_name(); 243 room = get_room(room)._data;
244 jid = get_room(room).jid; 244 jid = get_room(room).jid;
245 jid_node = jid_split(get_room(room).jid); 245 jid_node = jid_split(get_room(room).jid);
246 hide_presence = hide_presence(request); 246 hide_presence = hide_presence(request);
247 presence_available = presence_logged; 247 presence_available = presence_logged;
248 years = years; 248 years = years;
374 table.insert(links, { href = next_when, rel = "next", text = next_when}); 374 table.insert(links, { href = next_when, rel = "next", text = next_when});
375 end 375 end
376 376
377 response.headers.content_type = "text/html; charset=utf-8"; 377 response.headers.content_type = "text/html; charset=utf-8";
378 return render(template, { 378 return render(template, {
379 title = ("%s - %s"):format(get_room(room):get_name(), date);
380 date = date; 379 date = date;
380 room = get_room(room)._data;
381 jid = get_room(room).jid; 381 jid = get_room(room).jid;
382 jid_node = jid_split(get_room(room).jid); 382 jid_node = jid_split(get_room(room).jid);
383 hide_presence = hide_presence(request); 383 hide_presence = hide_presence(request);
384 presence_available = presence_logged; 384 presence_available = presence_logged;
385 lang = get_room(room).get_language and get_room(room):get_language(); 385 lang = get_room(room).get_language and get_room(room):get_language();