Removing external hub completely, fix #333 fixing digit-only hashtags,

removing web app capability from non-webapp pages
This commit is contained in:
Eugen Rochko 2016-12-18 12:17:45 +01:00
parent c4ffffbeed
commit 6de079a5af
14 changed files with 2 additions and 32 deletions

View file

@ -3,7 +3,7 @@
class Tag < ApplicationRecord
has_and_belongs_to_many :statuses
HASHTAG_RE = /(?:^|[^\/\w])#([[:word:]_]+)/i
HASHTAG_RE = /(?:^|[^\/\w])#([[:word:]_]*[[:alpha:]_][[:word:]_]*)/i
validates :name, presence: true, uniqueness: true

View file

@ -8,7 +8,6 @@ class FavouriteService < BaseService
def call(account, status)
favourite = Favourite.create!(account: account, status: status)
HubPingWorker.perform_async(account.id)
Pubsubhubbub::DistributionWorker.perform_async(favourite.stream_entry.id)
if status.local?

View file

@ -20,7 +20,6 @@ class FollowService < BaseService
merge_into_timeline(target_account, source_account)
HubPingWorker.perform_async(source_account.id)
Pubsubhubbub::DistributionWorker.perform_async(follow.stream_entry.id)
follow

View file

@ -16,7 +16,6 @@ class PostStatusService < BaseService
process_hashtags_service.call(status)
DistributionWorker.perform_async(status.id)
HubPingWorker.perform_async(account.id)
Pubsubhubbub::DistributionWorker.perform_async(status.stream_entry.id)
status

View file

@ -9,7 +9,6 @@ class ReblogService < BaseService
reblog = account.statuses.create!(reblog: reblogged_status, text: '')
DistributionWorker.perform_async(reblog.id)
HubPingWorker.perform_async(account.id)
Pubsubhubbub::DistributionWorker.perform_async(reblog.stream_entry.id)
if reblogged_status.local?

View file

@ -13,7 +13,6 @@ class RemoveStatusService < BaseService
return unless status.account.local?
HubPingWorker.perform_async(status.account.id)
Pubsubhubbub::DistributionWorker.perform_async(status.stream_entry.id)
end

View file

@ -15,7 +15,6 @@ Nokogiri::XML::Builder.new do |xml|
link_alternate xml, TagManager.instance.url_for(@account)
link_self xml, account_url(@account, format: 'atom')
link_hub xml, api_push_url
link_hub xml, Rails.configuration.x.hub_url
link_salmon xml, api_salmon_url(@account.id)
@entries.each do |stream_entry|

View file

@ -1,4 +1,5 @@
- content_for :header_tags do
%meta{:name => "apple-mobile-web-app-capable", :content => "yes"}/
= javascript_include_tag 'application'
= react_component 'Mastodon', default_props, class: 'app-holder', prerender: false

View file

@ -9,7 +9,6 @@
%link{:rel => "manifest", :href => "/manifest.json"}/
%meta{:name => "msapplication-config", :content => "/browserconfig.xml"}/
%meta{:name => "theme-color", :content => "#2b90d9"}/
%meta{:name => "apple-mobile-web-app-capable", :content => "yes"}/
%title
= "#{yield(:page_title)} - " if content_for?(:page_title)

View file

@ -1,12 +0,0 @@
# frozen_string_literal: true
class HubPingWorker
include Sidekiq::Worker
include RoutingHelper
def perform(account_id)
account = Account.find(account_id)
return unless account.local?
OStatus2::Publication.new(account_url(account, format: 'atom'), [Rails.configuration.x.hub_url]).publish
end
end