processone / processone/ejabberd
MucSub affiliation changes
Nobody has claimed this yet.
- Dominant language
- Erlang
- Stars
- 6.7k
- Forks
- 1.6k
- PR merge metrics
- No merged PRs in 30d
Description
Hi, this issue has been discussed in link below but has been closed. However, looks like it has not been resolved.
https://github.com/processone/ejabberd/issues/3172
What I tried.
Scenario 1: There is a room, with three participants. One of three participants is an Owner. Remaining are only members. If Owner, makes one of the member as Admin, the Owner receive a response from server on affiliation change, but member does not receive anything.
Scenario 2: The room has three members and this time one is Owner, One is Admin, and other is Member. This time, Owner, made an Admin to be a member. And the Admin user, even though an Admin does not receive any response on Affiliation Change.
Summary
In summary:
- Only "Owner" Receives a Iq Result Stanza of Affiliation Change.
- Neither Admin nor Member receives any Iq Stanza Affiliation Change.
- Question: Can this is considered a Bug or is this an expected result for some reason?
Optional Information
Example test scenarios are below.
Scenario 1: Owner changes Member To Admin.
Owner receives Result. Member Receives Nothing.
Expected: Member is informed of Affiliation Change.
SENT BY OWNER:
<iq id="KTGEWXDTJ" type="set" from="ownerNick@testServer.com/69cc4690-f06d-11ed-a32a-85ca8676ac7f"
to="mucSubRoom@conference.testServer.com"><query xmlns="http://jabber.org/protocol/muc#admin"><item
affiliation="admin" jid="otherUserNick@testServer.com"><reason>Changing Affiliation Status </reason></item></query></iq>
RECEIVED ONLY BY OWNER:
<iq xml:lang='en' to='ownerNick@testServer.com/69cc4690-f06d-11ed-a32a-85ca8676ac7f'
from='mucSubRoom@conference.testServer.com' type='result' id='KTGEWXDTJ'/>
Scenario 2: Owner changes Admin to Member.
Owner receives Result. Member Receives Nothing
Expected: Member is informed of Affiliation Change.
SENT BY OWNER:
<iq id="PURPXJXIO" type="set" from="ownerNick@testServer.com/69cc4690-f06d-11ed-a32a-85ca8676ac7f"
to="mucSubRoom@conference.testServer.com"><query xmlns="http://jabber.org/protocol/muc#admin"><item
affiliation="member" jid="otherUserNick@testServer.com"><reason>Changing Affiliation Status </reason></item></query>
</iq>
RECEIVED ONLY BY OWNER:
<iq xml:lang='en' to='ownerNick@testServer.com/69cc4690-f06d-11ed-a32a-85ca8676ac7f'
from='mucSubRoom@conference.testServer.com' type='result' id='PURPXJXIO'/>
Setup
Users are subscribed to following nodes.
urn:xmpp:mucsub:nodes:presence
urn:xmpp:mucsub:nodes:messages
urn:xmpp:mucsub:nodes:affiliations
urn:xmpp:mucsub:nodes:subscribers
urn:xmpp:mucsub:nodes:config
urn:xmpp:mucsub:nodes:subject
urn:xmpp:mucsub:nodes:system
Note, If when changing affiliation, I also send a presence stanza (Join a Room), then I receive presence packaged in MucSub (as per example stanza in docs below), which is sent to users whose affiliation is changed. But if we did this, then we will be "Present" in room as per XEP--0045, and after that, the room will start sending standard messages instead of MUCSUB encapsulated messages i.e. below approach basically breaks MucSub
<message from="coven@muc.shakespeare.example"
to="hag66@shakespeare.example/pda">
<event xmlns="http://jabber.org/protocol/pubsub#event">
<items node="urn:xmpp:mucsub:nodes:presences">
<item id="8170705750417052518">
<presence xmlns="jabber:client"
from="coven@muc.shakespeare.example/secondwitch"
type="unavailable"
to="hag66@shakespeare.example/pda">
<x xmlns="http://jabber.org/protocol/muc#user">
<item affiliation="none"
role="none" />
</x>
</presence>
</item>
</items>
</event>
</message>
Before creating a ticket, please consider if this should fit the discussion forum better.
Environment
- ejabberd version: 23.04
- Erlang version:
erl +V - OS: Linux (Debian)
- Installed from: source | distro package | official deb/rpm | official binary installer | other
Configuration (only if needed): grep -Ev '^$|^\s*#' ejabberd.yml
loglevel: 4
...
Errors from error.log/crash.log
No errors
Bug description
Please, give us a precise description (what does not work, what is expected, etc.)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the linked discussion in issue 3172 and reproduce the two affiliation-change scenarios using the listed MucSub subscriptions. Trace how ejabberd handles affiliation changes and notifications without a presence subscription, then verify whether affected members receive the expected MucSub affiliation event without joining the room.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- erlang
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100