File tree Expand file tree Collapse file tree 2 files changed +8
-9
lines changed Expand file tree Collapse file tree 2 files changed +8
-9
lines changed Original file line number Diff line number Diff line change 1
1
# frozen_string_literal: true
2
2
3
3
class User < ApplicationRecord
4
- include Connecting
5
- include Querying
6
- include SocialActions
7
- include Profile
8
-
9
4
# attr_accessor :plain_otp_secret
10
5
11
6
# encrypts :otp_secret
Original file line number Diff line number Diff line change @@ -21,13 +21,12 @@ def share_with(person, aspect)
21
21
contact . aspects << aspect
22
22
contact . save
23
23
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
28
25
26
+ # rubocop: disable Rails::SkipsModelValidations
29
27
Notifications ::StartedSharing . where ( recipient_id : user . id , target : person . id , unread : true )
30
28
. update_all ( unread : false )
29
+ # rubocop: enable Rails::SkipsModelValidations
31
30
32
31
contact
33
32
end
@@ -56,6 +55,11 @@ def disconnected_by(person)
56
55
57
56
attr_reader :user
58
57
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
+
59
63
def deliver_profile_update ( opts )
60
64
Profile . new ( user ) . deliver_profile_update ( opts )
61
65
end
You can’t perform that action at this time.
0 commit comments