jubjub 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/lib/jubjub/muc.rb ADDED
@@ -0,0 +1,143 @@
1
+ module Jubjub
2
+ class Muc
3
+
4
+ attr_reader :jid, :name
5
+
6
+ def initialize(jid, name = nil, connection = nil)
7
+ @jid = Jubjub::Jid.new(jid)
8
+ @name = name
9
+ @connection = connection
10
+ end
11
+
12
+ def destroy
13
+ @connection.muc.destroy(@jid)
14
+ end
15
+
16
+ # Hide the connection details and show jid as string for compactness
17
+ def inspect
18
+ obj_id = "%x" % (object_id << 1)
19
+ "#<#{self.class}:0x#{obj_id} @jid=\"#{@jid}\" @name=#{@name.inspect}>"
20
+ end
21
+
22
+ end
23
+
24
+ # Uses proxy pattern for syntax sugar
25
+ # and delaying expensive operations until
26
+ # required
27
+ class MucCollection
28
+
29
+ attr_reader :jid
30
+
31
+ def initialize(jid, connection)
32
+ @jid = Jubjub::Jid.new(jid)
33
+ @connection = connection
34
+ end
35
+
36
+ def create(node, nick = nil, &block)
37
+ full_jid = Jubjub::Jid.new node, @jid.domain, nick || @connection.jid.node
38
+
39
+ if block_given?
40
+ # Reserved room
41
+ config = @connection.muc.configuration full_jid
42
+ yield config
43
+ @connection.muc.create full_jid, config
44
+ else
45
+ # Instant room
46
+ result = @connection.muc.create full_jid
47
+ end
48
+
49
+ end
50
+
51
+ # Hint that methods are actually applied to list using method_missing
52
+ def inspect
53
+ list.inspect
54
+ end
55
+
56
+ protected
57
+
58
+ def method_missing(name, *args, &block)
59
+ list.send(name, *args, &block)
60
+ end
61
+
62
+ private
63
+
64
+ def list
65
+ @list ||= @connection.muc.list @jid
66
+ end
67
+
68
+ end
69
+
70
+ class MucConfiguration
71
+
72
+ attr_reader :fields
73
+
74
+ def initialize(config)
75
+ check_config config
76
+
77
+ @fields = config
78
+ end
79
+
80
+ def [](arg)
81
+ if fields.has_key? arg
82
+ case fields[arg][:type]
83
+ when 'boolean'
84
+ fields[arg][:value] == '1' || fields[arg][:value] == 'true' || fields[arg][:value] == true ? true : false
85
+ when 'jid-multi'
86
+ fields[arg][:value].map{|j| Jubjub::Jid.new j }
87
+ when 'jid-single'
88
+ Jubjub::Jid.new fields[arg][:value]
89
+ else
90
+ fields[arg][:value]
91
+ end
92
+ end
93
+ end
94
+
95
+ def []=(arg,value)
96
+ if fields.has_key? arg
97
+ check_options arg, value if fields[arg].has_key?(:options)
98
+ value = Array[value].flatten if fields[arg][:type].match /-multi$/
99
+ fields[arg][:value] = value
100
+ else
101
+ raise Jubjub::ArgumentError.new("#{arg} is not a valid field")
102
+ end
103
+ end
104
+
105
+ def settings
106
+ Hash[fields.keys.map{|field|
107
+ [field, Array[self[field]].flatten]
108
+ }]
109
+ end
110
+
111
+ def ==(thing)
112
+ thing.is_a?( self.class ) && thing.fields == self.fields
113
+ end
114
+
115
+ private
116
+
117
+ def check_options(name, value)
118
+ valid_options = fields[name][:options].map{|o| o[:value].to_s }
119
+ invalid_options = Array[value].flatten - valid_options
120
+ raise Jubjub::ArgumentError.new(
121
+ "#{invalid_options.join(', ')} is not an accepted value please choose from #{valid_options.join(', ')}"
122
+ ) if invalid_options.any?
123
+ end
124
+
125
+ def check_config(config)
126
+ required = [:type]
127
+ understood = required + [:label, :options, :value]
128
+
129
+ raise Jubjub::ArgumentError.new("please initialize with a hash of the format { 'foo' => {:type => 'boolean', :value => false, :label => 'Fooey'} }") unless config.is_a? Hash
130
+
131
+ config.each do |name,argument|
132
+ required.each{|r| raise Jubjub::ArgumentError.new(":#{r} is missing for #{name}") unless argument.keys.include? r }
133
+
134
+ mystery_arguments = (argument.keys - understood)
135
+ raise Jubjub::ArgumentError.new(
136
+ ":#{mystery_arguments.join(', :')} is not a recognised option for #{name}"
137
+ ) if mystery_arguments.any?
138
+ end
139
+ end
140
+
141
+ end
142
+
143
+ end
@@ -0,0 +1,60 @@
1
+ require 'jubjub/errors'
2
+ require 'jubjub/jid'
3
+ require 'jubjub/connection/xmpp_gateway'
4
+
5
+ module Jubjub
6
+
7
+ module User
8
+
9
+ def self.included base
10
+ base.extend ClassMethods
11
+ end
12
+
13
+ module ClassMethods
14
+ def jubjub_client options = {}
15
+ # Setup defaults
16
+ default_connection_settings = {
17
+ :host => '127.0.0.1',
18
+ :port => '8000'
19
+ }.merge options[:connection_settings] || {}
20
+
21
+ [:jid, :password].each do |key|
22
+ raise Jubjub::ArgumentError.new("missing :#{key} option") unless options.has_key? key
23
+ end
24
+
25
+ define_method "jubjub_jid" do
26
+ Jubjub::Jid.new(send(options[:jid]))
27
+ end
28
+
29
+ define_method "jubjub_password" do
30
+ send(options[:password])
31
+ end
32
+
33
+ define_method "jubjub_connection_settings" do
34
+ default_connection_settings
35
+ end
36
+
37
+ include InstanceMethods
38
+ end
39
+ end
40
+
41
+ module InstanceMethods
42
+ def jubjub_connection
43
+ @jubjub_connection ||= Jubjub::Connection::XmppGateway.new(jubjub_jid, jubjub_password, jubjub_connection_settings)
44
+ end
45
+
46
+ def authenticated?
47
+ jubjub_connection.authenticated?
48
+ end
49
+
50
+ # List muc rooms
51
+ # if no jid is specified will default to 'connection.JID_DOMAIN'
52
+ def mucs(jid = nil)
53
+ jid ||= "conference.#{jubjub_jid.domain}"
54
+ Jubjub::MucCollection.new(jid, jubjub_connection)
55
+ end
56
+ end
57
+
58
+ end
59
+
60
+ end
data/lib/jubjub.rb ADDED
@@ -0,0 +1 @@
1
+ require 'jubjub/user'
@@ -0,0 +1,136 @@
1
+ require 'spec_helper'
2
+
3
+ describe Jubjub::Connection::XmppGateway do
4
+
5
+ before do
6
+ @connection = Jubjub::Connection::XmppGateway.new('theozaurus@theo-template.local','secret', {:host => '127.0.0.1', :port => '8000'})
7
+ end
8
+
9
+ describe "muc" do
10
+
11
+ describe "create" do
12
+
13
+ use_vcr_cassette 'muc create', :record => :new_episodes
14
+
15
+ it "return a Jubjub::Muc" do
16
+ @room = @connection.muc.create( Jubjub::Jid.new 'room@conference.theo-template.local/nick' )
17
+ @room.should be_a_kind_of Jubjub::Muc
18
+ @room.jid.should == Jubjub::Jid.new( 'room@conference.theo-template.local' )
19
+ end
20
+
21
+ after do
22
+ @room.destroy
23
+ end
24
+
25
+ end
26
+
27
+ describe "create with configuration" do
28
+
29
+ use_vcr_cassette 'muc create with configuration', :record => :new_episodes
30
+
31
+ it "return a Jubjub::Muc" do
32
+ @config = Jubjub::MucConfiguration.new("allow_query_users" => { :type => "boolean", :value => "1", :label => "Allow users to query other users" })
33
+
34
+ @room = @connection.muc.create( Jubjub::Jid.new( 'room@conference.theo-template.local/nick' ), @config )
35
+ @room.should be_a_kind_of Jubjub::Muc
36
+ @room.jid.should == Jubjub::Jid.new( 'room@conference.theo-template.local' )
37
+ end
38
+
39
+ after do
40
+ @room.destroy
41
+ end
42
+
43
+ end
44
+
45
+ describe "configuration" do
46
+
47
+ use_vcr_cassette 'muc configuration', :record => :new_episodes
48
+
49
+ it "return a Jubjub::MucConfiguration" do
50
+ config = @connection.muc.configuration( Jubjub::Jid.new 'room@conference.theo-template.local/nick' )
51
+
52
+ expected_config = {
53
+ "allow_query_users" => { :type => "boolean", :value => "1", :label => "Allow users to query other users" },
54
+ "allow_private_messages" => { :type => "boolean", :value => "1", :label => "Allow users to send private messages" },
55
+ "muc#roomconfig_publicroom" => { :type => "boolean", :value => "1", :label => "Make room public searchable" },
56
+ "muc#roomconfig_allowinvites" => { :type => "boolean", :value => "0", :label => "Allow users to send invites" },
57
+ "muc#roomconfig_allowvisitornickchange" => { :type => "boolean", :value => "1", :label => "Allow visitors to change nickname" },
58
+ "muc#roomconfig_membersonly" => { :type => "boolean", :value => "0", :label => "Make room members-only" },
59
+ "muc#roomconfig_persistentroom" => { :type => "boolean", :value => "0", :label => "Make room persistent" },
60
+ "members_by_default" => { :type => "boolean", :value => "1", :label => "Default users as participants" },
61
+ "muc#roomconfig_passwordprotectedroom" => { :type => "boolean", :value => "0", :label => "Make room password protected" },
62
+ "public_list" => { :type => "boolean", :value => "1", :label => "Make participants list public" },
63
+ "muc#roomconfig_changesubject" => { :type => "boolean", :value => "1", :label => "Allow users to change the subject" },
64
+ "muc#roomconfig_moderatedroom" => { :type => "boolean", :value => "1", :label => "Make room moderated" },
65
+ "muc#roomconfig_allowvisitorstatus" => { :type => "boolean", :value => "1", :label => "Allow visitors to send status text in presence updates" },
66
+ "muc#roomconfig_roomdesc" => { :type => "text-single", :value => "", :label => "Room description" },
67
+ "muc#roomconfig_roomname" => { :type => "text-single", :value => "", :label => "Room title" },
68
+ "muc#roomconfig_roomsecret" => { :type => "text-private", :value => "", :label => "Password" },
69
+ "FORM_TYPE" => { :type => "hidden", :value => "http://jabber.org/protocol/muc#roomconfig", :label => nil },
70
+ "muc#roomconfig_whois" => {
71
+ :type => "list-single",
72
+ :value => "moderators",
73
+ :label => "Present real Jabber IDs to",
74
+ :options => [
75
+ { :value => "moderators", :label => "moderators only" },
76
+ { :value => "anyone", :label => "anyone" }]},
77
+ "muc#roomconfig_maxusers" => {
78
+ :type => "list-single",
79
+ :value => "200",
80
+ :label => "Maximum Number of Occupants",
81
+ :options => [
82
+ { :value => "5", :label => "5" },
83
+ { :value => "10", :label => "10" },
84
+ { :value => "20", :label => "20" },
85
+ { :value => "30", :label => "30" },
86
+ { :value => "50", :label => "50" },
87
+ { :value => "100", :label => "100" },
88
+ { :value => "200", :label => "200" }]}
89
+ }
90
+
91
+ config.should == Jubjub::MucConfiguration.new(expected_config)
92
+ end
93
+
94
+ end
95
+
96
+ describe "list" do
97
+
98
+ use_vcr_cassette 'muc list', :record => :new_episodes
99
+
100
+ before do
101
+ @connection.muc.create Jubjub::Jid.new( 'test_1@conference.theo-template.local/nick' )
102
+ @connection.muc.create Jubjub::Jid.new( 'test_2@conference.theo-template.local/nick' )
103
+ end
104
+
105
+ it "return an array of Jubjub::Muc" do
106
+ list = @connection.muc.list( Jubjub::Jid.new 'conference.theo-template.local' )
107
+ list.should be_a_kind_of Array
108
+
109
+ list.size.should eql(2)
110
+ list[0].should be_a_kind_of Jubjub::Muc
111
+ list[0].jid.should == Jubjub::Jid.new( 'test_1@conference.theo-template.local' )
112
+ list[1].should be_a_kind_of Jubjub::Muc
113
+ list[1].jid.should == Jubjub::Jid.new( 'test_2@conference.theo-template.local' )
114
+ end
115
+
116
+ end
117
+
118
+ describe "destroy" do
119
+
120
+ use_vcr_cassette 'muc destroy', :record => :new_episodes
121
+
122
+ before do
123
+ @jid = Jubjub::Jid.new 'extra@conference.theo-template.local'
124
+ @full_jid = Jubjub::Jid.new 'extra@conference.theo-template.local/nick'
125
+ @connection.muc.create @full_jid
126
+ end
127
+
128
+ it "return true" do
129
+ @connection.muc.destroy( @jid ).should be_true
130
+ end
131
+
132
+ end
133
+
134
+ end
135
+
136
+ end
@@ -0,0 +1,134 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: :post
5
+ uri: http://theozaurus%40theo-template.local:secret@127.0.0.1:8000/
6
+ body: stanza=%3c%3fxml%20version%3d%221.0%22%3f%3e%0a%3cpresence%20to%3d%22room%40conference.theo-template.local%2fnick%22%3e%0a%20%20%3cx%20xmlns%3d%22http%3a%2f%2fjabber.org%2fprotocol%2fmuc%22%2f%3e%0a%3c%2fpresence%3e%0a
7
+ headers:
8
+ content-type:
9
+ - application/x-www-form-urlencoded
10
+ response: !ruby/struct:VCR::Response
11
+ status: !ruby/struct:VCR::ResponseStatus
12
+ code: 200
13
+ message: ...
14
+ headers:
15
+ content-type:
16
+ - application/xml
17
+ content-length:
18
+ - "40"
19
+ body: |
20
+ #<EventMachine::Timer:0x00000100b406f8>
21
+
22
+ http_version: "1.1"
23
+ - !ruby/struct:VCR::HTTPInteraction
24
+ request: !ruby/struct:VCR::Request
25
+ method: :post
26
+ uri: http://theozaurus%40theo-template.local:secret@127.0.0.1:8000/
27
+ body: stanza=%3c%3fxml%20version%3d%221.0%22%3f%3e%0a%3ciq%20type%3d%22get%22%20to%3d%22room%40conference.theo-template.local%22%3e%0a%20%20%3cquery%20xmlns%3d%22http%3a%2f%2fjabber.org%2fprotocol%2fmuc%23owner%22%2f%3e%0a%3c%2fiq%3e%0a
28
+ headers:
29
+ content-type:
30
+ - application/x-www-form-urlencoded
31
+ response: !ruby/struct:VCR::Response
32
+ status: !ruby/struct:VCR::ResponseStatus
33
+ code: 200
34
+ message: ...
35
+ headers:
36
+ content-type:
37
+ - application/xml
38
+ content-length:
39
+ - "3713"
40
+ body: |
41
+ <iq type="result" id="blather0015" from="room@conference.theo-template.local" to="theozaurus@theo-template.local/302767734712965589199547">
42
+ <query xmlns="http://jabber.org/protocol/muc#owner">
43
+ <instructions>You need an x:data capable client to configure room</instructions>
44
+ <x xmlns="jabber:x:data" type="form">
45
+ <title>Configuration of room room@conference.theo-template.local</title>
46
+ <field type="hidden" var="FORM_TYPE">
47
+ <value>http://jabber.org/protocol/muc#roomconfig</value>
48
+ </field>
49
+ <field type="text-single" label="Room title" var="muc#roomconfig_roomname">
50
+ <value/>
51
+ </field>
52
+ <field type="text-single" label="Room description" var="muc#roomconfig_roomdesc">
53
+ <value/>
54
+ </field>
55
+ <field type="boolean" label="Make room persistent" var="muc#roomconfig_persistentroom">
56
+ <value>0</value>
57
+ </field>
58
+ <field type="boolean" label="Make room public searchable" var="muc#roomconfig_publicroom">
59
+ <value>1</value>
60
+ </field>
61
+ <field type="boolean" label="Make participants list public" var="public_list">
62
+ <value>1</value>
63
+ </field>
64
+ <field type="boolean" label="Make room password protected" var="muc#roomconfig_passwordprotectedroom">
65
+ <value>0</value>
66
+ </field>
67
+ <field type="text-private" label="Password" var="muc#roomconfig_roomsecret">
68
+ <value/>
69
+ </field>
70
+ <field type="list-single" label="Maximum Number of Occupants" var="muc#roomconfig_maxusers">
71
+ <value>200</value>
72
+ <option label="5">
73
+ <value>5</value>
74
+ </option>
75
+ <option label="10">
76
+ <value>10</value>
77
+ </option>
78
+ <option label="20">
79
+ <value>20</value>
80
+ </option>
81
+ <option label="30">
82
+ <value>30</value>
83
+ </option>
84
+ <option label="50">
85
+ <value>50</value>
86
+ </option>
87
+ <option label="100">
88
+ <value>100</value>
89
+ </option>
90
+ <option label="200">
91
+ <value>200</value>
92
+ </option>
93
+ </field>
94
+ <field type="list-single" label="Present real Jabber IDs to" var="muc#roomconfig_whois">
95
+ <value>moderators</value>
96
+ <option label="moderators only">
97
+ <value>moderators</value>
98
+ </option>
99
+ <option label="anyone">
100
+ <value>anyone</value>
101
+ </option>
102
+ </field>
103
+ <field type="boolean" label="Make room members-only" var="muc#roomconfig_membersonly">
104
+ <value>0</value>
105
+ </field>
106
+ <field type="boolean" label="Make room moderated" var="muc#roomconfig_moderatedroom">
107
+ <value>1</value>
108
+ </field>
109
+ <field type="boolean" label="Default users as participants" var="members_by_default">
110
+ <value>1</value>
111
+ </field>
112
+ <field type="boolean" label="Allow users to change the subject" var="muc#roomconfig_changesubject">
113
+ <value>1</value>
114
+ </field>
115
+ <field type="boolean" label="Allow users to send private messages" var="allow_private_messages">
116
+ <value>1</value>
117
+ </field>
118
+ <field type="boolean" label="Allow users to query other users" var="allow_query_users">
119
+ <value>1</value>
120
+ </field>
121
+ <field type="boolean" label="Allow users to send invites" var="muc#roomconfig_allowinvites">
122
+ <value>0</value>
123
+ </field>
124
+ <field type="boolean" label="Allow visitors to send status text in presence updates" var="muc#roomconfig_allowvisitorstatus">
125
+ <value>1</value>
126
+ </field>
127
+ <field type="boolean" label="Allow visitors to change nickname" var="muc#roomconfig_allowvisitornickchange">
128
+ <value>1</value>
129
+ </field>
130
+ </x>
131
+ </query>
132
+ </iq>
133
+
134
+ http_version: "1.1"
@@ -0,0 +1,68 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: :post
5
+ uri: http://theozaurus%40theo-template.local:secret@127.0.0.1:8000/
6
+ body: stanza=%3c%3fxml%20version%3d%221.0%22%3f%3e%0a%3cpresence%20to%3d%22room%40conference.theo-template.local%2fnick%22%3e%0a%20%20%3cx%20xmlns%3d%22http%3a%2f%2fjabber.org%2fprotocol%2fmuc%22%2f%3e%0a%3c%2fpresence%3e%0a
7
+ headers:
8
+ content-type:
9
+ - application/x-www-form-urlencoded
10
+ response: !ruby/struct:VCR::Response
11
+ status: !ruby/struct:VCR::ResponseStatus
12
+ code: 200
13
+ message: ...
14
+ headers:
15
+ content-type:
16
+ - application/xml
17
+ content-length:
18
+ - "40"
19
+ body: |
20
+ #<EventMachine::Timer:0x0000010118fce8>
21
+
22
+ http_version: "1.1"
23
+ - !ruby/struct:VCR::HTTPInteraction
24
+ request: !ruby/struct:VCR::Request
25
+ method: :post
26
+ uri: http://theozaurus%40theo-template.local:secret@127.0.0.1:8000/
27
+ body: stanza=%3c%3fxml%20version%3d%221.0%22%3f%3e%0a%3ciq%20type%3d%22set%22%20to%3d%22room%40conference.theo-template.local%22%3e%0a%20%20%3cquery%20xmlns%3d%22http%3a%2f%2fjabber.org%2fprotocol%2fmuc%23owner%22%3e%0a%20%20%20%20%3cx%20xmlns%3d%22jabber%3ax%3adata%22%20type%3d%22submit%22%2f%3e%0a%20%20%3c%2fquery%3e%0a%3c%2fiq%3e%0a
28
+ headers:
29
+ content-type:
30
+ - application/x-www-form-urlencoded
31
+ response: !ruby/struct:VCR::Response
32
+ status: !ruby/struct:VCR::ResponseStatus
33
+ code: 200
34
+ message: ...
35
+ headers:
36
+ content-type:
37
+ - application/xml
38
+ content-length:
39
+ - "204"
40
+ body: |
41
+ <iq type="result" id="blather0027" from="room@conference.theo-template.local" to="theozaurus@theo-template.local/34112166161296558195646897">
42
+ <query xmlns="http://jabber.org/protocol/muc#owner"/>
43
+ </iq>
44
+
45
+ http_version: "1.1"
46
+ - !ruby/struct:VCR::HTTPInteraction
47
+ request: !ruby/struct:VCR::Request
48
+ method: :post
49
+ uri: http://theozaurus%40theo-template.local:secret@127.0.0.1:8000/
50
+ body: stanza=%3c%3fxml%20version%3d%221.0%22%3f%3e%0a%3ciq%20type%3d%22set%22%20to%3d%22room%40conference.theo-template.local%22%3e%0a%20%20%3cquery%20xmlns%3d%22http%3a%2f%2fjabber.org%2fprotocol%2fmuc%23owner%22%3e%0a%20%20%20%20%3cdestroy%2f%3e%0a%20%20%3c%2fquery%3e%0a%3c%2fiq%3e%0a
51
+ headers:
52
+ content-type:
53
+ - application/x-www-form-urlencoded
54
+ response: !ruby/struct:VCR::Response
55
+ status: !ruby/struct:VCR::ResponseStatus
56
+ code: 200
57
+ message: ...
58
+ headers:
59
+ content-type:
60
+ - application/xml
61
+ content-length:
62
+ - "204"
63
+ body: |
64
+ <iq type="result" id="blather0029" from="room@conference.theo-template.local" to="theozaurus@theo-template.local/34112166161296558195646897">
65
+ <query xmlns="http://jabber.org/protocol/muc#owner"/>
66
+ </iq>
67
+
68
+ http_version: "1.1"
@@ -0,0 +1,68 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: :post
5
+ uri: http://theozaurus%40theo-template.local:secret@127.0.0.1:8000/
6
+ body: stanza=%3c%3fxml%20version%3d%221.0%22%3f%3e%0a%3cpresence%20to%3d%22room%40conference.theo-template.local%2fnick%22%3e%0a%20%20%3cx%20xmlns%3d%22http%3a%2f%2fjabber.org%2fprotocol%2fmuc%22%2f%3e%0a%3c%2fpresence%3e%0a
7
+ headers:
8
+ content-type:
9
+ - application/x-www-form-urlencoded
10
+ response: !ruby/struct:VCR::Response
11
+ status: !ruby/struct:VCR::ResponseStatus
12
+ code: 200
13
+ message: ...
14
+ headers:
15
+ content-type:
16
+ - application/xml
17
+ content-length:
18
+ - "40"
19
+ body: |
20
+ #<EventMachine::Timer:0x00000100a06288>
21
+
22
+ http_version: "1.1"
23
+ - !ruby/struct:VCR::HTTPInteraction
24
+ request: !ruby/struct:VCR::Request
25
+ method: :post
26
+ uri: http://theozaurus%40theo-template.local:secret@127.0.0.1:8000/
27
+ body: stanza=%3c%3fxml%20version%3d%221.0%22%3f%3e%0a%3ciq%20type%3d%22set%22%20to%3d%22room%40conference.theo-template.local%22%3e%0a%20%20%3cquery%20xmlns%3d%22http%3a%2f%2fjabber.org%2fprotocol%2fmuc%23owner%22%3e%0a%20%20%20%20%3cx%20xmlns%3d%22jabber%3ax%3adata%22%20type%3d%22submit%22%3e%0a%20%20%20%20%20%20%3cfield%20var%3d%22allow_query_users%22%3e%0a%20%20%20%20%20%20%20%20%3cvalue%3etrue%3c%2fvalue%3e%0a%20%20%20%20%20%20%3c%2ffield%3e%0a%20%20%20%20%3c%2fx%3e%0a%20%20%3c%2fquery%3e%0a%3c%2fiq%3e%0a
28
+ headers:
29
+ content-type:
30
+ - application/x-www-form-urlencoded
31
+ response: !ruby/struct:VCR::Response
32
+ status: !ruby/struct:VCR::ResponseStatus
33
+ code: 200
34
+ message: ...
35
+ headers:
36
+ content-type:
37
+ - application/xml
38
+ content-length:
39
+ - "203"
40
+ body: |
41
+ <iq type="result" id="blather001d" from="room@conference.theo-template.local" to="theozaurus@theo-template.local/9294273861296560773995396">
42
+ <query xmlns="http://jabber.org/protocol/muc#owner"/>
43
+ </iq>
44
+
45
+ http_version: "1.1"
46
+ - !ruby/struct:VCR::HTTPInteraction
47
+ request: !ruby/struct:VCR::Request
48
+ method: :post
49
+ uri: http://theozaurus%40theo-template.local:secret@127.0.0.1:8000/
50
+ body: stanza=%3c%3fxml%20version%3d%221.0%22%3f%3e%0a%3ciq%20type%3d%22set%22%20to%3d%22room%40conference.theo-template.local%22%3e%0a%20%20%3cquery%20xmlns%3d%22http%3a%2f%2fjabber.org%2fprotocol%2fmuc%23owner%22%3e%0a%20%20%20%20%3cdestroy%2f%3e%0a%20%20%3c%2fquery%3e%0a%3c%2fiq%3e%0a
51
+ headers:
52
+ content-type:
53
+ - application/x-www-form-urlencoded
54
+ response: !ruby/struct:VCR::Response
55
+ status: !ruby/struct:VCR::ResponseStatus
56
+ code: 200
57
+ message: ...
58
+ headers:
59
+ content-type:
60
+ - application/xml
61
+ content-length:
62
+ - "203"
63
+ body: |
64
+ <iq type="result" id="blather001f" from="room@conference.theo-template.local" to="theozaurus@theo-template.local/9294273861296560773995396">
65
+ <query xmlns="http://jabber.org/protocol/muc#owner"/>
66
+ </iq>
67
+
68
+ http_version: "1.1"
@@ -0,0 +1,68 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: :post
5
+ uri: http://theozaurus%40theo-template.local:secret@127.0.0.1:8000/
6
+ body: stanza=%3c%3fxml%20version%3d%221.0%22%3f%3e%0a%3cpresence%20to%3d%22extra%40conference.theo-template.local%2fnick%22%3e%0a%20%20%3cx%20xmlns%3d%22http%3a%2f%2fjabber.org%2fprotocol%2fmuc%22%2f%3e%0a%3c%2fpresence%3e%0a
7
+ headers:
8
+ content-type:
9
+ - application/x-www-form-urlencoded
10
+ response: !ruby/struct:VCR::Response
11
+ status: !ruby/struct:VCR::ResponseStatus
12
+ code: 200
13
+ message: ...
14
+ headers:
15
+ content-type:
16
+ - application/xml
17
+ content-length:
18
+ - "40"
19
+ body: |
20
+ #<EventMachine::Timer:0x000001010e8df8>
21
+
22
+ http_version: "1.1"
23
+ - !ruby/struct:VCR::HTTPInteraction
24
+ request: !ruby/struct:VCR::Request
25
+ method: :post
26
+ uri: http://theozaurus%40theo-template.local:secret@127.0.0.1:8000/
27
+ body: stanza=%3c%3fxml%20version%3d%221.0%22%3f%3e%0a%3ciq%20type%3d%22set%22%20to%3d%22extra%40conference.theo-template.local%22%3e%0a%20%20%3cquery%20xmlns%3d%22http%3a%2f%2fjabber.org%2fprotocol%2fmuc%23owner%22%3e%0a%20%20%20%20%3cx%20xmlns%3d%22jabber%3ax%3adata%22%20type%3d%22submit%22%2f%3e%0a%20%20%3c%2fquery%3e%0a%3c%2fiq%3e%0a
28
+ headers:
29
+ content-type:
30
+ - application/x-www-form-urlencoded
31
+ response: !ruby/struct:VCR::Response
32
+ status: !ruby/struct:VCR::ResponseStatus
33
+ code: 200
34
+ message: ...
35
+ headers:
36
+ content-type:
37
+ - application/xml
38
+ content-length:
39
+ - "205"
40
+ body: |
41
+ <iq type="result" id="blather0031" from="extra@conference.theo-template.local" to="theozaurus@theo-template.local/34112166161296558195646897">
42
+ <query xmlns="http://jabber.org/protocol/muc#owner"/>
43
+ </iq>
44
+
45
+ http_version: "1.1"
46
+ - !ruby/struct:VCR::HTTPInteraction
47
+ request: !ruby/struct:VCR::Request
48
+ method: :post
49
+ uri: http://theozaurus%40theo-template.local:secret@127.0.0.1:8000/
50
+ body: stanza=%3c%3fxml%20version%3d%221.0%22%3f%3e%0a%3ciq%20type%3d%22set%22%20to%3d%22extra%40conference.theo-template.local%22%3e%0a%20%20%3cquery%20xmlns%3d%22http%3a%2f%2fjabber.org%2fprotocol%2fmuc%23owner%22%3e%0a%20%20%20%20%3cdestroy%2f%3e%0a%20%20%3c%2fquery%3e%0a%3c%2fiq%3e%0a
51
+ headers:
52
+ content-type:
53
+ - application/x-www-form-urlencoded
54
+ response: !ruby/struct:VCR::Response
55
+ status: !ruby/struct:VCR::ResponseStatus
56
+ code: 200
57
+ message: ...
58
+ headers:
59
+ content-type:
60
+ - application/xml
61
+ content-length:
62
+ - "205"
63
+ body: |
64
+ <iq type="result" id="blather0033" from="extra@conference.theo-template.local" to="theozaurus@theo-template.local/34112166161296558195646897">
65
+ <query xmlns="http://jabber.org/protocol/muc#owner"/>
66
+ </iq>
67
+
68
+ http_version: "1.1"