rumpy 0.9.9 → 0.9.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/rumpy.rb +17 -0
- metadata +4 -4
data/lib/rumpy.rb
CHANGED
|
@@ -176,6 +176,23 @@ module Rumpy
|
|
|
176
176
|
@err_file.puts e.backtrace
|
|
177
177
|
end
|
|
178
178
|
end
|
|
179
|
+
@client.add_iq_callback do |iq|
|
|
180
|
+
if iq.type == :get then
|
|
181
|
+
response = Jabber::Iq.new :error, iq.from
|
|
182
|
+
response.id = iq.id
|
|
183
|
+
if iq.elements["time"] == "<time xmlns='urn:xmpp:time'/>" then
|
|
184
|
+
response.set_type :result
|
|
185
|
+
response.root.add REXML::Element.new('time')
|
|
186
|
+
response.elements['time'].attributes['xmlns'] = 'urn:xmpp:time'
|
|
187
|
+
tm = Time.now
|
|
188
|
+
response.elements['time'].add REXML::Element.new('tzo')
|
|
189
|
+
response.elements['time/tzo'].text = tm.xmlschema[-6..-1]
|
|
190
|
+
response.elements['time'].add REXML::Element.new('utc')
|
|
191
|
+
response.elements['time/utc'].text = tm.utc.xmlschema
|
|
192
|
+
end
|
|
193
|
+
@client.send response
|
|
194
|
+
end
|
|
195
|
+
end
|
|
179
196
|
end
|
|
180
197
|
|
|
181
198
|
def send_msg(destination, text)
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rumpy
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
hash:
|
|
4
|
+
hash: 47
|
|
5
5
|
prerelease: false
|
|
6
6
|
segments:
|
|
7
7
|
- 0
|
|
8
8
|
- 9
|
|
9
|
-
-
|
|
10
|
-
version: 0.9.
|
|
9
|
+
- 10
|
|
10
|
+
version: 0.9.10
|
|
11
11
|
platform: ruby
|
|
12
12
|
authors:
|
|
13
13
|
- Tsokurov A.G.
|
|
@@ -16,7 +16,7 @@ autorequire:
|
|
|
16
16
|
bindir: bin
|
|
17
17
|
cert_chain: []
|
|
18
18
|
|
|
19
|
-
date: 2011-
|
|
19
|
+
date: 2011-07-19 00:00:00 +03:00
|
|
20
20
|
default_executable:
|
|
21
21
|
dependencies:
|
|
22
22
|
- !ruby/object:Gem::Dependency
|