about summary refs log tree commit diff
path: root/app/lib
diff options
context:
space:
mode:
authorJenkins <jenkins@jenkins.ninjawedding.org>2018-01-03 04:17:11 +0000
committerJenkins <jenkins@jenkins.ninjawedding.org>2018-01-03 04:17:11 +0000
commit933840bebf4ce8f5282c88e8c3e8c1b3675fbf2d (patch)
treee1d156a830d9446218ad1f250111dfc32df76961 /app/lib
parentfa768abf5c10eb3469a26347a9fa5ff677b3d394 (diff)
parent99f962ba731f67050a914bb5b9a245869531ebd1 (diff)
Merge remote-tracking branch 'tootsuite/master' into glitchsoc/master
Diffstat (limited to 'app/lib')
-rw-r--r--app/lib/activity_tracker.rb2
-rw-r--r--app/lib/activitypub/activity/delete.rb1
-rw-r--r--app/lib/sanitize_config.rb8
3 files changed, 6 insertions, 5 deletions
diff --git a/app/lib/activity_tracker.rb b/app/lib/activity_tracker.rb
index 50e927b0c..5b4972674 100644
--- a/app/lib/activity_tracker.rb
+++ b/app/lib/activity_tracker.rb
@@ -15,7 +15,7 @@ class ActivityTracker
       key = [prefix, current_week].join(':')
 
       redis.pfadd(key, value)
-      redis.expire(key, value)
+      redis.expire(key, EXPIRE_AFTER)
     end
 
     private
diff --git a/app/lib/activitypub/activity/delete.rb b/app/lib/activitypub/activity/delete.rb
index d0fb49342..5fa60a81c 100644
--- a/app/lib/activitypub/activity/delete.rb
+++ b/app/lib/activitypub/activity/delete.rb
@@ -13,6 +13,7 @@ class ActivityPub::Activity::Delete < ActivityPub::Activity
 
   def delete_person
     SuspendAccountService.new.call(@account)
+    @account.destroy!
   end
 
   def delete_note
diff --git a/app/lib/sanitize_config.rb b/app/lib/sanitize_config.rb
index f09288fcd..c2b466924 100644
--- a/app/lib/sanitize_config.rb
+++ b/app/lib/sanitize_config.rb
@@ -6,14 +6,14 @@ class Sanitize
 
     CLASS_WHITELIST_TRANSFORMER = lambda do |env|
       node = env[:node]
-      class_list = node['class']&.split(' ')
+      class_list = node['class']&.split(/[\t\n\f\r ]/)
 
       return unless class_list
 
       class_list.keep_if do |e|
-        return true if e =~ /^(h|p|u|dt|e)-/ # microformats classes
-        return true if e =~ /^(mention|hashtag)$/ # semantic classes
-        return true if e =~ /^(ellipsis|invisible)$/ # link formatting classes
+        next true if e =~ /^(h|p|u|dt|e)-/ # microformats classes
+        next true if e =~ /^(mention|hashtag)$/ # semantic classes
+        next true if e =~ /^(ellipsis|invisible)$/ # link formatting classes
       end
 
       node['class'] = class_list.join(' ')