Software / code / prosody
Comparison
plugins/muc/muc.lib.lua @ 11912:037b2c019f58
MUC: Include old affiliation data in affiliation change event
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Tue, 16 Nov 2021 12:57:23 +0000 |
| parent | 11911:0e7dedd8b18d |
| child | 11915:e0b58717f0c5 |
comparison
equal
deleted
inserted
replaced
| 11911:0e7dedd8b18d | 11912:037b2c019f58 |
|---|---|
| 1429 jid = jid; | 1429 jid = jid; |
| 1430 affiliation = affiliation or "none"; | 1430 affiliation = affiliation or "none"; |
| 1431 reason = reason; | 1431 reason = reason; |
| 1432 previous_affiliation = target_affiliation or "none"; | 1432 previous_affiliation = target_affiliation or "none"; |
| 1433 data = data and data or nil; -- coerce false to nil | 1433 data = data and data or nil; -- coerce false to nil |
| 1434 previous_data = self._affiliation_data[jid] or nil; | |
| 1434 }; | 1435 }; |
| 1435 | 1436 |
| 1436 module:fire_event("muc-pre-set-affiliation", event_data); | 1437 module:fire_event("muc-pre-set-affiliation", event_data); |
| 1437 if event_data.allowed == false then | 1438 if event_data.allowed == false then |
| 1438 local err = event_data.error or { type = "cancel", condition = "not-allowed" }; | 1439 local err = event_data.error or { type = "cancel", condition = "not-allowed" }; |