#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
  1. 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.

  2. 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.

    Changes
    • tags Status-Accepted
  3. Zash on

    Not tested, but https://hg.prosody.im/prosody-modules/rev/ff1666716d10

    Changes
    • owner Zash
    • tags Status-Fixed
  4. Ge0rG on

    Thanks 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.

New comment

Not published. Used for spam prevention and optional update notifications.