File tree Expand file tree Collapse file tree 2 files changed +15
-8
lines changed
app/src/main/java/org/session/libsession/messaging Expand file tree Collapse file tree 2 files changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -123,6 +123,9 @@ class ProfileUpdateHandler @Inject constructor(
123
123
profilePic = updates.pic ? : r.profilePic,
124
124
blocksCommunityMessagesRequests = updates.blocksCommunityMessageRequests ? : r.blocksCommunityMessagesRequests
125
125
)
126
+ } else if (updates.blocksCommunityMessageRequests != null &&
127
+ r.blocksCommunityMessagesRequests != updates.blocksCommunityMessageRequests) {
128
+ r.copy(blocksCommunityMessagesRequests = updates.blocksCommunityMessageRequests)
126
129
} else {
127
130
r
128
131
}
Original file line number Diff line number Diff line change @@ -60,6 +60,18 @@ class MessageRequestResponseHandler @Inject constructor(
60
60
! messageSender.isSelf && messageReceiver.isSelf -> {
61
61
// We received a request response from another user.
62
62
63
+ // Mark the sender as "approvedMe".
64
+ // This process MUST be done before trying to update the profile,
65
+ // as profile updating requires the contact to exist
66
+ val didApproveMe = configFactory.withMutableUserConfigs { configs ->
67
+ configs.contacts.upsertContact(messageSender.address) {
68
+ val oldApproveMe = approvedMe
69
+ approvedMe = true
70
+ oldApproveMe
71
+ }
72
+ }
73
+
74
+
63
75
// Process the profile update if any
64
76
message.profile?.toUpdates()?.let { updates ->
65
77
profileUpdateHandler.get().handleProfileUpdate(
@@ -69,14 +81,6 @@ class MessageRequestResponseHandler @Inject constructor(
69
81
)
70
82
}
71
83
72
- // Mark the sender as "approvedMe"
73
- val didApproveMe = configFactory.withMutableUserConfigs { configs ->
74
- configs.contacts.upsertContact(messageSender.address) {
75
- val oldApproveMe = approvedMe
76
- approvedMe = true
77
- oldApproveMe
78
- }
79
- }
80
84
81
85
val threadId by lazy {
82
86
threadDatabase.getOrCreateThreadIdFor(messageSender.address)
You can’t perform that action at this time.
0 commit comments