about summary refs log tree commit diff
path: root/app/lib/activitypub
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2020-10-22 22:38:11 +0200
committerGitHub <noreply@github.com>2020-10-22 22:38:11 +0200
commit36e5c9d45be0e94216b5b92ea8749a00bb68e0e3 (patch)
tree3f5e2b47d242c4044f0cd69433501834399879d5 /app/lib/activitypub
parent29870d2be6c0e78132416b5561aba20d6ca3c746 (diff)
parent5c60f7eaedbc2dc6184f8b2a4d99f58fdbd5b26b (diff)
Merge pull request #1441 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/lib/activitypub')
-rw-r--r--app/lib/activitypub/activity.rb2
-rw-r--r--app/lib/activitypub/tag_manager.rb4
2 files changed, 5 insertions, 1 deletions
diff --git a/app/lib/activitypub/activity.rb b/app/lib/activitypub/activity.rb
index 224451f41..2b5d3ffc2 100644
--- a/app/lib/activitypub/activity.rb
+++ b/app/lib/activitypub/activity.rb
@@ -74,7 +74,7 @@ class ActivityPub::Activity
     @object_uri ||= begin
       str = value_or_id(@object)
 
-      if str.start_with?('bear:')
+      if str&.start_with?('bear:')
         Addressable::URI.parse(str).query_values['u']
       else
         str
diff --git a/app/lib/activitypub/tag_manager.rb b/app/lib/activitypub/tag_manager.rb
index 3f98dad2e..3f2ae1106 100644
--- a/app/lib/activitypub/tag_manager.rb
+++ b/app/lib/activitypub/tag_manager.rb
@@ -40,6 +40,10 @@ class ActivityPub::TagManager
     end
   end
 
+  def uri_for_username(username)
+    account_url(username: username)
+  end
+
   def generate_uri_for(_target)
     URI.join(root_url, 'payloads', SecureRandom.uuid)
   end