Kim Alvefur
0c9d47f6ff
util.pubsub: Silence luacheck warnings, leaving notes on future proper fix
6 years ago
Kim Alvefur
f6592c459e
util.pubsub: Pass subscribers trough a filter callback
7 years ago
Kim Alvefur
9be2ed1c4b
util.pubsub: Factor out calling of broadcaster
...
This will simplify doing things along with broadcasting.
7 years ago
Matthew Wild
b5b9b70c88
util.pubsub, pubsub.lib and tests: Add text to precondition-not-met error ( fixes #1455 )
6 years ago
Kim Alvefur
5d4504e51b
util.pubsub: Validate node configuration on node creation ( fixes #1328 )
7 years ago
Kim Alvefur
da56744645
util.pubsub: Add support for requesting multiple specific items (needed for #1305 )
7 years ago
Kim Alvefur
9f19a48ee2
util.pubsub: Restore subscription index from stored data ( fixes #1281 )
7 years ago
Kim Alvefur
eaac53d041
util.pubsub: Clarify comment about return value
7 years ago
Matthew Wild
44b3954d56
util.pubsub: Allow publishing with a config that should be used as defaults only
7 years ago
Kim Alvefur
fb2fdc660b
util.pubsub: Expand comment on return type from get_items
7 years ago
Kim Alvefur
a60bb9bb13
util.pubsub: Explicitly add all capabilities to the 'outcast' affiliation for completeness
7 years ago
Kim Alvefur
df5360e6a3
util.pubsub: Comments describing the return values of methods
7 years ago
Matthew Wild
11c4cee97a
util.pubsub: Add 'service' field to all events
7 years ago
Kim Alvefur
dedea4fb31
util.pubsub: Remove unused argument
...
I think this was probably a copy-paste mistake.
7 years ago
Matthew Wild
99b85eda32
util.pubsub: Fire item-published/<node> to allow for easier handling of per-node items
7 years ago
Matthew Wild
512d844d91
util.pubsub, pubsub.lib: Improve error on attempt to publish invalid item
7 years ago
Matthew Wild
23cfd1b4d0
Pubsub: Add tests for :get_last_item() and fix for non-persistent nodes
7 years ago
Matthew Wild
0a0695d96b
util.pubsub: Fix whitespace [luacheck]
7 years ago
Matthew Wild
6e48cd5ece
Backed out changeset 27d800ddc3b0 (see below)
...
It's uncertain whether item not existing should be success and
nil, or fail with an error.
XEP-0060's "fetch most recent item" actually fetches a list of up
to N items. N here is a maximum, not a minimum. The feeling is that
no items is simply an empty list, not a failure of the operation.
7 years ago
Matthew Wild
6ff958994e
util.pubsub: get_last_item(): Fail with item-not-found if no item yet published
7 years ago
Matthew Wild
6643aeb7e6
util.pubsub: get_last_item(): Return error if node does not exist
7 years ago
Matthew Wild
716c68f983
pubsub.lib, util.pubsub: Move precondition checks to util.pubsub
7 years ago
Matthew Wild
fe83df56a9
util.pubsub: Add comment to clarify return values
7 years ago
Kim Alvefur
98c9778cc7
util.pubsub: Pass "retract" as the type of such broadcasts
...
This moves some XEP-0060 awkwardness out of util.pubsub and into mod_pubsub
A retraction is broadcast in an <items> container, whereas most other
kinds of broadcasts are in a container with a name matching the 'kind'
attribute.
7 years ago
Matthew Wild
a86ca3faa1
util.pubsub: Allow outcasts to get their subscription status
7 years ago
Matthew Wild
1a41278b49
util.pubsub: For open nodes, default affiliation is "member"
...
This allows entities without an explicit affiliation to retrieve items,
which is specified by the XEP. Table 6: "Node Access Models" states that
for 'open' nodes, "any entity may retrieve items from the node".
See also discussion at:
https://mail.jabber.org/pipermail/standards/2018-August/035320.html
8 years ago
Matthew Wild
7df3613768
mod_pep, util.pubsub: Rename restricted->outcast, none->member and add new 'none' affiliation to better match XEP-0060
8 years ago
Matthew Wild
ff222c379d
mod_pubsub, mod_pep, util.pubsub: Move capability definitions into util.pubsub to avoid duplication
8 years ago
Kim Alvefur
5a5354e422
util.pubsub: Include node defaults from current service object
8 years ago
Kim Alvefur
4b848862f5
util.pubsub: Re-check all subscriptions on access_model change, unsubscribing those no longer allowed
8 years ago
Matthew Wild
711d3e4bf3
util.pubsub: Add support for publish_model config option
8 years ago
Kim Alvefur
2b8327099a
util.pubsub: Apply defaults metatable before config check (thanks pep.)
...
Makes it so that the callback sees the default if it’s not in the form,
which makes it easier to validate.
8 years ago
Matthew Wild
43c1195531
util.pubsub: Add method to retrieve node configuration
8 years ago
Matthew Wild
62fd30552e
util.pubsub: Use service.node_defaults in case config.node_defaults was not provided (thanks jonasw)
8 years ago
Matthew Wild
31e2ba5f99
util.pubsub: Tweak default affiliation of access models (fixes failing test)
...
11:56:59 MattJ> Someone who has the ability to subscribe does not have the "subscriber"
affiliation until they actually subscribe, they just have the normal "none" affiliation
(which has permission to subscribe)
11:58:05 MattJ> However if the access model is whitelist, then anyone not on the whitelist
has an implicit negative affiliation, which we don't currently have, so I just named "restricted"
11:58:16 MattJ> Since it doesn't exist in any code yet, it has no permissions
8 years ago
Kim Alvefur
d9abcdd048
util.pubsub: Look for a configured callback for more complicated access models
8 years ago
Kim Alvefur
afd936d00c
util.pubsub: Add initial support for configurable access models
8 years ago
Matthew Wild
82655ffa2b
util.pubsub: Add support for a config validation function
8 years ago
Kim Alvefur
fc5c354891
util.pubsub: Support for returning *all* subscriptions
8 years ago
Kim Alvefur
762e7dc70b
util.pubsub: Return error code known by pubsub.lib if persistent creation fails
8 years ago
Kim Alvefur
c4fdeeed13
util.pubsub: Store subscription changes
8 years ago
Kim Alvefur
75560d4ebe
util.pubsub: Persistence on affiliation change
8 years ago
Kim Alvefur
3d14011cf2
util.pubsub: Remove node from persistent storage on deletion
8 years ago
Kim Alvefur
dcd5ebba7d
util.pubsub: Persist nodes on configuration change
8 years ago
Kim Alvefur
6d3f13818b
util.pubsub: Fix applying per service node defaults when loading from nodestore
8 years ago
Kim Alvefur
2629409a3b
util.pubsub: Fix typo
8 years ago
Kim Alvefur
3b0aeea254
util.pubsub: Normalize JID used as affiliation
...
XEP-0060 4.1 Affiliations
> All affiliations MUST be based on a bare JID
8 years ago
Kim Alvefur
ee883aff47
util.pubsub: Also check for affiliation set on bare JID
...
This fixes eg publishing from a full JID when the affiliation has been
set on the bare JID, as would be common in XMPP.
8 years ago
Kim Alvefur
308036df99
util.pubsub: Pass node and service objects to broadcaster to allow eg config access
8 years ago
Kim Alvefur
972335a4b2
util.pubsub: Add a default/fallback JID normalization function
8 years ago