Software /
code /
prosody-modules
Diff
mod_track_muc_joins/mod_track_muc_joins.lua @ 2264:463e43dc0c4d
mod_track_muc_joins: Keep the nickname around
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 31 Jul 2016 17:59:13 +0200 |
parent | 2158:de3fb9d2673c |
child | 2274:43e647b8dd9f |
line wrap: on
line diff
--- a/mod_track_muc_joins/mod_track_muc_joins.lua Thu Jul 28 14:47:28 2016 +0200 +++ b/mod_track_muc_joins/mod_track_muc_joins.lua Sun Jul 31 17:59:13 2016 +0200 @@ -1,4 +1,5 @@ local jid_bare = require "util.jid".bare; +local jid_split = require "util.jid".split; local sessions = prosody.full_sessions; module:hook("presence/full", function (event) @@ -12,9 +13,10 @@ local from_jid = stanza.attr.from; local room = jid_bare(from_jid); + local nick = jid_split(from_jid); local joined = stanza.attr.type; if joined == nil then - joined = true; + joined = nick; elseif joined == "unavailable" then joined = nil; else