about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--Gemfile1
-rw-r--r--Gemfile.lock5
-rw-r--r--app/lib/tag_manager.rb11
-rw-r--r--config/locales/activerecord.cy.yml3
-rw-r--r--db/structure.sql76
5 files changed, 20 insertions, 76 deletions
diff --git a/Gemfile b/Gemfile
index d37646a79..1e01e5c19 100644
--- a/Gemfile
+++ b/Gemfile
@@ -67,6 +67,7 @@ gem 'posix-spawn', git: 'https://github.com/rtomayko/posix-spawn', ref: '58465d2
 gem 'pundit', '~> 2.0'
 gem 'premailer-rails'
 gem 'rack', git: 'https://github.com/rack/rack.git', :ref => 'f690bb71425aa31d7b9b3113829af773950d8ab5'
+gem 'rack-attack', '~> 6.1'
 gem 'rack-cors', '~> 1.0', require: 'rack/cors'
 gem 'rails-i18n', '~> 5.1'
 gem 'rails-settings-cached', '~> 0.6'
diff --git a/Gemfile.lock b/Gemfile.lock
index b3588ffaf..15f79b6ad 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -436,12 +436,13 @@ GEM
     pry-rails (0.3.9)
       pry (>= 0.10.4)
     public_suffix (4.0.3)
+    puma (4.0.1)
+      nio4r (~> 2.0)
     pundit (2.1.0)
       activesupport (>= 3.0.0)
     raabro (1.1.6)
     rack-attack (6.2.2)
-    puma (4.0.1)
-      nio4r (~> 2.0)
+      rack (>= 1.0, < 3)
     rack-cors (1.1.1)
       rack (>= 2.0.0)
     rack-protection (2.0.8.1)
diff --git a/app/lib/tag_manager.rb b/app/lib/tag_manager.rb
index c88cf4994..fbe03e10f 100644
--- a/app/lib/tag_manager.rb
+++ b/app/lib/tag_manager.rb
@@ -36,4 +36,15 @@ class TagManager
 
     TagManager.instance.web_domain?(domain)
   end
+
+  def url_for(target)
+    return target.url if target.respond_to?(:local?) && !target.local?
+
+    case target.object_type
+    when :person
+      short_account_url(target)
+    when :note, :comment, :activity
+      short_account_status_url(target.account, target)
+    end
+  end
 end
diff --git a/config/locales/activerecord.cy.yml b/config/locales/activerecord.cy.yml
index 248e93ad5..92fba043f 100644
--- a/config/locales/activerecord.cy.yml
+++ b/config/locales/activerecord.cy.yml
@@ -1,13 +1,10 @@
 ---
 cy:
   activerecord:
-<<<<<<< HEAD
-=======
     attributes:
       poll:
         expires_at: Terfyn amser
         options: Dewisiadau
->>>>>>> f1597e1ab... Merge pull request #1158 from ThibG/glitch-soc/merge-upstream
     errors:
       models:
         account:
diff --git a/db/structure.sql b/db/structure.sql
index e3ba0572e..494690003 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -551,6 +551,8 @@ CREATE TABLE public.accounts (
     force_private boolean DEFAULT false NOT NULL,
     unboostable boolean DEFAULT false NOT NULL,
     block_anon boolean DEFAULT false NOT NULL
+    block_anon boolean DEFAULT false NOT NULL,
+    trust_level integer
 );
 
 
@@ -2249,40 +2251,6 @@ CREATE TABLE public.statuses_tags (
 
 
 --
--- Name: stream_entries; Type: TABLE; Schema: public; Owner: -
---
-
-CREATE TABLE public.stream_entries (
-    id bigint NOT NULL,
-    activity_id bigint,
-    activity_type character varying,
-    created_at timestamp without time zone NOT NULL,
-    updated_at timestamp without time zone NOT NULL,
-    hidden boolean DEFAULT false NOT NULL,
-    account_id bigint
-);
-
-
---
--- Name: stream_entries_id_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE public.stream_entries_id_seq
-    START WITH 1
-    INCREMENT BY 1
-    NO MINVALUE
-    NO MAXVALUE
-    CACHE 1;
-
-
---
--- Name: stream_entries_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
---
-
-ALTER SEQUENCE public.stream_entries_id_seq OWNED BY public.stream_entries.id;
-
-
---
 -- Name: tags; Type: TABLE; Schema: public; Owner: -
 --
 
@@ -2914,13 +2882,6 @@ ALTER TABLE ONLY public.status_stats ALTER COLUMN id SET DEFAULT nextval('public
 
 
 --
--- Name: stream_entries id; Type: DEFAULT; Schema: public; Owner: -
---
-
-ALTER TABLE ONLY public.stream_entries ALTER COLUMN id SET DEFAULT nextval('public.stream_entries_id_seq'::regclass);
-
-
---
 -- Name: tags id; Type: DEFAULT; Schema: public; Owner: -
 --
 
@@ -3435,14 +3396,6 @@ ALTER TABLE ONLY public.statuses
 
 
 --
--- Name: stream_entries stream_entries_pkey; Type: CONSTRAINT; Schema: public; Owner: -
---
-
-ALTER TABLE ONLY public.stream_entries
-    ADD CONSTRAINT stream_entries_pkey PRIMARY KEY (id);
-
-
---
 -- Name: tags tags_pkey; Type: CONSTRAINT; Schema: public; Owner: -
 --
 
@@ -4282,20 +4235,6 @@ CREATE UNIQUE INDEX index_statuses_tags_on_tag_id_and_status_id ON public.status
 
 
 --
--- Name: index_stream_entries_on_account_id_and_activity_type_and_id; Type: INDEX; Schema: public; Owner: -
---
-
-CREATE INDEX index_stream_entries_on_account_id_and_activity_type_and_id ON public.stream_entries USING btree (account_id, activity_type, id);
-
-
---
--- Name: index_stream_entries_on_activity_id_and_activity_type; Type: INDEX; Schema: public; Owner: -
---
-
-CREATE INDEX index_stream_entries_on_activity_id_and_activity_type ON public.stream_entries USING btree (activity_id, activity_type);
-
-
---
 -- Name: index_tags_on_name; Type: INDEX; Schema: public; Owner: -
 --
 
@@ -4480,14 +4419,6 @@ ALTER TABLE ONLY public.users
 
 
 --
--- Name: stream_entries fk_5659b17554; Type: FK CONSTRAINT; Schema: public; Owner: -
---
-
-ALTER TABLE ONLY public.stream_entries
-    ADD CONSTRAINT fk_5659b17554 FOREIGN KEY (account_id) REFERENCES public.accounts(id) ON DELETE CASCADE;
-
-
---
 -- Name: favourites fk_5eb6c2b873; Type: FK CONSTRAINT; Schema: public; Owner: -
 --
 
@@ -5413,8 +5344,11 @@ INSERT INTO "schema_migrations" (version) VALUES
 ('20190531082330'),
 ('20190531082452'),
 ('20190531084425'),
+('20190701022101'),
+('20190706233204'),
 ('20190714172440'),
 ('20190714172721'),
+('20190715164535'),
 ('20190719121326'),
 ('20190719212820'),
 ('20190722014444'),