Skip to content

Commit

Permalink
Remove unused 'threaded' param from Client, Component, Connection, St…
Browse files Browse the repository at this point in the history
…ream API.

Signed-off-by: Glenn Rempe <glenn@rempe.us>
  • Loading branch information
grempe committed Jun 7, 2008
1 parent 2967910 commit ae2ba3a
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 20 deletions.
2 changes: 2 additions & 0 deletions ChangeLog
Expand Up @@ -13,6 +13,8 @@ XMPP4R 0.3.3 (XX/XX/XXXX)
* Support auto-gem generation on GitHub with improved and DRY'er RakeFile and
gemspec.
* Add support for the old SSL protocol (needed to connect to GTalk)
* Changed API for Client, Component, Connection, Stream to remove
need for antiquated 'threaded' param in the initializer.

XMPP4R 0.3.2 (15/10/2007)
=========================
Expand Down
2 changes: 1 addition & 1 deletion data/doc/xmpp4r/examples/basic/rosterrename.rb
Expand Up @@ -18,7 +18,7 @@

jid = Jabber::JID.new(ARGV[0])

cl = Jabber::Client.new(jid, false)
cl = Jabber::Client.new(jid)
cl.connect
cl.auth(ARGV[1])

Expand Down
2 changes: 1 addition & 1 deletion data/doc/xmpp4r/examples/basic/versionbot.rb
Expand Up @@ -23,7 +23,7 @@

jid = Jabber::JID.new(ARGV[0])

cl = Jabber::Client.new(jid, false)
cl = Jabber::Client.new(jid)
cl.connect
cl.auth(ARGV[1])

Expand Down
2 changes: 1 addition & 1 deletion data/doc/xmpp4r/examples/buggy/miniedgarr_watch.rb
Expand Up @@ -33,7 +33,7 @@ def write_state(statefile, roster, presences)

jid = Jabber::JID.new(ARGV[0])

cl = Jabber::Client.new(jid, false)
cl = Jabber::Client.new(jid)
cl.connect
cl.auth(ARGV[1])

Expand Down
4 changes: 2 additions & 2 deletions lib/xmpp4r/client.rb
Expand Up @@ -26,8 +26,8 @@ class Client < Connection
# Create a new Client.
#
# Remember to *always* put a resource in your JID unless the server can do SASL.
def initialize(jid, threaded = true)
super(threaded)
def initialize(jid)
super()
@jid = (jid.kind_of?(JID) ? jid : JID.new(jid.to_s))
end

Expand Down
4 changes: 2 additions & 2 deletions lib/xmpp4r/component.rb
Expand Up @@ -23,8 +23,8 @@ class Component < Connection

# Create a new Component
# jid:: [JID]
def initialize(jid, server_address=nil, server_port=5347, threaded = true)
super(threaded)
def initialize(jid, server_address=nil, server_port=5347)
super()
@jid = (jid.kind_of?(JID) ? jid : JID.new(jid.to_s))

if server_address
Expand Down
7 changes: 3 additions & 4 deletions lib/xmpp4r/connection.rb
Expand Up @@ -38,10 +38,9 @@ class Connection < Stream
attr_accessor :use_ssl

##
# Create a new connection to the given host and port, using threaded mode
# or not.
def initialize(threaded = true)
super(threaded)
# Create a new connection to the given host and port
def initialize
super()
@host = nil
@port = nil
@allow_tls = defined? OpenSSL
Expand Down
8 changes: 2 additions & 6 deletions lib/xmpp4r/stream.rb
Expand Up @@ -37,12 +37,8 @@ class Stream
attr_reader :status

##
# Create a new stream
# (just initializes)
def initialize(threaded = true)
unless threaded
raise "Non-threaded mode was removed from XMPP4R."
end
# Initialize a new stream
def initialize
@fd = nil
@status = DISCONNECTED
@xmlcbs = CallbackList::new
Expand Down
4 changes: 2 additions & 2 deletions test/lib/clienttester.rb
Expand Up @@ -38,7 +38,7 @@ def setup
serversock = servlisten.accept
servlisten.close
serversock.sync = true
@server = Stream.new(true)
@server = Stream.new
@server.add_xml_callback do |xml|
if xml.prefix == 'stream' and xml.name == 'stream'
send(stream)
Expand All @@ -54,7 +54,7 @@ def setup

clientsock = TCPSocket.new('localhost', @@SOCKET_PORT)
clientsock.sync = true
@client = Stream.new(true)
@client = Stream.new
#=begin
class << @client
def jid
Expand Down
2 changes: 1 addition & 1 deletion test/tc_streamComponent.rb
Expand Up @@ -23,7 +23,7 @@ def setup
serversock = servlisten.accept
servlisten.close
serversock.sync = true
@server = Stream.new(true)
@server = Stream.new
@server.add_xml_callback do |xml|
if xml.prefix == 'stream' and xml.name == 'stream'
@server.send("<#{STREAM} xmlns='jabber:component:accept'>")
Expand Down

0 comments on commit ae2ba3a

Please sign in to comment.