about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-12-18 12:17:45 +0100
committerEugen Rochko <eugen@zeonfederated.com>2016-12-18 12:24:37 +0100
commit6de079a5af328d26d7cbc8daf3367d16c311fddb (patch)
tree61ef4718e0fe10b8da0c6103876fae739f4e9ee8 /app
parentc4ffffbeedda400a85951ca4fc74ce1d54c96032 (diff)
Removing external hub completely, fix #333 fixing digit-only hashtags,
removing web app capability from non-webapp pages
Diffstat (limited to 'app')
-rw-r--r--app/models/tag.rb2
-rw-r--r--app/services/favourite_service.rb1
-rw-r--r--app/services/follow_service.rb1
-rw-r--r--app/services/post_status_service.rb1
-rw-r--r--app/services/reblog_service.rb1
-rw-r--r--app/services/remove_status_service.rb1
-rw-r--r--app/views/accounts/show.atom.ruby1
-rw-r--r--app/views/home/index.html.haml1
-rw-r--r--app/views/layouts/application.html.haml1
-rw-r--r--app/workers/hub_ping_worker.rb12
10 files changed, 2 insertions, 20 deletions
diff --git a/app/models/tag.rb b/app/models/tag.rb
index e5b0511ae..77a73cce8 100644
--- a/app/models/tag.rb
+++ b/app/models/tag.rb
@@ -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
 
diff --git a/app/services/favourite_service.rb b/app/services/favourite_service.rb
index 2f280e03f..5c04cfee4 100644
--- a/app/services/favourite_service.rb
+++ b/app/services/favourite_service.rb
@@ -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?
diff --git a/app/services/follow_service.rb b/app/services/follow_service.rb
index 423b833cf..ed9b62455 100644
--- a/app/services/follow_service.rb
+++ b/app/services/follow_service.rb
@@ -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
diff --git a/app/services/post_status_service.rb b/app/services/post_status_service.rb
index 9e0ced129..d5204151b 100644
--- a/app/services/post_status_service.rb
+++ b/app/services/post_status_service.rb
@@ -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
diff --git a/app/services/reblog_service.rb b/app/services/reblog_service.rb
index 39fdb4ea7..7d0c90d2f 100644
--- a/app/services/reblog_service.rb
+++ b/app/services/reblog_service.rb
@@ -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?
diff --git a/app/services/remove_status_service.rb b/app/services/remove_status_service.rb
index fa55e668e..836b8fdc5 100644
--- a/app/services/remove_status_service.rb
+++ b/app/services/remove_status_service.rb
@@ -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
 
diff --git a/app/views/accounts/show.atom.ruby b/app/views/accounts/show.atom.ruby
index b2903d189..a22568396 100644
--- a/app/views/accounts/show.atom.ruby
+++ b/app/views/accounts/show.atom.ruby
@@ -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|
diff --git a/app/views/home/index.html.haml b/app/views/home/index.html.haml
index 498fae105..0adce05bf 100644
--- a/app/views/home/index.html.haml
+++ b/app/views/home/index.html.haml
@@ -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
diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml
index 87f98198c..7e28d27ec 100644
--- a/app/views/layouts/application.html.haml
+++ b/app/views/layouts/application.html.haml
@@ -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)
diff --git a/app/workers/hub_ping_worker.rb b/app/workers/hub_ping_worker.rb
deleted file mode 100644
index 14a151ba0..000000000
--- a/app/workers/hub_ping_worker.rb
+++ /dev/null
@@ -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