diaspora/app/models/jobs/socket_webfinger.rb
Maxwell Salzberg 63cdd93afc the websocket has been completely removed, and replaced for a stub until
we find a better way to reimpliment it in a  more sane way
2012-01-03 18:39:54 -08:00

26 lines
677 B
Ruby

# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.
module Jobs
class SocketWebfinger < Base
@queue = :socket_webfinger
def self.perform(user_id, account, opts={})
finger = Webfinger.new(account)
begin
result = finger.fetch
Diaspora::Websocket.to(user_id).socket(opts)
rescue
Diaspora::Websocket.to(user_id).socket(
{:class => 'people',
:status => 'fail',
:query => account,
:response => I18n.t('people.webfinger.fail', :handle => account)})
end
end
end
end