Skip to content

Commit

Permalink
fix merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
tclaus committed Apr 1, 2024
1 parent 12af135 commit 2fc16d6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
5 changes: 0 additions & 5 deletions app/models/user.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
# frozen_string_literal: true

class User < ApplicationRecord
include Connecting
include Querying
include SocialActions
include Profile

# attr_accessor :plain_otp_secret

# encrypts :otp_secret
Expand Down
12 changes: 8 additions & 4 deletions app/models/user_services/connecting.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@ def share_with(person, aspect)
contact.aspects << aspect
contact.save

if needs_dispatch
Diaspora::Federation::Dispatcher.defer_dispatch(user, contact)
deliver_profile_update(subscriber_ids: [person.id]) unless person.local?
end
dispatch_contact(contact, person) if needs_dispatch

# rubocop: disable Rails::SkipsModelValidations
Notifications::StartedSharing.where(recipient_id: user.id, target: person.id, unread: true)
.update_all(unread: false)
# rubocop: enable Rails::SkipsModelValidations

contact
end
Expand Down Expand Up @@ -56,6 +55,11 @@ def disconnected_by(person)

attr_reader :user

def dispatch_contact(contact, person)
Diaspora::Federation::Dispatcher.defer_dispatch(user, contact)
deliver_profile_update(subscriber_ids: [person.id]) unless person.local?
end

def deliver_profile_update(opts)
Profile.new(user).deliver_profile_update(opts)
end
Expand Down

0 comments on commit 2fc16d6

Please sign in to comment.