1 package Thrasher
::Plugin
::PEP
;
9 Thrasher::Plugin::PEP - adds PEP support to the virtual accounts,
10 allowing them to publish things in accordance with the PEP spec
14 Thrasher::Plugin::PEP adds PEP support to your Component. The primary
15 manifestation is a function that you can use to publish things with
18 At the moment, I'm not sure how to tell if the server supports PEP.
19 The standard says you're supposed to query
23 use Thrasher
::Callbacks
qw(:all);
24 use Thrasher
::Constants
qw(:all);
25 use Thrasher
::Plugin
::EntityCapabilities
qw(:all);
29 our @EXPORT_OK = qw(pep_publish);
30 our %EXPORT_TAGS = (all
=> \
@EXPORT_OK);
32 # use "do_when('pep_found')" for all major actions
35 if (has_identity_category
('pep')) {
36 succeeded
('pep_detected');
38 failed
('pep_detected');
42 do_when
('server_capabilities_detected', \
&detect_pep
);
44 # Call this to publish something via PEP; nicely blocks on PEP being
47 # If you get errors about "Can't use string ("SOME_NAMESPACE") as an
48 # ARRAY ref", your problem is that you need to add one more list
49 # around your $publish_xml; remember, you're providing the full
50 # children, not just one node.
52 my $component = shift;
54 my $publish_node_ns = shift;
55 my $publish_xml = shift;
57 do_when
('pep_detected',
60 ([[$NS_COMPONENT, 'iq'],
64 [[$NS_PUBSUB, 'pubsub'], {},
66 [[$publish_node_ns, 'publish'], {},