xmpp4r 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +12 -0
- data/Rakefile +2 -4
- data/data/doc/xmpp4r/examples/advanced/adventure/adventuremuc.rb +6 -6
- data/data/doc/xmpp4r/examples/advanced/adventure/world.rb +3 -3
- data/data/doc/xmpp4r/examples/advanced/minimuc.rb +5 -5
- data/data/doc/xmpp4r/examples/advanced/xmpping.rb +17 -4
- data/data/doc/xmpp4r/examples/advanced/xmppingrc.sample +5 -0
- data/data/doc/xmpp4r/examples/basic/echo_threaded.rb +6 -2
- data/data/doc/xmpp4r/examples/basic/muc_owner_config.rb +13 -0
- data/lib/xmpp4r.rb +0 -6
- data/lib/xmpp4r/bytestreams/helper/filetransfer.rb +6 -7
- data/lib/xmpp4r/bytestreams/helper/ibb/base.rb +5 -6
- data/lib/xmpp4r/bytestreams/helper/ibb/target.rb +3 -5
- data/lib/xmpp4r/bytestreams/helper/socks5bytestreams/base.rb +1 -1
- data/lib/xmpp4r/bytestreams/helper/socks5bytestreams/server.rb +10 -8
- data/lib/xmpp4r/bytestreams/helper/socks5bytestreams/target.rb +3 -5
- data/lib/xmpp4r/bytestreams/iq/bytestreams.rb +11 -17
- data/lib/xmpp4r/bytestreams/iq/si.rb +13 -32
- data/lib/xmpp4r/callbacks.rb +124 -0
- data/lib/xmpp4r/client.rb +2 -5
- data/lib/xmpp4r/command/helper/responder.rb +53 -0
- data/lib/xmpp4r/command/iq/command.rb +154 -0
- data/lib/xmpp4r/connection.rb +49 -12
- data/lib/xmpp4r/dataforms/x/data.rb +66 -29
- data/lib/xmpp4r/delay/x/delay.rb +2 -3
- data/lib/xmpp4r/discovery/iq/discoinfo.rb +20 -33
- data/lib/xmpp4r/discovery/iq/discoitems.rb +5 -28
- data/lib/xmpp4r/error.rb +5 -10
- data/lib/xmpp4r/feature_negotiation/iq/feature.rb +2 -20
- data/lib/xmpp4r/httpbinding.rb +5 -0
- data/lib/xmpp4r/httpbinding/client.rb +285 -0
- data/lib/xmpp4r/iq.rb +22 -41
- data/lib/xmpp4r/message.rb +8 -38
- data/lib/xmpp4r/muc.rb +2 -0
- data/lib/xmpp4r/muc/helper/mucclient.rb +50 -1
- data/lib/xmpp4r/muc/helper/simplemucclient.rb +2 -2
- data/lib/xmpp4r/muc/iq/mucowner.rb +11 -0
- data/lib/xmpp4r/muc/x/muc.rb +2 -30
- data/lib/xmpp4r/muc/x/mucuserinvite.rb +4 -2
- data/lib/xmpp4r/muc/x/mucuseritem.rb +4 -2
- data/lib/xmpp4r/presence.rb +7 -35
- data/lib/xmpp4r/pubsub.rb +1 -0
- data/lib/xmpp4r/pubsub/helper/nodebrowser.rb +174 -0
- data/lib/xmpp4r/pubsub/helper/nodehelper.rb +153 -0
- data/lib/xmpp4r/pubsub/helper/servicehelper.rb +326 -0
- data/lib/xmpp4r/pubsub/iq/pubsub.rb +19 -0
- data/lib/xmpp4r/pubsub/stanzas/event.rb +49 -0
- data/lib/xmpp4r/pubsub/stanzas/item.rb +27 -0
- data/lib/xmpp4r/pubsub/stanzas/items.rb +35 -0
- data/lib/xmpp4r/pubsub/stanzas/subscription.rb +58 -0
- data/lib/xmpp4r/query.rb +4 -32
- data/lib/xmpp4r/rexmladdons.rb +7 -772
- data/lib/xmpp4r/roster/helper/roster.rb +29 -50
- data/lib/xmpp4r/roster/iq/roster.rb +6 -35
- data/lib/xmpp4r/roster/x/roster.rb +13 -30
- data/lib/xmpp4r/rpc.rb +2 -0
- data/lib/xmpp4r/rpc/helper/client.rb +114 -0
- data/lib/xmpp4r/rpc/helper/server.rb +75 -0
- data/lib/xmpp4r/rpc/helper/xmlrpcaddons.rb +57 -0
- data/lib/xmpp4r/rpc/iq/rpc.rb +24 -0
- data/lib/xmpp4r/sasl.rb +1 -1
- data/lib/xmpp4r/semaphore.rb +38 -0
- data/lib/xmpp4r/stream.rb +104 -165
- data/lib/xmpp4r/streamparser.rb +2 -2
- data/lib/xmpp4r/vcard/iq/vcard.rb +5 -12
- data/lib/xmpp4r/version/helper/responder.rb +2 -1
- data/lib/xmpp4r/version/iq/version.rb +6 -18
- data/lib/xmpp4r/x.rb +20 -26
- data/lib/xmpp4r/xmpp4r.rb +1 -1
- data/lib/xmpp4r/xmppelement.rb +152 -0
- data/lib/xmpp4r/{xmlstanza.rb → xmppstanza.rb} +17 -29
- data/setup.rb +1 -0
- data/test/bytestreams/tc_ibb.rb +8 -8
- data/test/dataforms/tc_data.rb +81 -0
- data/test/lib/clienttester.rb +20 -17
- data/test/muc/tc_muc_mucclient.rb +48 -23
- data/test/muc/tc_muc_simplemucclient.rb +7 -4
- data/test/muc/tc_mucowner.rb +50 -0
- data/test/pubsub/tc_helper.rb +227 -0
- data/test/roster/tc_helper.rb +181 -55
- data/test/roster/tc_iqqueryroster.rb +33 -0
- data/test/roster/tc_xroster.rb +6 -3
- data/test/rpc/tc_helper.rb +84 -0
- data/test/tc_callbacks.rb +2 -1
- data/test/tc_class_names.rb +9 -1
- data/test/tc_error.rb +1 -0
- data/test/tc_iq.rb +13 -12
- data/test/tc_message.rb +1 -0
- data/test/tc_presence.rb +1 -0
- data/test/tc_rexml.rb +1 -1
- data/test/tc_stream.rb +147 -102
- data/test/tc_streamComponent.rb +94 -0
- data/test/tc_streamError.rb +67 -29
- data/test/tc_streamSend.rb +1 -1
- data/test/tc_xmppstanza.rb +125 -0
- data/test/ts_xmpp4r.rb +37 -28
- data/test/version/tc_helper.rb +14 -0
- data/test/version/tc_iqqueryversion.rb +4 -3
- metadata +163 -123
- data/data/doc/xmpp4r/examples/basic/echo_nonthreaded.rb +0 -32
- data/lib/callbacks.rb +0 -122
- data/test/tc_streamThreaded.rb +0 -168
- data/test/tc_xmlstanza.rb +0 -76
@@ -4,6 +4,7 @@ $:.unshift File::dirname(__FILE__) + '/../../lib'
|
|
4
4
|
|
5
5
|
require 'test/unit'
|
6
6
|
require 'xmpp4r/rexmladdons'
|
7
|
+
require 'xmpp4r/iq'
|
7
8
|
require 'xmpp4r/version/iq/version'
|
8
9
|
include Jabber
|
9
10
|
|
@@ -11,9 +12,9 @@ class Version::IqQueryVersionTest < Test::Unit::TestCase
|
|
11
12
|
def test_create_empty
|
12
13
|
x = Version::IqQueryVersion::new
|
13
14
|
assert_equal('jabber:iq:version', x.namespace)
|
14
|
-
|
15
|
-
|
16
|
-
|
15
|
+
assert_nil(x.iname)
|
16
|
+
assert_nil(x.version)
|
17
|
+
assert_nil(x.os)
|
17
18
|
end
|
18
19
|
|
19
20
|
def test_create
|
metadata
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
|
-
rubygems_version: 0.9.
|
2
|
+
rubygems_version: 0.9.4
|
3
3
|
specification_version: 1
|
4
4
|
name: xmpp4r
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.3.
|
7
|
-
date: 2007-
|
6
|
+
version: 0.3.2
|
7
|
+
date: 2007-10-15 00:00:00 +02:00
|
8
8
|
summary: Ruby library for Jabber Instant-Messaging
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -38,183 +38,223 @@ files:
|
|
38
38
|
- UPDATING
|
39
39
|
- lib/
|
40
40
|
- lib/xmpp4r.rb
|
41
|
-
- lib/callbacks.rb
|
42
41
|
- lib/xmpp4r
|
43
|
-
- lib/xmpp4r/
|
44
|
-
- lib/xmpp4r/
|
45
|
-
- lib/xmpp4r/
|
46
|
-
- lib/xmpp4r/
|
47
|
-
- lib/xmpp4r/
|
48
|
-
- lib/xmpp4r/
|
49
|
-
- lib/xmpp4r/
|
50
|
-
- lib/xmpp4r/
|
42
|
+
- lib/xmpp4r/component.rb
|
43
|
+
- lib/xmpp4r/discovery
|
44
|
+
- lib/xmpp4r/discovery/iq
|
45
|
+
- lib/xmpp4r/discovery/iq/discoitems.rb
|
46
|
+
- lib/xmpp4r/discovery/iq/discoinfo.rb
|
47
|
+
- lib/xmpp4r/command
|
48
|
+
- lib/xmpp4r/command/iq
|
49
|
+
- lib/xmpp4r/command/iq/command.rb
|
50
|
+
- lib/xmpp4r/command/helper
|
51
|
+
- lib/xmpp4r/command/helper/responder.rb
|
52
|
+
- lib/xmpp4r/pubsub.rb
|
53
|
+
- lib/xmpp4r/connection.rb
|
51
54
|
- lib/xmpp4r/authenticationfailure.rb
|
55
|
+
- lib/xmpp4r/error.rb
|
56
|
+
- lib/xmpp4r/idgenerator.rb
|
52
57
|
- lib/xmpp4r/version.rb
|
53
|
-
- lib/xmpp4r/
|
54
|
-
- lib/xmpp4r/
|
58
|
+
- lib/xmpp4r/feature_negotiation.rb
|
59
|
+
- lib/xmpp4r/sasl.rb
|
60
|
+
- lib/xmpp4r/vcard
|
61
|
+
- lib/xmpp4r/vcard/iq
|
62
|
+
- lib/xmpp4r/vcard/iq/vcard.rb
|
63
|
+
- lib/xmpp4r/vcard/helper
|
64
|
+
- lib/xmpp4r/vcard/helper/vcard.rb
|
55
65
|
- lib/xmpp4r/rexmladdons.rb
|
56
|
-
- lib/xmpp4r/
|
66
|
+
- lib/xmpp4r/delay
|
67
|
+
- lib/xmpp4r/delay/x
|
68
|
+
- lib/xmpp4r/delay/x/delay.rb
|
69
|
+
- lib/xmpp4r/muc.rb
|
70
|
+
- lib/xmpp4r/xmpp4r.rb
|
71
|
+
- lib/xmpp4r/semaphore.rb
|
72
|
+
- lib/xmpp4r/pubsub
|
73
|
+
- lib/xmpp4r/pubsub/iq
|
74
|
+
- lib/xmpp4r/pubsub/iq/pubsub.rb
|
75
|
+
- lib/xmpp4r/pubsub/helper
|
76
|
+
- lib/xmpp4r/pubsub/helper/servicehelper.rb
|
77
|
+
- lib/xmpp4r/pubsub/helper/nodehelper.rb
|
78
|
+
- lib/xmpp4r/pubsub/helper/nodebrowser.rb
|
79
|
+
- lib/xmpp4r/pubsub/stanzas
|
80
|
+
- lib/xmpp4r/pubsub/stanzas/items.rb
|
81
|
+
- lib/xmpp4r/pubsub/stanzas/item.rb
|
82
|
+
- lib/xmpp4r/pubsub/stanzas/event.rb
|
83
|
+
- lib/xmpp4r/pubsub/stanzas/subscription.rb
|
84
|
+
- lib/xmpp4r/query.rb
|
85
|
+
- lib/xmpp4r/x.rb
|
86
|
+
- lib/xmpp4r/message.rb
|
87
|
+
- lib/xmpp4r/debuglog.rb
|
57
88
|
- lib/xmpp4r/streamparser.rb
|
89
|
+
- lib/xmpp4r/dataforms.rb
|
90
|
+
- lib/xmpp4r/dataforms
|
91
|
+
- lib/xmpp4r/dataforms/x
|
92
|
+
- lib/xmpp4r/dataforms/x/data.rb
|
58
93
|
- lib/xmpp4r/discovery.rb
|
59
|
-
- lib/xmpp4r/
|
60
|
-
- lib/xmpp4r/
|
61
|
-
- lib/xmpp4r/
|
62
|
-
- lib/xmpp4r/
|
63
|
-
- lib/xmpp4r/
|
64
|
-
- lib/xmpp4r/
|
65
|
-
- lib/xmpp4r/
|
94
|
+
- lib/xmpp4r/muc
|
95
|
+
- lib/xmpp4r/muc/iq
|
96
|
+
- lib/xmpp4r/muc/iq/mucowner.rb
|
97
|
+
- lib/xmpp4r/muc/helper
|
98
|
+
- lib/xmpp4r/muc/helper/mucclient.rb
|
99
|
+
- lib/xmpp4r/muc/helper/mucbrowser.rb
|
100
|
+
- lib/xmpp4r/muc/helper/simplemucclient.rb
|
101
|
+
- lib/xmpp4r/muc/x
|
102
|
+
- lib/xmpp4r/muc/x/mucuserinvite.rb
|
103
|
+
- lib/xmpp4r/muc/x/mucuseritem.rb
|
104
|
+
- lib/xmpp4r/muc/x/muc.rb
|
66
105
|
- lib/xmpp4r/stream.rb
|
67
|
-
- lib/xmpp4r/
|
68
|
-
- lib/xmpp4r/
|
69
|
-
- lib/xmpp4r/
|
70
|
-
- lib/xmpp4r/
|
106
|
+
- lib/xmpp4r/roster
|
107
|
+
- lib/xmpp4r/roster/iq
|
108
|
+
- lib/xmpp4r/roster/iq/roster.rb
|
109
|
+
- lib/xmpp4r/roster/helper
|
110
|
+
- lib/xmpp4r/roster/helper/roster.rb
|
111
|
+
- lib/xmpp4r/roster/x
|
112
|
+
- lib/xmpp4r/roster/x/roster.rb
|
113
|
+
- lib/xmpp4r/errorexception.rb
|
71
114
|
- lib/xmpp4r/roster.rb
|
115
|
+
- lib/xmpp4r/version
|
116
|
+
- lib/xmpp4r/version/iq
|
117
|
+
- lib/xmpp4r/version/iq/version.rb
|
118
|
+
- lib/xmpp4r/version/helper
|
119
|
+
- lib/xmpp4r/version/helper/simpleresponder.rb
|
120
|
+
- lib/xmpp4r/version/helper/responder.rb
|
121
|
+
- lib/xmpp4r/rpc
|
122
|
+
- lib/xmpp4r/rpc/iq
|
123
|
+
- lib/xmpp4r/rpc/iq/rpc.rb
|
124
|
+
- lib/xmpp4r/rpc/helper
|
125
|
+
- lib/xmpp4r/rpc/helper/server.rb
|
126
|
+
- lib/xmpp4r/rpc/helper/xmlrpcaddons.rb
|
127
|
+
- lib/xmpp4r/rpc/helper/client.rb
|
128
|
+
- lib/xmpp4r/httpbinding
|
129
|
+
- lib/xmpp4r/httpbinding/client.rb
|
130
|
+
- lib/xmpp4r/xmppelement.rb
|
72
131
|
- lib/xmpp4r/bytestreams
|
73
132
|
- lib/xmpp4r/bytestreams/iq
|
74
133
|
- lib/xmpp4r/bytestreams/iq/si.rb
|
75
134
|
- lib/xmpp4r/bytestreams/iq/bytestreams.rb
|
76
135
|
- lib/xmpp4r/bytestreams/helper
|
77
|
-
- lib/xmpp4r/bytestreams/helper/filetransfer.rb
|
78
136
|
- lib/xmpp4r/bytestreams/helper/ibb
|
79
137
|
- lib/xmpp4r/bytestreams/helper/ibb/base.rb
|
80
138
|
- lib/xmpp4r/bytestreams/helper/ibb/target.rb
|
81
139
|
- lib/xmpp4r/bytestreams/helper/ibb/initiator.rb
|
140
|
+
- lib/xmpp4r/bytestreams/helper/filetransfer.rb
|
82
141
|
- lib/xmpp4r/bytestreams/helper/socks5bytestreams
|
83
142
|
- lib/xmpp4r/bytestreams/helper/socks5bytestreams/base.rb
|
84
|
-
- lib/xmpp4r/bytestreams/helper/socks5bytestreams/socks5.rb
|
85
143
|
- lib/xmpp4r/bytestreams/helper/socks5bytestreams/target.rb
|
86
144
|
- lib/xmpp4r/bytestreams/helper/socks5bytestreams/server.rb
|
87
145
|
- lib/xmpp4r/bytestreams/helper/socks5bytestreams/initiator.rb
|
88
|
-
- lib/xmpp4r/
|
89
|
-
- lib/xmpp4r/vcard
|
90
|
-
- lib/xmpp4r/
|
91
|
-
- lib/xmpp4r/
|
92
|
-
- lib/xmpp4r/
|
146
|
+
- lib/xmpp4r/bytestreams/helper/socks5bytestreams/socks5.rb
|
147
|
+
- lib/xmpp4r/vcard.rb
|
148
|
+
- lib/xmpp4r/callbacks.rb
|
149
|
+
- lib/xmpp4r/presence.rb
|
150
|
+
- lib/xmpp4r/jid.rb
|
151
|
+
- lib/xmpp4r/rpc.rb
|
152
|
+
- lib/xmpp4r/bytestreams.rb
|
153
|
+
- lib/xmpp4r/xmppstanza.rb
|
93
154
|
- lib/xmpp4r/feature_negotiation
|
94
155
|
- lib/xmpp4r/feature_negotiation/iq
|
95
156
|
- lib/xmpp4r/feature_negotiation/iq/feature.rb
|
96
|
-
- lib/xmpp4r/
|
97
|
-
- lib/xmpp4r/
|
98
|
-
- lib/xmpp4r/
|
99
|
-
- lib/xmpp4r/
|
100
|
-
- lib/xmpp4r/version/helper/simpleresponder.rb
|
101
|
-
- lib/xmpp4r/version/helper/responder.rb
|
102
|
-
- lib/xmpp4r/muc
|
103
|
-
- lib/xmpp4r/muc/x
|
104
|
-
- lib/xmpp4r/muc/x/muc.rb
|
105
|
-
- lib/xmpp4r/muc/x/mucuseritem.rb
|
106
|
-
- lib/xmpp4r/muc/x/mucuserinvite.rb
|
107
|
-
- lib/xmpp4r/muc/helper
|
108
|
-
- lib/xmpp4r/muc/helper/mucbrowser.rb
|
109
|
-
- lib/xmpp4r/muc/helper/mucclient.rb
|
110
|
-
- lib/xmpp4r/muc/helper/simplemucclient.rb
|
111
|
-
- lib/xmpp4r/roster
|
112
|
-
- lib/xmpp4r/roster/iq
|
113
|
-
- lib/xmpp4r/roster/iq/roster.rb
|
114
|
-
- lib/xmpp4r/roster/x
|
115
|
-
- lib/xmpp4r/roster/x/roster.rb
|
116
|
-
- lib/xmpp4r/roster/helper
|
117
|
-
- lib/xmpp4r/roster/helper/roster.rb
|
118
|
-
- lib/xmpp4r/discovery
|
119
|
-
- lib/xmpp4r/discovery/iq
|
120
|
-
- lib/xmpp4r/discovery/iq/discoitems.rb
|
121
|
-
- lib/xmpp4r/discovery/iq/discoinfo.rb
|
122
|
-
- lib/xmpp4r/delay
|
123
|
-
- lib/xmpp4r/delay/x
|
124
|
-
- lib/xmpp4r/delay/x/delay.rb
|
125
|
-
- lib/xmpp4r/dataforms
|
126
|
-
- lib/xmpp4r/dataforms/x
|
127
|
-
- lib/xmpp4r/dataforms/x/data.rb
|
157
|
+
- lib/xmpp4r/iq.rb
|
158
|
+
- lib/xmpp4r/delay.rb
|
159
|
+
- lib/xmpp4r/httpbinding.rb
|
160
|
+
- lib/xmpp4r/client.rb
|
128
161
|
- data/
|
129
162
|
- data/doc
|
130
163
|
- data/doc/xmpp4r
|
131
164
|
- data/doc/xmpp4r/examples
|
132
|
-
- data/doc/xmpp4r/examples/buggy
|
133
|
-
- data/doc/xmpp4r/examples/buggy/miniedgarr_watch.rb
|
134
|
-
- data/doc/xmpp4r/examples/buggy/miniedgarr_cgi.rb
|
135
|
-
- data/doc/xmpp4r/examples/buggy/jabber2jabber
|
136
|
-
- data/doc/xmpp4r/examples/buggy/jabber2jabber/jabber2jabber.rb
|
137
165
|
- data/doc/xmpp4r/examples/advanced
|
138
|
-
- data/doc/xmpp4r/examples/advanced/versionpoll.rb
|
139
|
-
- data/doc/xmpp4r/examples/advanced/sendfile.conf
|
140
|
-
- data/doc/xmpp4r/examples/advanced/sendfile.rb
|
141
|
-
- data/doc/xmpp4r/examples/advanced/gtkmucclient.rb
|
142
|
-
- data/doc/xmpp4r/examples/advanced/migrate.rb
|
143
|
-
- data/doc/xmpp4r/examples/advanced/rosterdiscovery.rb
|
144
|
-
- data/doc/xmpp4r/examples/advanced/fileserve.conf
|
145
166
|
- data/doc/xmpp4r/examples/advanced/xmppingrc.sample
|
146
|
-
- data/doc/xmpp4r/examples/advanced/
|
147
|
-
- data/doc/xmpp4r/examples/advanced/fileserve.rb
|
167
|
+
- data/doc/xmpp4r/examples/advanced/recvfile.rb
|
148
168
|
- data/doc/xmpp4r/examples/advanced/xmpping.rb
|
169
|
+
- data/doc/xmpp4r/examples/advanced/sendfile.rb
|
149
170
|
- data/doc/xmpp4r/examples/advanced/minimuc.rb
|
150
|
-
- data/doc/xmpp4r/examples/advanced/
|
171
|
+
- data/doc/xmpp4r/examples/advanced/versionpoll.rb
|
151
172
|
- data/doc/xmpp4r/examples/advanced/shellmgr
|
152
|
-
- data/doc/xmpp4r/examples/advanced/shellmgr/shellmgr_test.rb
|
153
173
|
- data/doc/xmpp4r/examples/advanced/shellmgr/shellmgr_jabber.rb
|
154
174
|
- data/doc/xmpp4r/examples/advanced/shellmgr/shellmgr.rb
|
175
|
+
- data/doc/xmpp4r/examples/advanced/shellmgr/shellmgr_test.rb
|
176
|
+
- data/doc/xmpp4r/examples/advanced/fileserve.conf
|
177
|
+
- data/doc/xmpp4r/examples/advanced/sendfile.conf
|
178
|
+
- data/doc/xmpp4r/examples/advanced/fileserve.rb
|
179
|
+
- data/doc/xmpp4r/examples/advanced/migrate.rb
|
180
|
+
- data/doc/xmpp4r/examples/advanced/gtkmucclient.rb
|
181
|
+
- data/doc/xmpp4r/examples/advanced/rosterdiscovery.rb
|
182
|
+
- data/doc/xmpp4r/examples/advanced/getonline.rb
|
155
183
|
- data/doc/xmpp4r/examples/advanced/adventure
|
156
|
-
- data/doc/xmpp4r/examples/advanced/adventure/cube.xml
|
157
184
|
- data/doc/xmpp4r/examples/advanced/adventure/README
|
185
|
+
- data/doc/xmpp4r/examples/advanced/adventure/cube.xml
|
186
|
+
- data/doc/xmpp4r/examples/advanced/adventure/adventure.rb
|
187
|
+
- data/doc/xmpp4r/examples/advanced/adventure/tower.xml
|
158
188
|
- data/doc/xmpp4r/examples/advanced/adventure/world.rb
|
159
189
|
- data/doc/xmpp4r/examples/advanced/adventure/adventuremuc.rb
|
160
|
-
- data/doc/xmpp4r/examples/advanced/adventure/tower.xml
|
161
|
-
- data/doc/xmpp4r/examples/advanced/adventure/adventure.rb
|
162
190
|
- data/doc/xmpp4r/examples/basic
|
191
|
+
- data/doc/xmpp4r/examples/basic/component.rb
|
163
192
|
- data/doc/xmpp4r/examples/basic/send_vcard.rb
|
164
|
-
- data/doc/xmpp4r/examples/basic/
|
165
|
-
- data/doc/xmpp4r/examples/basic/
|
166
|
-
- data/doc/xmpp4r/examples/basic/
|
193
|
+
- data/doc/xmpp4r/examples/basic/muc_owner_config.rb
|
194
|
+
- data/doc/xmpp4r/examples/basic/remove_registration.rb
|
195
|
+
- data/doc/xmpp4r/examples/basic/echo_threaded.rb
|
167
196
|
- data/doc/xmpp4r/examples/basic/mass_sender.rb
|
168
|
-
- data/doc/xmpp4r/examples/basic/mucsimplebot.rb
|
169
|
-
- data/doc/xmpp4r/examples/basic/component.rb
|
170
|
-
- data/doc/xmpp4r/examples/basic/mucinfo.rb
|
171
|
-
- data/doc/xmpp4r/examples/basic/jabbersend.rb
|
172
197
|
- data/doc/xmpp4r/examples/basic/rosterprint.rb
|
198
|
+
- data/doc/xmpp4r/examples/basic/jabbersend.rb
|
199
|
+
- data/doc/xmpp4r/examples/basic/change_password.rb
|
200
|
+
- data/doc/xmpp4r/examples/basic/mucsimplebot.rb
|
201
|
+
- data/doc/xmpp4r/examples/basic/rosterrename.rb
|
173
202
|
- data/doc/xmpp4r/examples/basic/versionbot.rb
|
174
|
-
- data/doc/xmpp4r/examples/basic/
|
175
|
-
- data/doc/xmpp4r/examples/basic/
|
203
|
+
- data/doc/xmpp4r/examples/basic/mucinfo.rb
|
204
|
+
- data/doc/xmpp4r/examples/basic/roster.rb
|
205
|
+
- data/doc/xmpp4r/examples/basic/rosterwatch.rb
|
176
206
|
- data/doc/xmpp4r/examples/basic/register.rb
|
177
207
|
- data/doc/xmpp4r/examples/basic/client.rb
|
178
|
-
- data/doc/xmpp4r/examples/
|
179
|
-
- data/doc/xmpp4r/examples/
|
208
|
+
- data/doc/xmpp4r/examples/buggy
|
209
|
+
- data/doc/xmpp4r/examples/buggy/miniedgarr_cgi.rb
|
210
|
+
- data/doc/xmpp4r/examples/buggy/jabber2jabber
|
211
|
+
- data/doc/xmpp4r/examples/buggy/jabber2jabber/jabber2jabber.rb
|
212
|
+
- data/doc/xmpp4r/examples/buggy/miniedgarr_watch.rb
|
180
213
|
- test/
|
181
|
-
- test/
|
182
|
-
- test/
|
183
|
-
- test/tc_callbacks.rb
|
184
|
-
- test/tc_client.rb
|
185
|
-
- test/ts_xmpp4r.rb
|
186
|
-
- test/tc_iq.rb
|
187
|
-
- test/tc_jid.rb
|
214
|
+
- test/tc_rexml.rb
|
215
|
+
- test/tc_stream.rb
|
188
216
|
- test/tc_streamSend.rb
|
217
|
+
- test/vcard
|
218
|
+
- test/vcard/tc_iqvcard.rb
|
219
|
+
- test/vcard/tc_helper.rb
|
220
|
+
- test/delay
|
221
|
+
- test/delay/tc_xdelay.rb
|
189
222
|
- test/tc_streamError.rb
|
190
|
-
- test/
|
191
|
-
- test/
|
223
|
+
- test/tc_xmppstanza.rb
|
224
|
+
- test/pubsub
|
225
|
+
- test/pubsub/tc_helper.rb
|
192
226
|
- test/tc_iqquery.rb
|
193
|
-
- test/tc_streamThreaded.rb
|
194
|
-
- test/tc_stream.rb
|
195
227
|
- test/tc_error.rb
|
196
|
-
- test/
|
197
|
-
- test/
|
198
|
-
- test/roster
|
199
|
-
- test/roster/tc_xroster.rb
|
200
|
-
- test/roster/tc_helper.rb
|
201
|
-
- test/roster/tc_iqqueryroster.rb
|
228
|
+
- test/tc_idgenerator.rb
|
229
|
+
- test/tc_callbacks.rb
|
202
230
|
- test/lib
|
203
231
|
- test/lib/clienttester.rb
|
232
|
+
- test/dataforms
|
233
|
+
- test/dataforms/tc_data.rb
|
234
|
+
- test/muc
|
235
|
+
- test/muc/tc_mucowner.rb
|
236
|
+
- test/muc/tc_muc_mucclient.rb
|
237
|
+
- test/muc/tc_muc_simplemucclient.rb
|
238
|
+
- test/roster
|
239
|
+
- test/roster/tc_iqqueryroster.rb
|
240
|
+
- test/roster/tc_helper.rb
|
241
|
+
- test/roster/tc_xroster.rb
|
242
|
+
- test/version
|
243
|
+
- test/version/tc_helper.rb
|
244
|
+
- test/version/tc_iqqueryversion.rb
|
245
|
+
- test/tc_jid.rb
|
246
|
+
- test/tc_presence.rb
|
247
|
+
- test/rpc
|
248
|
+
- test/rpc/tc_helper.rb
|
249
|
+
- test/tc_iq.rb
|
204
250
|
- test/bytestreams
|
205
251
|
- test/bytestreams/tc_ibb.rb
|
206
252
|
- test/bytestreams/tc_socks5bytestreams.rb
|
207
|
-
- test/
|
208
|
-
- test/
|
209
|
-
- test/
|
210
|
-
- test/
|
211
|
-
- test/
|
212
|
-
- test/version
|
213
|
-
- test/version/tc_iqqueryversion.rb
|
214
|
-
- test/version/tc_helper.rb
|
215
|
-
- test/muc
|
216
|
-
- test/muc/tc_muc_simplemucclient.rb
|
217
|
-
- test/muc/tc_muc_mucclient.rb
|
253
|
+
- test/tc_class_names.rb
|
254
|
+
- test/tc_message.rb
|
255
|
+
- test/ts_xmpp4r.rb
|
256
|
+
- test/tc_streamComponent.rb
|
257
|
+
- test/tc_client.rb
|
218
258
|
- tools/
|
219
259
|
- tools/gen_requires.bash
|
220
260
|
- tools/doctoweb.bash
|
@@ -1,32 +0,0 @@
|
|
1
|
-
#!/usr/bin/ruby
|
2
|
-
|
3
|
-
# This bot will reply to every message it receives. To end the game, send 'exit'
|
4
|
-
# NON-THREADED VERSION
|
5
|
-
|
6
|
-
require 'xmpp4r'
|
7
|
-
include Jabber
|
8
|
-
|
9
|
-
# settings
|
10
|
-
if ARGV.length != 2
|
11
|
-
puts "Run with ./echo_thread.rb user@server/resource password"
|
12
|
-
exit 1
|
13
|
-
end
|
14
|
-
myJID = JID::new(ARGV[0])
|
15
|
-
myPassword = ARGV[1]
|
16
|
-
cl = Client::new(myJID, false)
|
17
|
-
cl.connect
|
18
|
-
cl.auth(myPassword)
|
19
|
-
cl.send(Presence::new)
|
20
|
-
puts "Connected ! send messages to #{myJID.strip.to_s}."
|
21
|
-
exit = false
|
22
|
-
cl.add_message_callback { |m|
|
23
|
-
cl.send(Message::new(m.from, "You sent: #{m.body}"))
|
24
|
-
if m.body == 'exit'
|
25
|
-
cl.send(Message::new(m.from, "Exiting ..."))
|
26
|
-
exit = true
|
27
|
-
end
|
28
|
-
}
|
29
|
-
while not exit
|
30
|
-
cl.process
|
31
|
-
end
|
32
|
-
cl.close
|
data/lib/callbacks.rb
DELETED
@@ -1,122 +0,0 @@
|
|
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
|
-
##
|
6
|
-
# This class manages a list of callbacks.
|
7
|
-
#
|
8
|
-
# ==Callbacks management and priority
|
9
|
-
#
|
10
|
-
# Callbacks are managed by the class CallbackList. When they are added, a
|
11
|
-
# priority (just a number or anything Comparable with other priorities) is
|
12
|
-
# specified. The biggest the priority is, the earliest the callback will be
|
13
|
-
# considered.
|
14
|
-
#
|
15
|
-
# Callbacks are processed for a given set of objects as long as they return
|
16
|
-
# false. If you want to stop processing, you must return true. Example :
|
17
|
-
# cbl = CallbackList::new
|
18
|
-
# c1 = false
|
19
|
-
# c2 = false
|
20
|
-
# c3 = false
|
21
|
-
# cbl.add(10) { c1 = true; 1 }
|
22
|
-
# cbl.add(5) { c2 = true; true }
|
23
|
-
# cbl.add(0) { c3 = true }
|
24
|
-
# cbl.process('aa')
|
25
|
-
# puts "#{c1} #{c2} #{c3}"
|
26
|
-
# This example would display "true true false" as callbacks processing was
|
27
|
-
# stopped after the second callback returned true.
|
28
|
-
#
|
29
|
-
# In XMPP4R, callbacks' priorities are quite normalized since we want to be
|
30
|
-
# able to "cascade" callbacks in a clean way. Here are values your code should
|
31
|
-
# take into account :
|
32
|
-
#
|
33
|
-
# >= 200:: logging & debugging callbacks. Those callbacks should not consume
|
34
|
-
# elements.
|
35
|
-
# 100-199:: Where Helpers register their callbacks. The normal value is 100,
|
36
|
-
# and Helpers shouldn't register something else unless there's a
|
37
|
-
# very good reason to.
|
38
|
-
# < 100:: all those numbers are normally available for your application.
|
39
|
-
# That's enough, don't you think ?
|
40
|
-
class CallbackList
|
41
|
-
|
42
|
-
# Create a new list of callbacks
|
43
|
-
def initialize
|
44
|
-
@list = []
|
45
|
-
end
|
46
|
-
|
47
|
-
##
|
48
|
-
# Add a callback to the list
|
49
|
-
#
|
50
|
-
# List will be sorted afterwards
|
51
|
-
#
|
52
|
-
# prio:: [Integer] the callback's priority, the higher, the sooner.
|
53
|
-
# ref:: [String] the callback's reference
|
54
|
-
# block:: [Block] a block to execute
|
55
|
-
# return:: [Jabber::CallbackList] The list, for chaining
|
56
|
-
def add(prio = 0, ref = nil, proc = nil, &block)
|
57
|
-
block = proc if proc
|
58
|
-
@list.push(Callback::new(prio, ref, block))
|
59
|
-
@list.sort! { |a, b| b.priority <=> a.priority }
|
60
|
-
self
|
61
|
-
end
|
62
|
-
|
63
|
-
##
|
64
|
-
# Delete a callback by reference
|
65
|
-
# ref:: [String] the reference of the callback to delete
|
66
|
-
# return:: [CallBackList] The list, for chaining
|
67
|
-
def delete(ref)
|
68
|
-
@list.delete_if { |item| item.ref == ref }
|
69
|
-
self
|
70
|
-
end
|
71
|
-
|
72
|
-
##
|
73
|
-
# Number of elements in the list
|
74
|
-
# return:: [Integer] The number of elements
|
75
|
-
def length
|
76
|
-
@list.length
|
77
|
-
end
|
78
|
-
|
79
|
-
##
|
80
|
-
# Process an element through all my callbacks. returns e.consumed?
|
81
|
-
# e:: [Object] The elements to pass to the callback. You can pass
|
82
|
-
# several, but of course, you block must know how to handle them.
|
83
|
-
# return:: [Boolean] true if the element has been consumed
|
84
|
-
def process(*e)
|
85
|
-
# If somebody adds a new callback the list will get modified
|
86
|
-
# and sorted(!) while still iterating through it. So we use a
|
87
|
-
# local copy of @list. Any freshly added callback will receive
|
88
|
-
# the next stanzas, not the current.
|
89
|
-
list = @list.dup
|
90
|
-
|
91
|
-
# process through callbacks
|
92
|
-
list.each do |item|
|
93
|
-
return true if item.block.call(*e) == true
|
94
|
-
end
|
95
|
-
false
|
96
|
-
end
|
97
|
-
end
|
98
|
-
|
99
|
-
# This class is used to store callbacks inside CallbackList. See the
|
100
|
-
# CallbackList class for more detailed explanations.
|
101
|
-
class Callback
|
102
|
-
|
103
|
-
# The Callback's priority
|
104
|
-
attr_reader :priority
|
105
|
-
|
106
|
-
# The Callback's reference, using for deleting purposes
|
107
|
-
attr_reader :ref
|
108
|
-
|
109
|
-
# The Callback's block to execute
|
110
|
-
attr_reader :block
|
111
|
-
|
112
|
-
##
|
113
|
-
# Create a new callback
|
114
|
-
# priority:: [Integer] the callback's priority. The higher, the sooner it
|
115
|
-
# will be executed
|
116
|
-
# ref:: [String] The callback's reference
|
117
|
-
def initialize(priority = 0, ref = nil, block = Proc::new {})
|
118
|
-
@priority = priority
|
119
|
-
@ref = ref
|
120
|
-
@block = block
|
121
|
-
end
|
122
|
-
end
|