diff --git a/library/src/org/whispersystems/textsecure/directory/Directory.java b/library/src/org/whispersystems/textsecure/directory/Directory.java index 900c652d7e..571c765b05 100644 --- a/library/src/org/whispersystems/textsecure/directory/Directory.java +++ b/library/src/org/whispersystems/textsecure/directory/Directory.java @@ -109,7 +109,7 @@ public class Directory { values.put(TOKEN, token.getToken()); values.put(RELAY, token.getRelay()); values.put(REGISTERED, active ? 1 : 0); - values.put(SUPPORTS_SMS, token.isSupportsSms()); + values.put(SUPPORTS_SMS, token.isSupportsSms() ? 1 : 0); values.put(TIMESTAMP, System.currentTimeMillis()); db.replace(TABLE_NAME, null, values); } @@ -127,6 +127,7 @@ public class Directory { values.put(REGISTERED, 1); values.put(TIMESTAMP, timestamp); values.put(RELAY, token.getRelay()); + values.put(SUPPORTS_SMS, token.isSupportsSms() ? 1 : 0); db.replace(TABLE_NAME, null, values); } diff --git a/library/src/org/whispersystems/textsecure/push/PushDestination.java b/library/src/org/whispersystems/textsecure/push/PushDestination.java index 59e5e2ca88..7674d93cf8 100644 --- a/library/src/org/whispersystems/textsecure/push/PushDestination.java +++ b/library/src/org/whispersystems/textsecure/push/PushDestination.java @@ -23,9 +23,9 @@ public class PushDestination { return relay; } - public static PushDestination getInstance(Context context, - PushServiceSocket.PushCredentials credentials, - String destinationNumber) + public static PushDestination create(Context context, + PushServiceSocket.PushCredentials credentials, + String destinationNumber) { String e164destination = PhoneNumberFormatter.formatNumber(destinationNumber, credentials.getLocalNumber(context)); String relay = Directory.getInstance(context).getRelay(e164destination); diff --git a/src/org/thoughtcrime/securesms/transport/PushTransport.java b/src/org/thoughtcrime/securesms/transport/PushTransport.java index ad900e98fa..a5c542e130 100644 --- a/src/org/thoughtcrime/securesms/transport/PushTransport.java +++ b/src/org/thoughtcrime/securesms/transport/PushTransport.java @@ -59,8 +59,8 @@ public class PushTransport extends BaseTransport { TextSecurePushCredentials credentials = TextSecurePushCredentials.getInstance(); Recipient recipient = message.getIndividualRecipient(); PushServiceSocket socket = new PushServiceSocket(context, credentials); - PushDestination destination = PushDestination.getInstance(context, credentials, - recipient.getNumber()); + PushDestination destination = PushDestination.create(context, credentials, + recipient.getNumber()); String plaintextBody = message.getBody().getBody(); byte[] plaintext = PushMessageContent.newBuilder() diff --git a/src/org/thoughtcrime/securesms/transport/UniversalTransport.java b/src/org/thoughtcrime/securesms/transport/UniversalTransport.java index 064143d987..37fd4993cb 100644 --- a/src/org/thoughtcrime/securesms/transport/UniversalTransport.java +++ b/src/org/thoughtcrime/securesms/transport/UniversalTransport.java @@ -104,19 +104,19 @@ public class UniversalTransport { if (mediaMessage.getTo() != null) { for (EncodedStringValue to : mediaMessage.getTo()) { - destinations.add(PushDestination.getInstance(context, credentials, to.getString())); + destinations.add(PushDestination.create(context, credentials, to.getString())); } } if (mediaMessage.getCc() != null) { for (EncodedStringValue cc : mediaMessage.getCc()) { - destinations.add(PushDestination.getInstance(context, credentials, cc.getString())); + destinations.add(PushDestination.create(context, credentials, cc.getString())); } } if (mediaMessage.getBcc() != null) { for (EncodedStringValue bcc : mediaMessage.getBcc()) { - destinations.add(PushDestination.getInstance(context, credentials, bcc.getString())); + destinations.add(PushDestination.create(context, credentials, bcc.getString())); } }