#1052 mod_firewall: `SUBSCRIBED?` should be true for self-messages
Reporter
Ge0rG
Owner
Zash
Created
Updated
Stars
★ (1)
Tags
Status-Fixed
Type-Defect
Priority-Medium
Ge0rG
on
My firewall is configured to do a number of message compliance checks on messages from strangers, both for messages coming in via s2s and on messages sent by yax.im users.
I'm using `IN_ROSTER: no` on incoming and `NOT SUBSCRIBED?` on outgoing messages to accomplish that.
However, when a user sends a message to themselves, the `NOT SUBSCRIBED?` rule returns true, which is technically correct but not in the spirit of the check. It would be less surprising for both `SUBSCRIBED` and `IN_ROSTER` to return true on self-messages.
Zash
on
I believe one of the XMPP RFCs state that the user is always implicitly subscribed to themselves, so SUBSCRIBED should reflect that.
However, it might make sense for this knowlege to reside in the underlying rostermanager API. Need more input to be sure tho.
My firewall is configured to do a number of message compliance checks on messages from strangers, both for messages coming in via s2s and on messages sent by yax.im users. I'm using `IN_ROSTER: no` on incoming and `NOT SUBSCRIBED?` on outgoing messages to accomplish that. However, when a user sends a message to themselves, the `NOT SUBSCRIBED?` rule returns true, which is technically correct but not in the spirit of the check. It would be less surprising for both `SUBSCRIBED` and `IN_ROSTER` to return true on self-messages.
I believe one of the XMPP RFCs state that the user is always implicitly subscribed to themselves, so SUBSCRIBED should reflect that. However, it might make sense for this knowlege to reside in the underlying rostermanager API. Need more input to be sure tho.
ChangesNot tested, but https://hg.prosody.im/prosody-modules/rev/ff1666716d10
ChangesThanks very much, after a brief test this looks like it's working. Obviously, it doesn't affect `IN_ROSTER` so I had to replace that in my rules.