Software /
code /
prosody-modules
Changeset
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 |
parents | 2263:92af641fcf48 |
children | 2265:29e3a09275c5 |
files | mod_track_muc_joins/mod_track_muc_joins.lua |
diffstat | 1 files changed, 3 insertions(+), 1 deletions(-) [+] |
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