lib/robut/connection.rb in robut-0.5.0 vs lib/robut/connection.rb in robut-0.5.1
- old
+ new
@@ -65,10 +65,11 @@
self.config = _config || self.class.config
self.client = Jabber::Client.new(self.config.jid)
self.store = self.config.store || Robut::Storage::HashStore # default to in-memory store only
self.config.rooms ||= Array(self.config.room) # legacy support?
+ self.config.enable_private_messaging = true if self.config.enable_private_messaging.nil?
if self.config.logger
Jabber.logger = self.config.logger
Jabber.debug = true
end
@@ -87,10 +88,12 @@
self.rooms = self.config.rooms.collect do |room_name|
Robut::Room.new(self, room_name).tap {|r| r.join }
end
- personal_message = Robut::PM.new(self, rooms)
+ if self.config.enable_private_messaging
+ Robut::PM.new(self, rooms)
+ end
trap_signals
self
end