mirror of
https://github.com/oxen-io/session-android.git
synced 2025-12-03 09:22:23 +00:00
Clean up naming & indentation
This commit is contained in:
@@ -306,8 +306,8 @@ public class MessageSender {
|
||||
JobManager jobManager = ApplicationContext.getInstance(context).getJobManager();
|
||||
|
||||
// Just send the message normally if it's a group message or we're sending to one of our devices
|
||||
String recipientPublicKey = recipient.getAddress().serialize();
|
||||
if (GeneralUtilitiesKt.isPublicChat(context, recipientPublicKey) || PromiseUtil.get(MultiDeviceUtilities.isOneOfOurDevices(context, recipient.getAddress()), false)) {
|
||||
String recipientHexEncodedPublicKey = recipient.getAddress().serialize();
|
||||
if (GeneralUtilitiesKt.isPublicChat(context, recipientHexEncodedPublicKey) || PromiseUtil.get(MultiDeviceUtilities.isOneOfOurDevices(context, recipient.getAddress()), false)) {
|
||||
if (type == MessageType.MEDIA) {
|
||||
PushMediaSendJob.enqueue(context, jobManager, messageId, recipient.getAddress(), false);
|
||||
} else {
|
||||
@@ -318,16 +318,16 @@ public class MessageSender {
|
||||
|
||||
// If we get here then we are sending a message to a device that is not ours
|
||||
boolean[] hasSentSyncMessage = { false };
|
||||
MultiDeviceUtilities.getAllDevicePublicKeysWithFriendStatus(context, recipientPublicKey).success(devices -> {
|
||||
MultiDeviceUtilities.getAllDevicePublicKeysWithFriendStatus(context, recipientHexEncodedPublicKey).success(devices -> {
|
||||
int friendCount = MultiDeviceUtilities.getFriendCount(context, devices.keySet());
|
||||
Util.runOnMain(() -> {
|
||||
ArrayList<Job> jobs = new ArrayList<>();
|
||||
for (Map.Entry<String, Boolean> entry : devices.entrySet()) {
|
||||
String devicePublicKey = entry.getKey();
|
||||
String deviceHexEncodedPublicKey = entry.getKey();
|
||||
boolean isFriend = entry.getValue();
|
||||
|
||||
Address address = Address.fromSerialized(devicePublicKey);
|
||||
long messageIDToUse = recipientPublicKey.equals(devicePublicKey) ? messageId : -1L;
|
||||
Address address = Address.fromSerialized(deviceHexEncodedPublicKey);
|
||||
long messageIDToUse = recipientHexEncodedPublicKey.equals(deviceHexEncodedPublicKey) ? messageId : -1L;
|
||||
|
||||
if (isFriend) {
|
||||
// Send a normal message if the user is friends with the recipient
|
||||
@@ -340,7 +340,7 @@ public class MessageSender {
|
||||
}
|
||||
if (shouldSendSyncMessage) { hasSentSyncMessage[0] = true; }
|
||||
} else {
|
||||
// Send friend requests to non friends. If the user is friends with any
|
||||
// Send friend requests to non-friends. If the user is friends with any
|
||||
// of the devices then send out a default friend request message.
|
||||
boolean isFriendsWithAny = (friendCount > 0);
|
||||
String defaultFriendRequestMessage = isFriendsWithAny ? "Please accept to enable messages to be synced across devices" : null;
|
||||
|
||||
Reference in New Issue
Block a user