Skip to content

Commit 2fc16d6

Browse files
committed
fix merge conflicts
1 parent 12af135 commit 2fc16d6

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

app/models/user.rb

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
# frozen_string_literal: true
22

33
class User < ApplicationRecord
4-
include Connecting
5-
include Querying
6-
include SocialActions
7-
include Profile
8-
94
# attr_accessor :plain_otp_secret
105

116
# encrypts :otp_secret

app/models/user_services/connecting.rb

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,12 @@ def share_with(person, aspect)
2121
contact.aspects << aspect
2222
contact.save
2323

24-
if needs_dispatch
25-
Diaspora::Federation::Dispatcher.defer_dispatch(user, contact)
26-
deliver_profile_update(subscriber_ids: [person.id]) unless person.local?
27-
end
24+
dispatch_contact(contact, person) if needs_dispatch
2825

26+
# rubocop: disable Rails::SkipsModelValidations
2927
Notifications::StartedSharing.where(recipient_id: user.id, target: person.id, unread: true)
3028
.update_all(unread: false)
29+
# rubocop: enable Rails::SkipsModelValidations
3130

3231
contact
3332
end
@@ -56,6 +55,11 @@ def disconnected_by(person)
5655

5756
attr_reader :user
5857

58+
def dispatch_contact(contact, person)
59+
Diaspora::Federation::Dispatcher.defer_dispatch(user, contact)
60+
deliver_profile_update(subscriber_ids: [person.id]) unless person.local?
61+
end
62+
5963
def deliver_profile_update(opts)
6064
Profile.new(user).deliver_profile_update(opts)
6165
end

0 commit comments

Comments
 (0)