Skip to content

Commit

Permalink
implement set_affiliations method
Browse files Browse the repository at this point in the history
  • Loading branch information
yong committed Dec 3, 2008
1 parent f1546d7 commit 0789ab5
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion lib/xmpp4r/pubsub/helper/servicehelper.rb
Expand Up @@ -298,7 +298,20 @@ def delete_node(node)
@stream.send_with_id(iq)
end


def set_affiliations(node, jid, role = 'publisher')
iq = basic_pubsub_query(:set)
affiliations = iq.pubsub.add(REXML::Element.new('affiliations'))
affiliations.attributes['node'] = node
affiliation = affiliations.add(REXML::Element.new('affiliation'))
affiliation.attributes['jid'] = jid
affiliation.attributes['affiliation'] = role
res = nil
@stream.send_with_id(iq) { |reply|
true
}
res
end

##
# shows the affiliations on a pubsub service
# node:: [String]
Expand Down

0 comments on commit 0789ab5

Please sign in to comment.