Comparison

mod_http_muc_log/mod_http_muc_log.lua @ 4590:3145823992cb

mod_http_muc_log: Move out nickname into a variable for future reuse
author Kim Alvefur <zash@zash.se>
date Tue, 15 Jun 2021 17:20:05 +0200
parent 4589:45ab9152a51c
child 4592:38f501dca618
comparison
equal deleted inserted replaced
4589:45ab9152a51c 4590:3145823992cb
325 -- TODO Distinguish between join and presence update 325 -- TODO Distinguish between join and presence update
326 verb = item.attr.type == "unavailable" and "has left" or "has joined"; 326 verb = item.attr.type == "unavailable" and "has left" or "has joined";
327 lang = "en"; 327 lang = "en";
328 end 328 end
329 329
330 local nick = select(3, jid_split(item.attr.from));
330 local oob = use_oob and item:get_child("x", "jabber:x:oob"); 331 local oob = use_oob and item:get_child("x", "jabber:x:oob");
331 332
332 if body or verb or oob then 333 if body or verb or oob then
333 local line = { 334 local line = {
334 key = key; 335 key = key;
335 datetime = datetime.datetime(when); 336 datetime = datetime.datetime(when);
336 time = datetime.time(when); 337 time = datetime.time(when);
337 verb = verb; 338 verb = verb;
338 body = body; 339 body = body;
339 lang = lang; 340 lang = lang;
340 nick = select(3, jid_split(item.attr.from)); 341 nick = nick;
341 st_name = item.name; 342 st_name = item.name;
342 st_type = item.attr.type; 343 st_type = item.attr.type;
343 }; 344 };
344 if oob then 345 if oob then
345 line.oob = { 346 line.oob = {