Hi, I’m working with JRuby 1.5.6, OpenFire 3.6.4 and the latest nightly of smack/smackx (smack_2011-01-30). What I’m trying to do is to modify the affiliation of a node subscriber:
---- BEGIN SNIP ----
conn, mgr = establish_xmpp_connection(node_owner, password)
form = ConfigureForm.new(FormType.submit)
Workaround for OF-16
Create node, as owner-user
my_leaf_node = mgr.createNode(’/foo/bar’)
now subscribe user (login, passwd) to ‘/foo/bar’
conn, mgr = establish_xmpp_connection(login, password)
jid = conn.getUser.split(’/’).first
user_node = mgr.getNode(’/foo/bar’) #LeafNode
set_member_affiliation(‘member’, user_node, jid) <------- Method to be written
---- END SNIP ----
I’d expect smackx to provide some high-level abstraction to connect to the pubsub service as the ‘/foo/bar’ node owner and then modify the affiliation of the user from the default ‘none’ to ‘member’ After having read both javadocs and documentation, I can’t find any class/method that performs the desired operation.
Moreover, if I try to go a little bit deeper into the stack, I can’t find any way to use Node.sendPubsubPacket for sending the stanza:
firstname.lastname@example.org/mac' to='pubsub.example.net' id='ent2'>
<affiliations node='/foo/bar'> <affiliation email@example.com' affiliation='member'/> </affiliations>
Appart from what was said in http://community.igniterealtime.org/thread/31210 (a bit outdated and unanswered) and http://community.igniterealtime.org/thread/43547 (it’s not an API question), I couldn’t find any more information in these forums about how to use smackx to have an user’s affiliation set, other than maybe sending the raw stanza.
Any help will be much appreciated. TIA.