#1739 muc-occupant-pre-join: error if modifying occupant nick with multiple sessions
Reporter
John Regan
Owner
Nobody
Created
Updated
Stars
★ (1)
Tags
Priority-Medium
Type-Defect
Patch
Status-Accepted
Milestone-0.12
John Regan
on
What steps will reproduce the problem?
1. Create a module that changes nicks in a pre-join event (in my case, just running through string.lower())
2. Join MUC from one client with an uppercase nick.
3. Join MUC from another client, same JID/account, same uppercase nick.
What is the expected output?
Both clients join the MUC with automatically-changed nicknames.
What do you see instead?
The second client joins and can chat normally. The first client won't display any issue until it tries to send a message to the MUC - it will then receive a not-acceptable error, with the text "You are not currently connected to this chat"
What version of the product are you using? On what operating system?
Prosody 0.12.0 on Arch Linux.
Please provide any additional information below.
The nick-lowering module:
```mod_muc_nick_lower.lua
module:hook("muc-occupant-pre-join", function(event)
event.occupant.nick = string.lower(event.occupant.nick)
end)
```
From looking at the muc code, I would think this would work - a nick_changed flag gets set.
It seems like the second client gets the correct "210" status, indicating the nickname was changed. Not sure what's causing the first client to be marked as no longer in the room.
What steps will reproduce the problem? 1. Create a module that changes nicks in a pre-join event (in my case, just running through string.lower()) 2. Join MUC from one client with an uppercase nick. 3. Join MUC from another client, same JID/account, same uppercase nick. What is the expected output? Both clients join the MUC with automatically-changed nicknames. What do you see instead? The second client joins and can chat normally. The first client won't display any issue until it tries to send a message to the MUC - it will then receive a not-acceptable error, with the text "You are not currently connected to this chat" What version of the product are you using? On what operating system? Prosody 0.12.0 on Arch Linux. Please provide any additional information below. The nick-lowering module: ```mod_muc_nick_lower.lua module:hook("muc-occupant-pre-join", function(event) event.occupant.nick = string.lower(event.occupant.nick) end) ``` From looking at the muc code, I would think this would work - a nick_changed flag gets set. It seems like the second client gets the correct "210" status, indicating the nickname was changed. Not sure what's causing the first client to be marked as no longer in the room.
Thanks for the report and patch ( https://groups.google.com/g/prosody-dev/c/IFA10yMoPKI ) Sorry we haven't gotten to looking at this yet. Done so now. Will likely merge after doing a few more tests.
Changes