internal package Foswiki::Contrib::MailerContrib::Subscription

See PublishedAPI for packages intended to be used by Plugin and Contrib authors, or browse all packages.
See also Developing plugins, Developer's Bible, Technical Overview

internal package Foswiki::Contrib::MailerContrib::Subscription

Object that represents a single subscription of a user to notification on a page. A subscription is expressed as a page spec (which may contain wildcards) and a depth of children of matching pages that the user is subscribed to.

new($pages, $childDepth, $options)

Create a new subscription.

stringify() -> string

Return a string representation of this object, in WebNotify format.

matches($topic, $db, $depth) -> boolean

  • $topic - Topic object we are checking
  • $db - Foswiki::Contrib::MailerContrib::UpData database of parent names
  • $depth - If non-zero, check if the parent of the given topic matches as well. undef = 0.
Check if we match this topic. Recurses up the parenthood tree seeing if this is a child of a parent that matches within the depth range.

TODO: '*' should match alot of things..

covers($other, $db) -> $boolean

Return true if this subscription already covers all the topics specified by another subscription. Thus:
  • AA;B covers AB, AxB
  • AA; covers AA;B
  • A;B does not cover AA;

getMode() -> $mode

Get the newsletter mode of this subscription ('', '?' or '!') as specified in WebNotify.

equals($other) -> $boolean

Compare two subscriptions.