lib/biobot/periodicals/notify.rb in viking-biobot-0.0.2 vs lib/biobot/periodicals/notify.rb in viking-biobot-0.0.3
- old
+ new
@@ -10,10 +10,15 @@
end
def handle_notifications
if Notification.count > 0
Notification.all.each do |notification|
- message = Jabber::Message.new(notification.to, notification.body)
+ to = notification.to
+ body = notification.body
+ message = Jabber::Message.new(
+ to =~ /@/ ? to : "#{to}@#{@server}",
+ body
+ )
@client.send(message)
end
Notification.delete_all
end
end