Send Salmon interactions

This commit is contained in:
Eugen Rochko
2016-02-24 12:57:29 +01:00
parent 10eb47a33e
commit fa7868675d
15 changed files with 118 additions and 25 deletions

View File

@ -1,6 +1,10 @@
class FollowRemoteAccountService
include ApplicationHelper
class FollowRemoteAccountService < BaseService
# Find or create a local account for a remote user.
# When creating, look up the user's webfinger and fetch all
# important information from their feed
# @param [String] uri User URI in the form of username@domain
# @param [Boolean] subscribe Whether to initiate a PubSubHubbub subscription
# @return [Account]
def call(uri, subscribe = true)
username, domain = uri.split('@')
account = Account.where(username: username, domain: domain).first