Exclude the user's own number from notifyNewUsers

Closes #5229
// FREEBIE
This commit is contained in:
haffenloher
2016-02-14 14:58:39 +01:00
committed by Moxie Marlinspike
parent 156c5c6e09
commit 72064d8827
4 changed files with 26 additions and 28 deletions

View File

@@ -184,6 +184,16 @@ public class Util {
else return canonicalizeNumber(context, number);
}
public static boolean isOwnNumber(Context context, String number) {
try {
String e164number = canonicalizeNumber(context, number);
return TextSecurePreferences.getLocalNumber(context).equals(e164number);
} catch (InvalidNumberException e) {
Log.w(TAG, e);
}
return false;
}
public static byte[] readFully(InputStream in) throws IOException {
ByteArrayOutputStream bout = new ByteArrayOutputStream();
byte[] buffer = new byte[4096];