mirror of
https://github.com/oxen-io/session-android.git
synced 2025-12-05 07:32:14 +00:00
Simply PushServiceSocket constructor.
This commit is contained in:
@@ -9,6 +9,7 @@ import android.os.PowerManager;
|
||||
import android.util.Log;
|
||||
|
||||
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
||||
import org.thoughtcrime.securesms.util.TextSecurePushCredentials;
|
||||
import org.whispersystems.textsecure.directory.Directory;
|
||||
import org.whispersystems.textsecure.push.ContactTokenDetails;
|
||||
import org.whispersystems.textsecure.push.PushServiceSocket;
|
||||
@@ -57,12 +58,10 @@ public class DirectoryRefreshService extends Service {
|
||||
public void run() {
|
||||
try {
|
||||
Log.w("DirectoryRefreshService", "Refreshing directory...");
|
||||
Directory directory = Directory.getInstance(context);
|
||||
String localNumber = TextSecurePreferences.getLocalNumber(context);
|
||||
String password = TextSecurePreferences.getPushServerPassword(context);
|
||||
PushServiceSocket socket = new PushServiceSocket(context, localNumber, password);
|
||||
Directory directory = Directory.getInstance(context);
|
||||
PushServiceSocket socket = new PushServiceSocket(context, TextSecurePushCredentials.getInstance());
|
||||
|
||||
Set<String> eligibleContactTokens = directory.getPushEligibleContactTokens(localNumber);
|
||||
Set<String> eligibleContactTokens = directory.getPushEligibleContactTokens(TextSecurePreferences.getLocalNumber(context));
|
||||
List<ContactTokenDetails> activeTokens = socket.retrieveDirectory(eligibleContactTokens);
|
||||
|
||||
if (activeTokens != null) {
|
||||
|
||||
@@ -10,6 +10,7 @@ import org.thoughtcrime.securesms.database.DatabaseFactory;
|
||||
import org.thoughtcrime.securesms.database.EncryptingPartDatabase;
|
||||
import org.thoughtcrime.securesms.database.PartDatabase;
|
||||
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
||||
import org.thoughtcrime.securesms.util.TextSecurePushCredentials;
|
||||
import org.thoughtcrime.securesms.util.Util;
|
||||
import org.whispersystems.textsecure.crypto.AttachmentCipherInputStream;
|
||||
import org.whispersystems.textsecure.crypto.InvalidMessageException;
|
||||
@@ -97,10 +98,7 @@ public class PushDownloader {
|
||||
}
|
||||
|
||||
private File downloadAttachment(long contentLocation) throws IOException {
|
||||
String localNumber = TextSecurePreferences.getLocalNumber(context);
|
||||
String password = TextSecurePreferences.getPushServerPassword(context);
|
||||
PushServiceSocket socket = new PushServiceSocket(context, localNumber, password);
|
||||
|
||||
PushServiceSocket socket = new PushServiceSocket(context, TextSecurePushCredentials.getInstance());
|
||||
return socket.retrieveAttachment(contentLocation);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user