# HG changeset patch # User Kim Alvefur # Date 1416510067 -3600 # Node ID a68ec7a2dc02d87dd406f146c52d0af24dfc049e # Parent 0a6974f2cb550a3ab3a6ba35a6604d793a6a04b7 mod_http_muc_log: Show only messages with presentable content diff -r 0a6974f2cb55 -r a68ec7a2dc02 mod_http_muc_log/mod_http_muc_log.lua --- a/mod_http_muc_log/mod_http_muc_log.lua Thu Nov 20 19:56:22 2014 +0100 +++ b/mod_http_muc_log/mod_http_muc_log.lua Thu Nov 20 20:01:07 2014 +0100 @@ -271,22 +271,24 @@ subject = item:get_child_text("subject"); verb = nil; if subject then - verb = "set the topic to"; + verb, body = "set the topic to", subject; elseif body and body:sub(1,4) == "/me " then verb, body = body:sub(5), nil; elseif item.name == "presence" then verb = item.attr.type == "unavailable" and "has left" or "has joined"; end - logs[i], i = line_template { - key = key; - datetime = datetime.datetime(when); - time = datetime.time(when); - verb = verb; - body = subject or body; - nick = select(3, jid_split(item.attr.from)); - st_name = item.name; - st_type = item.attr.type; - }, i + 1; + if body or verb then + logs[i], i = line_template { + key = key; + datetime = datetime.datetime(when); + time = datetime.time(when); + verb = verb; + body = body; + nick = select(3, jid_split(item.attr.from)); + st_name = item.name; + st_type = item.attr.type; + }, i + 1; + end first = first or key; last = key; end