mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 02:20:39 +00:00
parent
a2f522478d
commit
6efca4f5cf
1 changed files with 6 additions and 6 deletions
|
@ -478,10 +478,6 @@ public class RecipientStore implements RecipientIdCreator, RecipientResolver, Re
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ProfileKey getProfileKey(final RecipientId recipientId) {
|
public ProfileKey getProfileKey(final RecipientId recipientId) {
|
||||||
final var selfRecipientId = resolveRecipient(selfAddressProvider.getSelfAddress());
|
|
||||||
if (recipientId.equals(selfRecipientId)) {
|
|
||||||
return selfProfileKeyProvider.getSelfProfileKey();
|
|
||||||
}
|
|
||||||
try (final var connection = database.getConnection()) {
|
try (final var connection = database.getConnection()) {
|
||||||
return getProfileKey(connection, recipientId);
|
return getProfileKey(connection, recipientId);
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
|
@ -662,9 +658,9 @@ public class RecipientStore implements RecipientIdCreator, RecipientResolver, Re
|
||||||
Connection connection, RecipientId recipientId, final ProfileKey profileKey, boolean resetProfile
|
Connection connection, RecipientId recipientId, final ProfileKey profileKey, boolean resetProfile
|
||||||
) throws SQLException {
|
) throws SQLException {
|
||||||
if (profileKey != null) {
|
if (profileKey != null) {
|
||||||
final var recipientProfileKey = getProfileKey(recipientId);
|
final var recipientProfileKey = getProfileKey(connection, recipientId);
|
||||||
if (profileKey.equals(recipientProfileKey)) {
|
if (profileKey.equals(recipientProfileKey)) {
|
||||||
final var recipientProfile = getProfile(recipientId);
|
final var recipientProfile = getProfile(connection, recipientId);
|
||||||
if (recipientProfile == null || (
|
if (recipientProfile == null || (
|
||||||
recipientProfile.getUnidentifiedAccessMode() != Profile.UnidentifiedAccessMode.UNKNOWN
|
recipientProfile.getUnidentifiedAccessMode() != Profile.UnidentifiedAccessMode.UNKNOWN
|
||||||
&& recipientProfile.getUnidentifiedAccessMode()
|
&& recipientProfile.getUnidentifiedAccessMode()
|
||||||
|
@ -985,6 +981,10 @@ public class RecipientStore implements RecipientIdCreator, RecipientResolver, Re
|
||||||
}
|
}
|
||||||
|
|
||||||
private ProfileKey getProfileKey(final Connection connection, final RecipientId recipientId) throws SQLException {
|
private ProfileKey getProfileKey(final Connection connection, final RecipientId recipientId) throws SQLException {
|
||||||
|
final var selfRecipientId = resolveRecipientLocked(connection, selfAddressProvider.getSelfAddress());
|
||||||
|
if (recipientId.equals(selfRecipientId)) {
|
||||||
|
return selfProfileKeyProvider.getSelfProfileKey();
|
||||||
|
}
|
||||||
final var sql = (
|
final var sql = (
|
||||||
"""
|
"""
|
||||||
SELECT r.profile_key
|
SELECT r.profile_key
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue