xmpp4r 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (103) hide show
  1. data/ChangeLog +12 -0
  2. data/Rakefile +2 -4
  3. data/data/doc/xmpp4r/examples/advanced/adventure/adventuremuc.rb +6 -6
  4. data/data/doc/xmpp4r/examples/advanced/adventure/world.rb +3 -3
  5. data/data/doc/xmpp4r/examples/advanced/minimuc.rb +5 -5
  6. data/data/doc/xmpp4r/examples/advanced/xmpping.rb +17 -4
  7. data/data/doc/xmpp4r/examples/advanced/xmppingrc.sample +5 -0
  8. data/data/doc/xmpp4r/examples/basic/echo_threaded.rb +6 -2
  9. data/data/doc/xmpp4r/examples/basic/muc_owner_config.rb +13 -0
  10. data/lib/xmpp4r.rb +0 -6
  11. data/lib/xmpp4r/bytestreams/helper/filetransfer.rb +6 -7
  12. data/lib/xmpp4r/bytestreams/helper/ibb/base.rb +5 -6
  13. data/lib/xmpp4r/bytestreams/helper/ibb/target.rb +3 -5
  14. data/lib/xmpp4r/bytestreams/helper/socks5bytestreams/base.rb +1 -1
  15. data/lib/xmpp4r/bytestreams/helper/socks5bytestreams/server.rb +10 -8
  16. data/lib/xmpp4r/bytestreams/helper/socks5bytestreams/target.rb +3 -5
  17. data/lib/xmpp4r/bytestreams/iq/bytestreams.rb +11 -17
  18. data/lib/xmpp4r/bytestreams/iq/si.rb +13 -32
  19. data/lib/xmpp4r/callbacks.rb +124 -0
  20. data/lib/xmpp4r/client.rb +2 -5
  21. data/lib/xmpp4r/command/helper/responder.rb +53 -0
  22. data/lib/xmpp4r/command/iq/command.rb +154 -0
  23. data/lib/xmpp4r/connection.rb +49 -12
  24. data/lib/xmpp4r/dataforms/x/data.rb +66 -29
  25. data/lib/xmpp4r/delay/x/delay.rb +2 -3
  26. data/lib/xmpp4r/discovery/iq/discoinfo.rb +20 -33
  27. data/lib/xmpp4r/discovery/iq/discoitems.rb +5 -28
  28. data/lib/xmpp4r/error.rb +5 -10
  29. data/lib/xmpp4r/feature_negotiation/iq/feature.rb +2 -20
  30. data/lib/xmpp4r/httpbinding.rb +5 -0
  31. data/lib/xmpp4r/httpbinding/client.rb +285 -0
  32. data/lib/xmpp4r/iq.rb +22 -41
  33. data/lib/xmpp4r/message.rb +8 -38
  34. data/lib/xmpp4r/muc.rb +2 -0
  35. data/lib/xmpp4r/muc/helper/mucclient.rb +50 -1
  36. data/lib/xmpp4r/muc/helper/simplemucclient.rb +2 -2
  37. data/lib/xmpp4r/muc/iq/mucowner.rb +11 -0
  38. data/lib/xmpp4r/muc/x/muc.rb +2 -30
  39. data/lib/xmpp4r/muc/x/mucuserinvite.rb +4 -2
  40. data/lib/xmpp4r/muc/x/mucuseritem.rb +4 -2
  41. data/lib/xmpp4r/presence.rb +7 -35
  42. data/lib/xmpp4r/pubsub.rb +1 -0
  43. data/lib/xmpp4r/pubsub/helper/nodebrowser.rb +174 -0
  44. data/lib/xmpp4r/pubsub/helper/nodehelper.rb +153 -0
  45. data/lib/xmpp4r/pubsub/helper/servicehelper.rb +326 -0
  46. data/lib/xmpp4r/pubsub/iq/pubsub.rb +19 -0
  47. data/lib/xmpp4r/pubsub/stanzas/event.rb +49 -0
  48. data/lib/xmpp4r/pubsub/stanzas/item.rb +27 -0
  49. data/lib/xmpp4r/pubsub/stanzas/items.rb +35 -0
  50. data/lib/xmpp4r/pubsub/stanzas/subscription.rb +58 -0
  51. data/lib/xmpp4r/query.rb +4 -32
  52. data/lib/xmpp4r/rexmladdons.rb +7 -772
  53. data/lib/xmpp4r/roster/helper/roster.rb +29 -50
  54. data/lib/xmpp4r/roster/iq/roster.rb +6 -35
  55. data/lib/xmpp4r/roster/x/roster.rb +13 -30
  56. data/lib/xmpp4r/rpc.rb +2 -0
  57. data/lib/xmpp4r/rpc/helper/client.rb +114 -0
  58. data/lib/xmpp4r/rpc/helper/server.rb +75 -0
  59. data/lib/xmpp4r/rpc/helper/xmlrpcaddons.rb +57 -0
  60. data/lib/xmpp4r/rpc/iq/rpc.rb +24 -0
  61. data/lib/xmpp4r/sasl.rb +1 -1
  62. data/lib/xmpp4r/semaphore.rb +38 -0
  63. data/lib/xmpp4r/stream.rb +104 -165
  64. data/lib/xmpp4r/streamparser.rb +2 -2
  65. data/lib/xmpp4r/vcard/iq/vcard.rb +5 -12
  66. data/lib/xmpp4r/version/helper/responder.rb +2 -1
  67. data/lib/xmpp4r/version/iq/version.rb +6 -18
  68. data/lib/xmpp4r/x.rb +20 -26
  69. data/lib/xmpp4r/xmpp4r.rb +1 -1
  70. data/lib/xmpp4r/xmppelement.rb +152 -0
  71. data/lib/xmpp4r/{xmlstanza.rb → xmppstanza.rb} +17 -29
  72. data/setup.rb +1 -0
  73. data/test/bytestreams/tc_ibb.rb +8 -8
  74. data/test/dataforms/tc_data.rb +81 -0
  75. data/test/lib/clienttester.rb +20 -17
  76. data/test/muc/tc_muc_mucclient.rb +48 -23
  77. data/test/muc/tc_muc_simplemucclient.rb +7 -4
  78. data/test/muc/tc_mucowner.rb +50 -0
  79. data/test/pubsub/tc_helper.rb +227 -0
  80. data/test/roster/tc_helper.rb +181 -55
  81. data/test/roster/tc_iqqueryroster.rb +33 -0
  82. data/test/roster/tc_xroster.rb +6 -3
  83. data/test/rpc/tc_helper.rb +84 -0
  84. data/test/tc_callbacks.rb +2 -1
  85. data/test/tc_class_names.rb +9 -1
  86. data/test/tc_error.rb +1 -0
  87. data/test/tc_iq.rb +13 -12
  88. data/test/tc_message.rb +1 -0
  89. data/test/tc_presence.rb +1 -0
  90. data/test/tc_rexml.rb +1 -1
  91. data/test/tc_stream.rb +147 -102
  92. data/test/tc_streamComponent.rb +94 -0
  93. data/test/tc_streamError.rb +67 -29
  94. data/test/tc_streamSend.rb +1 -1
  95. data/test/tc_xmppstanza.rb +125 -0
  96. data/test/ts_xmpp4r.rb +37 -28
  97. data/test/version/tc_helper.rb +14 -0
  98. data/test/version/tc_iqqueryversion.rb +4 -3
  99. metadata +163 -123
  100. data/data/doc/xmpp4r/examples/basic/echo_nonthreaded.rb +0 -32
  101. data/lib/callbacks.rb +0 -122
  102. data/test/tc_streamThreaded.rb +0 -168
  103. data/test/tc_xmlstanza.rb +0 -76
@@ -10,7 +10,7 @@ module Jabber
10
10
 
11
11
  ##
12
12
  # The StreamParser uses REXML to parse the incoming XML stream
13
- # of the Jabber protocol and fires XMLStanzas at the Connection
13
+ # of the Jabber protocol and fires XMPPStanza at the Connection
14
14
  # instance.
15
15
  #
16
16
  class StreamParser
@@ -21,7 +21,7 @@ module Jabber
21
21
  # Constructs a parser for the supplied stream (socket input)
22
22
  #
23
23
  # stream:: [IO] Socket input stream
24
- # listener:: [Object.receive(XMLStanza)] The listener (usually a Jabber::Protocol::Connection instance)
24
+ # listener:: [Object.receive(XMPPStanza)] The listener (usually a Jabber::Protocol::Connection instance)
25
25
  #
26
26
  def initialize(stream, listener)
27
27
  @stream = stream
@@ -10,13 +10,15 @@ module Jabber
10
10
  # vCard container for User Information
11
11
  # (can be specified by users themselves, mostly kept on servers)
12
12
  # (JEP 0054)
13
- class IqVcard < REXML::Element
13
+ class IqVcard < XMPPElement
14
+ name_xmlns 'vCard', 'vcard-temp'
15
+ force_xmlns true
16
+
14
17
  ##
15
18
  # Initialize a <vCard/> element
16
19
  # fields:: [Hash] Initialize with keys as XPath element names and values for element texts
17
20
  def initialize(fields=nil)
18
- super("vCard")
19
- add_namespace('vcard-temp')
21
+ super()
20
22
 
21
23
  unless fields.nil?
22
24
  fields.each { |name,value|
@@ -25,13 +27,6 @@ module Jabber
25
27
  end
26
28
  end
27
29
 
28
- ##
29
- # element:: [REXML::Element] to import
30
- # result:: [IqVcard] with all attributes and children copied from element
31
- def IqVcard.import(element)
32
- IqVcard::new.import(element)
33
- end
34
-
35
30
  ##
36
31
  # Get an elements/fields text
37
32
  #
@@ -95,8 +90,6 @@ module Jabber
95
90
  }
96
91
  res
97
92
  end
98
-
99
- Iq.add_elementclass('vCard', IqVcard)
100
93
  end
101
94
  end
102
95
  end
@@ -2,7 +2,7 @@
2
2
  # License:: Ruby's license (see the LICENSE file) or GNU GPL, at your option.
3
3
  # Website::http://home.gna.org/xmpp4r/
4
4
 
5
- require 'callbacks'
5
+ require 'xmpp4r/callbacks'
6
6
  require 'xmpp4r/version/iq/version'
7
7
 
8
8
  module Jabber
@@ -57,6 +57,7 @@ module Jabber
57
57
  answer.query.set_iname(name).set_version(version).set_os(os)
58
58
 
59
59
  @stream.send(answer)
60
+ true
60
61
  }
61
62
  @versioncbs.process(iq, replyblock)
62
63
  else
@@ -13,25 +13,15 @@ module Jabber
13
13
  # Notice that according to JEP 0092 only the <os/> element can be omitted,
14
14
  # <name/> (iname) and <version/> must be present
15
15
  class IqQueryVersion < IqQuery
16
+ name_xmlns 'query', 'jabber:iq:version'
17
+
16
18
  ##
17
19
  # Create a new <query xmlns='jabber:iq:version'/> element
18
- def initialize(iname='', version='', os=nil)
20
+ def initialize(iname=nil, version=nil, os=nil)
19
21
  super()
20
- add_namespace('jabber:iq:version')
21
- set_iname(iname)
22
- set_version(version)
23
- set_os(os)
24
- end
25
-
26
- ##
27
- # Import an element,
28
- # deletes <name/>, <version/> and <os/> elements first
29
- # xe:: [REXML::Element]
30
- def import(xe)
31
- delete_element('name')
32
- delete_element('version')
33
- delete_element('os')
34
- super
22
+ set_iname(iname) if iname
23
+ set_version(version) if version
24
+ set_os(os) if os
35
25
  end
36
26
 
37
27
  ##
@@ -111,8 +101,6 @@ module Jabber
111
101
  self
112
102
  end
113
103
  end
114
-
115
- IqQuery.add_namespaceclass('jabber:iq:version', IqQueryVersion)
116
104
  end
117
105
  end
118
106
 
@@ -2,7 +2,7 @@
2
2
  # License:: Ruby's license (see the LICENSE file) or GNU GPL, at your option.
3
3
  # Website::http://home.gna.org/xmpp4r/
4
4
 
5
- require 'xmpp4r/rexmladdons'
5
+ require 'xmpp4r/xmppelement'
6
6
 
7
7
  module Jabber
8
8
  ##
@@ -10,34 +10,28 @@ module Jabber
10
10
  #
11
11
  # These elements may occur as "attachments"
12
12
  # in [Message] and [Presence] stanzas
13
- class X < REXML::Element
14
- @@namespace_classes = {}
15
-
16
- ##
17
- # Initialize a <x/> element
18
- #
19
- # Does nothing more than setting the element's name to 'x'
20
- def initialize
21
- super("x")
22
- end
13
+ class X < XMPPElement
14
+ name_xmlns 'x'
15
+ force_xmlns true
16
+ end
23
17
 
18
+ module XParent
24
19
  ##
25
- # Create a new [X] from an XML-Element
26
- # element:: [REXML::Element] to import, will be automatically converted if namespace appropriate
27
- def X.import(element)
28
- if @@namespace_classes.has_key?(element.namespace)
29
- @@namespace_classes[element.namespace]::new.import(element)
30
- else
31
- X::new.import(element)
20
+ # Get the first <x/> element in this stanza, or nil if none found.
21
+ # wanted_xmlns:: [String] Optional, find the first <x/> element having this xmlns,
22
+ # wanted_xmlns can also be a derivate of XMPPElement from which the namespace will be taken
23
+ # result:: [REXML::Element] or nil
24
+ def x(wanted_xmlns=nil)
25
+ if wanted_xmlns.kind_of? Class and wanted_xmlns.ancestors.include? XMPPElement
26
+ wanted_xmlns = wanted_xmlns.new.namespace
32
27
  end
33
- end
34
-
35
- ##
36
- # Add a class by namespace for automatic X conversion (see X.import)
37
- # ns:: [String] Namespace (e.g. 'jabber:x:delay')
38
- # xclass:: [X] x class derived from X
39
- def X.add_namespaceclass(ns, xclass)
40
- @@namespace_classes[ns] = xclass
28
+
29
+ each_element('x') { |x|
30
+ if wanted_xmlns.nil? or wanted_xmlns == x.namespace
31
+ return x
32
+ end
33
+ }
34
+ nil
41
35
  end
42
36
  end
43
37
  end
@@ -8,7 +8,7 @@
8
8
  # a simple debug logging support.
9
9
  module Jabber
10
10
  # XMPP4R Version number
11
- XMPP4R_VERSION = '0.3.1'
11
+ XMPP4R_VERSION = '0.3.2'
12
12
  end
13
13
 
14
14
  require 'xmpp4r/client'
@@ -0,0 +1,152 @@
1
+ # =XMPP4R - XMPP Library for Ruby
2
+ # License:: Ruby's license (see the LICENSE file) or GNU GPL, at your option.
3
+ # Website::http://home.gna.org/xmpp4r/
4
+
5
+ require 'xmpp4r/rexmladdons'
6
+
7
+ module Jabber
8
+ class NoNameXmlnsRegistered < RuntimeError
9
+ def initialize(klass)
10
+ super "Class #{klass} has not set name and xmlns"
11
+ end
12
+ end
13
+
14
+ ##
15
+ # This class represents an XML element and provides functionality
16
+ # for automatic casting of XML element classes according to their
17
+ # element name and namespace.
18
+ #
19
+ # Deriving classes must met these criteria:
20
+ # * The element name and namespace must be specified by calling
21
+ # the name_xmlns class method
22
+ # * The class constructor must be callable with no mandatory parameter
23
+ class XMPPElement < REXML::Element
24
+ @@name_xmlns_classes = {}
25
+ @@force_xmlns = false
26
+
27
+ ##
28
+ # Specify XML element name and xmlns for a deriving class,
29
+ # this pair and the class will be added to a global pool
30
+ #
31
+ # If the namespace is nil the class is a "wildcard class"
32
+ # matching elements with any xmlns if no other class with
33
+ # that namespace was defined
34
+ def self.name_xmlns(name, xmlns=nil)
35
+ @@name_xmlns_classes[[name, xmlns]] = self
36
+ end
37
+
38
+ ##
39
+ # Set whether this element is always built with an xmlns attribute
40
+ def self.force_xmlns(force)
41
+ @@force_xmlns = force
42
+ end
43
+
44
+ ##
45
+ # Whether this element is always built with an xmlns attribute
46
+ def self.force_xmlns?
47
+ @@force_xmlns
48
+ end
49
+
50
+ ##
51
+ # Find the name and namespace for a given class.
52
+ # This class must have registered these two values
53
+ # by calling name_xmlns at definition time.
54
+ #
55
+ # Raises an exception if none was found
56
+ # klass:: [Class]
57
+ # result:: [String, String] name and namespace
58
+ def self.name_xmlns_for_class(klass)
59
+ klass.ancestors.each do |klass1|
60
+ @@name_xmlns_classes.each do |name_xmlns,k|
61
+ if klass1 == k
62
+ return name_xmlns
63
+ end
64
+ end
65
+ end
66
+
67
+ raise NoNameXmlnsRegistered.new(klass)
68
+ end
69
+
70
+ ##
71
+ # Find a class for given name and namespace
72
+ # name:: [String]
73
+ # xmlns:: [String]
74
+ # result:: A descendant of XMPPElement or REXML::Element
75
+ def self.class_for_name_xmlns(name, xmlns)
76
+ if @@name_xmlns_classes.has_key? [name, xmlns]
77
+ @@name_xmlns_classes[[name, xmlns]]
78
+ elsif @@name_xmlns_classes.has_key? [name, nil]
79
+ @@name_xmlns_classes[[name, nil]]
80
+ else
81
+ REXML::Element
82
+ end
83
+ end
84
+
85
+ ##
86
+ # Import another REXML::Element descendant to:
87
+ # * Either an element class that registered with
88
+ # name and xmlns before
89
+ # * Or if none was found to the class itself
90
+ # (you may call this class method on a deriving class)
91
+ def self.import(element)
92
+ klass = class_for_name_xmlns(element.name, element.namespace)
93
+ if klass != self and klass.ancestors.include?(self)
94
+ klass.new.import(element)
95
+ else
96
+ self.new.import(element)
97
+ end
98
+ end
99
+
100
+ ##
101
+ # Initialize this element, which will then be initialized
102
+ # with the name registered with name_xmlns.
103
+ def initialize(*arg)
104
+ if arg.empty?
105
+ name, xmlns = self.class::name_xmlns_for_class(self.class)
106
+ super(name)
107
+ if self.class::force_xmlns?
108
+ add_namespace(xmlns)
109
+ end
110
+ else
111
+ super
112
+ end
113
+ end
114
+
115
+ ##
116
+ # Add a child element which will be imported according to the
117
+ # child's name and xmlns
118
+ # element:: [REXML::Element] Child
119
+ # result:: [REXML::Element or descendant of XMPPElement] New child
120
+ def typed_add(element)
121
+ if element.kind_of? REXML::Element
122
+ element_ns = (element.namespace.to_s == '') ? namespace : element.namespace
123
+
124
+ klass = XMPPElement::class_for_name_xmlns(element.name, element_ns)
125
+ if klass != element.class
126
+ element = klass.import(element)
127
+ end
128
+ end
129
+
130
+ super(element)
131
+ end
132
+
133
+ def parent=(new_parent)
134
+ if parent and parent.namespace('') == namespace('') and attributes['xmlns'].nil?
135
+ add_namespace parent.namespace('')
136
+ end
137
+
138
+ super
139
+
140
+ if new_parent and new_parent.namespace('') == namespace('')
141
+ delete_namespace
142
+ end
143
+ end
144
+
145
+ def clone
146
+ cloned = self.class.new
147
+ cloned.add_attributes self.attributes.clone
148
+ cloned.context = @context
149
+ cloned
150
+ end
151
+ end
152
+ end
@@ -2,18 +2,19 @@
2
2
  # License:: Ruby's license (see the LICENSE file) or GNU GPL, at your option.
3
3
  # Website::http://home.gna.org/xmpp4r/
4
4
 
5
- require 'xmpp4r/jid'
5
+ require 'xmpp4r/xmppelement'
6
6
  require 'xmpp4r/error'
7
+ require 'xmpp4r/jid'
7
8
 
8
9
  module Jabber
9
10
  ##
10
11
  # root class of all Jabber XML elements
11
- class XMLStanza < REXML::Element
12
+ class XMPPStanza < XMPPElement
12
13
  ##
13
14
  # Compose a response by doing the following:
14
- # * Create a new XMLStanza of the same subclass
15
+ # * Create a new XMPPStanza of the same subclass
15
16
  # with the same element-name
16
- # * Import xmlstanza if import is true
17
+ # * Import xmppstanza if import is true
17
18
  # * Swap 'to' and 'from'
18
19
  # * Copy 'id'
19
20
  # * Does not take care about the type
@@ -23,33 +24,20 @@ module Jabber
23
24
  # another error on the other side, which could be leading to a
24
25
  # ping-pong effect quickly!
25
26
  #
26
- # xmlstanza:: [XMLStanza] source
27
+ # xmppstanza:: [XMPPStanza] source
27
28
  # import:: [true or false] Copy attributes and children of source
28
- # result:: [XMLStanza] answer stanza
29
- def XMLStanza.answer(xmlstanza, import=true)
30
- x = xmlstanza.class::new
29
+ # result:: [XMPPStanza] answer stanza
30
+ def XMPPStanza.answer(xmppstanza, import=true)
31
+ x = xmppstanza.class::new
31
32
  if import
32
- x.import(xmlstanza)
33
+ x.import(xmppstanza)
33
34
  end
34
- x.from = xmlstanza.to
35
- x.to = xmlstanza.from
36
- x.id = xmlstanza.id
35
+ x.from = xmppstanza.to
36
+ x.to = xmppstanza.from
37
+ x.id = xmppstanza.id
37
38
  x
38
39
  end
39
40
 
40
- ##
41
- # Add a sub-element
42
- #
43
- # Will be converted to [Error] if named "error"
44
- # element:: [REXML::Element] to add
45
- def typed_add(element)
46
- if element.kind_of?(REXML::Element) && (element.name == 'error')
47
- super(Error::import(element))
48
- else
49
- super(element)
50
- end
51
- end
52
-
53
41
  ##
54
42
  # Return the first <tt><error/></tt> child
55
43
  def error
@@ -57,11 +45,11 @@ module Jabber
57
45
  end
58
46
 
59
47
  ##
60
- # Compose a response of this XMLStanza
61
- # (see XMLStanza.answer)
62
- # result:: [XMLStanza] New constructed stanza
48
+ # Compose a response of this XMPPStanza
49
+ # (see XMPPStanza.answer)
50
+ # result:: [XMPPStanza] New constructed stanza
63
51
  def answer(import=true)
64
- XMLStanza.answer(self, import)
52
+ XMPPStanza.answer(self, import)
65
53
  end
66
54
 
67
55
  ##
data/setup.rb CHANGED
@@ -1,3 +1,4 @@
1
+ #!/usr/bin/env ruby
1
2
  #
2
3
  # setup.rb
3
4
  #
@@ -7,6 +7,7 @@ require File::dirname(__FILE__) + '/../lib/clienttester'
7
7
 
8
8
  require 'xmpp4r'
9
9
  require 'xmpp4r/bytestreams'
10
+ require 'xmpp4r/semaphore'
10
11
  include Jabber
11
12
 
12
13
  class IBBTest < Test::Unit::TestCase
@@ -71,10 +72,9 @@ class IBBTest < Test::Unit::TestCase
71
72
 
72
73
  def test_ibb_pingpong
73
74
  ignored_stanzas = 0
74
- wait = Mutex.new
75
- wait.lock
76
- @server.add_message_callback { ignored_stanzas += 1; wait.unlock }
77
- @server.add_iq_callback { ignored_stanzas += 1; wait.unlock }
75
+ wait = Semaphore.new
76
+ @server.add_message_callback { ignored_stanzas += 1; wait.run }
77
+ @server.add_iq_callback { ignored_stanzas += 1; wait.run }
78
78
 
79
79
 
80
80
  target = Bytestreams::IBBTarget.new(@server, '1', nil, '1@a.com/1')
@@ -96,7 +96,7 @@ class IBBTest < Test::Unit::TestCase
96
96
  @client.send("<iq from='1@a.com/1' type='set'>
97
97
  <close xmlns='http://jabber.org/protocol/ibb' sid='another session id'/>
98
98
  </iq>")
99
- wait.lock
99
+ wait.wait
100
100
  assert_equal(1, ignored_stanzas)
101
101
 
102
102
 
@@ -107,12 +107,12 @@ class IBBTest < Test::Unit::TestCase
107
107
  @client.send("<message from='1@a.com/1' type='error'>
108
108
  <data xmlns='http://jabber.org/protocol/ibb' sid='another session id' seq='0'/>
109
109
  </message>")
110
- wait.lock
110
+ wait.wait
111
111
  assert_equal(2, ignored_stanzas)
112
112
  @client.send("<iq from='1@a.com/1' type='set'>
113
113
  <close xmlns='http://jabber.org/protocol/ibb' sid='another session id'/>
114
114
  </iq>")
115
- wait.lock
115
+ wait.wait
116
116
  assert_equal(3, ignored_stanzas)
117
117
 
118
118
 
@@ -133,7 +133,7 @@ class IBBTest < Test::Unit::TestCase
133
133
 
134
134
  assert_equal(3, ignored_stanzas)
135
135
  end
136
-
136
+
137
137
  def test_ibb_error
138
138
  target = Bytestreams::IBBTarget.new(@server, '1', nil, '1@a.com/1')
139
139
  initiator = Bytestreams::IBBInitiator.new(@client, '1', nil, '1@a.com/1')