Mercurial > prosody-hg
changeset 14047:f463e101fbd9 13.0 13.0.4
mod_account_activity: Handle authentication provider returning no user info
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Tue, 20 Jan 2026 11:04:41 +0000 |
| parents | e9aa551f3f8f |
| children | f5d415d54064 ea71767067f7 |
| files | plugins/mod_account_activity.lua |
| diffstat | 1 files changed, 10 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/mod_account_activity.lua Sun Jan 18 14:56:01 2026 +0100 +++ b/plugins/mod_account_activity.lua Tue Jan 20 11:04:41 2026 +0000 @@ -69,11 +69,16 @@ for username in um.users(host) do local last_active = store:get_key(username, "timestamp"); if not last_active then - local created_at = um.get_account_info(username, host).created; - if created_at and (now - created_at) > duration_sec then - self.session.print(username, ""); - n_inactive = n_inactive + 1; - elseif not created_at then + local user_info = um.get_account_info(username, host); + local created_at; + if user_info then + created_at = user_info.created; + if created_at and (now - created_at) > duration_sec then + self.session.print(username, ""); + n_inactive = n_inactive + 1; + end + end + if not created_at then n_unknown = n_unknown + 1; end elseif (now - last_active) > duration_sec then
