From 79609d62705fa7060c1d1ab78234b4aabdbd7e0f Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Wed, 24 Feb 2016 18:25:04 +0100 Subject: Add service for posting statuses (normal and replies), mention regex to fetch webfinger information of mentioned accounts --- app/models/account.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'app/models/account.rb') diff --git a/app/models/account.rb b/app/models/account.rb index 66345b5ab..2cbec488b 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -14,6 +14,8 @@ class Account < ActiveRecord::Base has_many :following, through: :active_relationships, source: :target_account has_many :followers, through: :passive_relationships, source: :account + MENTION_RE = /(?:^|\W)@([a-z0-9_]+(?:@[a-z0-9\.\-]+)?)/i + def follow!(other_account) self.active_relationships.first_or_create!(target_account: other_account) end -- cgit