Details

      Description

      Add subscription option support to mod_pubsub.

      This requires changes to the pubsub_state schema, which has a number
      of echoes through the node plugin system. To ameliorate future pain,
      get_state and set_state node calls have been removed, leaving only
      get_states where the schema is leaked programatically.

      General:

      • Only pubsub#expire is handled right now.
      • Options are parsed in mod_pubsub and passed into node.
      • mod_pubsub refactored to support better processing of stanzas for
        XEP support.
      • As a proof-of-concept, "pubsub#expire" options are supported,
        which stop delivering messages after the expiry time.

      API Changes:

      • node subscribe_node arity changed to support options argument.
      • node set_subscription calls take an additional argument for
        subscription options.
      • node get_options calls return a tuple of {Subscription, Options}

        .

      • Don't export get_state/3 and set_state/1 from gen_pubsub_node. Use
        the more specific functions instead.
      • added node subscription_options/0 call for default node options.
      • pubsub_state record has an `options' field now, which is added if
        necessary when ejabberd starts up.
      • node XForm stuff renamed and split to be used for subscription
        options, too. This could be cleaned up a lot.

      Bug Fixes:

      • Work around a bug caused by ejabberd's use of "node_type" in config.
      • Return the result of set_node as the result of node configuration.
      • Handle mnesia:abort calls in mod_pubsub:node_call/3.
      • Drop resource when setting and getting subscription in
        node_default.

      TODO:

      • Affiliation load is kind of awkward. Have another look at it.
        (node:get/set subscription fns).
      • When a subscription expires it should probably be removed from the
        state table.
      • A node should be able to support required options, with mod_pubsub
        supplying the negotiation.
      1. authorize-get-items-fix.patch.gz
        0.8 kB
        Brian Cully
      2. sub-options.patch.gz
        15 kB
        Brian Cully
      3. sub-options.patch.gz
        15 kB
        Brian Cully
      4. sub-options.patch.gz
        9 kB
        Brian Cully

        Issue Links

          Activity

          Hide
          bjc Brian Cully added a comment -

          Here's the credit, let me know if it's appropriate:

          Support for subscription-options and multi-subscribe features was
          added by Brian Cully <bjc@kublai.com>. Subscriptions and options are
          stored in the pubsub_subscription table, with a link to them provided
          by the subscriptions field of pubsub_state. For information on
          subscription-options and mulit-subscribe see XEP-0060 sections 6.1.6,
          6.2.3.1, 6.2.3.5, and 6.3. For information on subscription leases see
          XEP-0060 section 12.18.

          -bjc

          Show
          bjc Brian Cully added a comment - Here's the credit, let me know if it's appropriate: Support for subscription-options and multi-subscribe features was added by Brian Cully <bjc@kublai.com>. Subscriptions and options are stored in the pubsub_subscription table, with a link to them provided by the subscriptions field of pubsub_state. For information on subscription-options and mulit-subscribe see XEP-0060 sections 6.1.6, 6.2.3.1, 6.2.3.5, and 6.3. For information on subscription leases see XEP-0060 section 12.18. -bjc
          Hide
          bjc Brian Cully added a comment -

          This patch fixes getting items via IQ on nodes with `authorize' access models.

          Show
          bjc Brian Cully added a comment - This patch fixes getting items via IQ on nodes with `authorize' access models.
          Hide
          cromain@process-one.net Christophe Romain added a comment -

          perfect

          Show
          cromain@process-one.net Christophe Romain added a comment - perfect
          Hide
          cromain@process-one.net Christophe Romain added a comment -

          last patch included in r2157

          Show
          cromain@process-one.net Christophe Romain added a comment - last patch included in r2157
          Hide
          cromain@process-one.net Christophe Romain added a comment -

          i'm closing that ticket as the features seems to work correctly.
          please reopen if you find some bugs.

          Show
          cromain@process-one.net Christophe Romain added a comment - i'm closing that ticket as the features seems to work correctly. please reopen if you find some bugs.

            People

            • Votes:
              1 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development