Skip to content

Instantly share code, notes, and snippets.

@soulfly
Created June 2, 2014 08:15
Show Gist options
  • Save soulfly/5ee6a2788021da145c9a to your computer and use it in GitHub Desktop.
Save soulfly/5ee6a2788021da145c9a to your computer and use it in GitHub Desktop.
Chat MUC xmpp4r: add affilations
require 'xmpp4r/client'
require 'xmpp4r/muc'
puts "1"
client = Jabber::Client.new(Jabber::JID::new("2960-6@chatstage.quickblox.com"))
client.connect
puts "2"
client.auth("emmaemma")
puts "3"
room = Jabber::MUC::SimpleMUCClient.new(client)
room.join "6_ownersroom@muc.chatstage.quickblox.com/2960"
puts "4"
item = Jabber::MUC::IqQueryMUCAdminItem.new(:owner, :moderator, "2-6@chatstage.quickblox.com")
occ_jids = []
occ_jids << item
puts occ_jids
room.send_affiliations(occ_jids)
room.exit
puts "5"
client.close
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment