xmpp4r-simple 0.8.4 → 0.8.6
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/CHANGELOG +17 -1
- data/Rakefile +1 -1
- data/lib/xmpp4r-simple.rb +17 -4
- metadata +2 -2
data/CHANGELOG
CHANGED
@@ -1,4 +1,20 @@
|
|
1
|
-
xmpp4r-simple (0.8.
|
1
|
+
xmpp4r-simple (0.8.6)
|
2
|
+
|
3
|
+
[ Blaine Cook ]
|
4
|
+
* Catch a rare exception that's thrown when we are disconnecting.
|
5
|
+
|
6
|
+
-- Blaine Cook <blaine@obvious.com> Fri, 26 Jan 2007 11:45:23 -0800
|
7
|
+
|
8
|
+
|
9
|
+
xmpp4r-simple (0.8.5)
|
10
|
+
|
11
|
+
[ Blaine Cook ]
|
12
|
+
* Accept Jabber::Message messages as arguments to Jabber::Simple#deliver
|
13
|
+
|
14
|
+
-- Blaine Cook <blaine@obvious.com> Mon, 22 Jan 2007 07:23:09 -0800
|
15
|
+
|
16
|
+
|
17
|
+
xmpp4r-simple (0.8.4)
|
2
18
|
|
3
19
|
[ Blaine Cook ]
|
4
20
|
* Catch broken connections and attempt to reconnect 3 times.
|
data/Rakefile
CHANGED
@@ -25,7 +25,7 @@ require 'rcov/rcovtask'
|
|
25
25
|
spec = Gem::Specification.new do |s|
|
26
26
|
s.add_dependency('xmpp4r', '>= 0.3.0')
|
27
27
|
s.name = "xmpp4r-simple"
|
28
|
-
s.version = "0.8.
|
28
|
+
s.version = "0.8.6"
|
29
29
|
s.author = "Blaine Cook"
|
30
30
|
s.email = "romeda@gmail.com"
|
31
31
|
s.homepage = "http://xmpp4r-simple.rubyforge.org/"
|
data/lib/xmpp4r-simple.rb
CHANGED
@@ -103,15 +103,23 @@ module Jabber
|
|
103
103
|
# If the recipient is not in your contacts list, the message will be queued
|
104
104
|
# for later delivery, and the Contact will be automatically asked for
|
105
105
|
# authorization (see Jabber::Simple#add).
|
106
|
+
#
|
107
|
+
# message should be a string or a valid Jabber::Message object. In either case,
|
108
|
+
# the message recipient will be set to jid.
|
106
109
|
def deliver(jid, message, type=:chat)
|
107
110
|
contacts(jid) do |friend|
|
108
111
|
unless subscribed_to? friend
|
109
112
|
add(friend.jid)
|
110
113
|
return deliver_deferred(friend.jid, message, type)
|
111
114
|
end
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
+
if message.kind_of?(Jabber::Message)
|
116
|
+
msg = message
|
117
|
+
msg.to = friend.jid
|
118
|
+
else
|
119
|
+
msg = Message.new(friend.jid)
|
120
|
+
msg.type = type
|
121
|
+
msg.body = message
|
122
|
+
end
|
115
123
|
send!(msg)
|
116
124
|
end
|
117
125
|
end
|
@@ -380,7 +388,12 @@ module Jabber
|
|
380
388
|
|
381
389
|
def disconnect!(auto_reconnect = true)
|
382
390
|
if client.respond_to?(:is_connected?) && client.is_connected?
|
383
|
-
|
391
|
+
begin
|
392
|
+
client.close
|
393
|
+
rescue Errno::EPIPE, IOError => e
|
394
|
+
# probably should log this.
|
395
|
+
nil
|
396
|
+
end
|
384
397
|
end
|
385
398
|
client = nil
|
386
399
|
@disconnected = auto_reconnect
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
|
|
3
3
|
specification_version: 1
|
4
4
|
name: xmpp4r-simple
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.8.
|
7
|
-
date:
|
6
|
+
version: 0.8.6
|
7
|
+
date: 2007-01-26 00:00:00 -08:00
|
8
8
|
summary: A simplified Jabber client library.
|
9
9
|
require_paths:
|
10
10
|
- lib
|