minor fixes, debugging.

This commit is contained in:
Angelo Fuchs
2018-09-12 13:04:12 +02:00
parent 16d44bc576
commit d895d19418
2 changed files with 35 additions and 1 deletions
@@ -49,6 +49,7 @@ import org.thoughtcrime.securesms.util.ListenableFutureTask;
import org.thoughtcrime.securesms.util.Util;
import org.whispersystems.libsignal.util.guava.Optional;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.LinkedList;
@@ -629,6 +630,36 @@ public class Recipient implements RecipientModifiedListener {
listener.onModified(this);
}
@Override
public String toString() {
return "Recipient{" +
"listeners=" + listeners +
", address=" + address +
", participants=" + participants +
", name='" + name + '\'' +
", customLabel='" + customLabel + '\'' +
", resolving=" + resolving +
", systemContactPhoto=" + systemContactPhoto +
", groupAvatarId=" + groupAvatarId +
", contactUri=" + contactUri +
", messageRingtone=" + messageRingtone +
", callRingtone=" + callRingtone +
", mutedUntil=" + mutedUntil +
", blocked=" + blocked +
", messageVibrate=" + messageVibrate +
", callVibrate=" + callVibrate +
", expireMessages=" + expireMessages +
", defaultSubscriptionId=" + defaultSubscriptionId +
", registered=" + registered +
", color=" + color +
", seenInviteReminder=" + seenInviteReminder +
", profileKey=" + Arrays.toString(profileKey) +
", profileName='" + profileName + '\'' +
", profileAvatar='" + profileAvatar + '\'' +
", profileSharing=" + profileSharing +
'}';
}
@Override
public void onModified(Recipient recipient) {
notifyListeners();
@@ -203,8 +203,11 @@ public class Util {
public static boolean isOwnNumber(Context context, Address address) {
if (address.isGroup()) return false;
if (address.isEmail()) return false;
if (address.isDcChat()) return false;
String localNumber = TextSecurePreferences.getLocalNumber(context);
if (TextUtils.isEmpty(localNumber)) return false;
return TextSecurePreferences.getLocalNumber(context).equals(address.toPhoneString());
return localNumber.equals(address.toPhoneString());
}
public static void readFully(InputStream in, byte[] buffer) throws IOException {