diff options
author | Reverite <github@reverite.sh> | 2019-05-23 22:22:54 -0700 |
---|---|---|
committer | Reverite <github@reverite.sh> | 2019-05-23 22:22:54 -0700 |
commit | 93492d29e36e2bed11a1a742e2e0750716df5062 (patch) | |
tree | e475c56449c2c7e478e629cadbff41c9bb2fee3d /app/lib/activitypub/activity | |
parent | d873e4f3d5878a2b2800758cbe3b9c870c228d51 (diff) | |
parent | 72bf354e979a9b8c14c41bf34c47060d5ff4d232 (diff) |
Merge branch 'glitch' into production
Diffstat (limited to 'app/lib/activitypub/activity')
-rw-r--r-- | app/lib/activitypub/activity/create.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/lib/activitypub/activity/create.rb b/app/lib/activitypub/activity/create.rb index 6b16c9986..2bc33c04b 100644 --- a/app/lib/activitypub/activity/create.rb +++ b/app/lib/activitypub/activity/create.rb @@ -267,7 +267,11 @@ class ActivityPub::Activity::Create < ActivityPub::Activity def conversation_from_uri(uri) return nil if uri.nil? return Conversation.find_by(id: OStatus::TagManager.instance.unique_tag_to_local_id(uri, 'Conversation')) if OStatus::TagManager.instance.local_id?(uri) - Conversation.find_by(uri: uri) || Conversation.create(uri: uri) + begin + Conversation.find_or_create_by!(uri: uri) + rescue ActiveRecord::RecordInvalid, ActiveRecord::RecordNotUnique + retry + end end def visibility_from_audience |