Add basic support for receiving messages at your PNI.

We haven't implemented merging yet, so this is still very basic, but it
"works".
This commit is contained in:
Greyson Parrelli
2022-04-13 16:22:22 -04:00
parent 41e417ff0b
commit 35a9fddbb2
14 changed files with 136 additions and 23 deletions

View File

@@ -93,7 +93,8 @@ public class PushDatabase extends Database {
Util.isEmpty(content) ? null : Base64.decode(content),
cursor.getLong(cursor.getColumnIndexOrThrow(SERVER_RECEIVED_TIMESTAMP)),
cursor.getLong(cursor.getColumnIndexOrThrow(SERVER_DELIVERED_TIMESTAMP)),
cursor.getString(cursor.getColumnIndexOrThrow(SERVER_GUID)));
cursor.getString(cursor.getColumnIndexOrThrow(SERVER_GUID)),
"");
}
} catch (IOException e) {
Log.w(TAG, e);
@@ -178,7 +179,8 @@ public class PushDatabase extends Database {
content != null ? Base64.decode(content) : null,
serverReceivedTimestamp,
serverDeliveredTimestamp,
serverGuid);
serverGuid,
"");
} catch (IOException e) {
throw new AssertionError(e);
}

View File

@@ -2932,6 +2932,21 @@ open class RecipientDatabase(context: Context, databaseHelper: SignalDatabase) :
SERVICE_ID to null,
PNI_COLUMN to null
)
.where("$ID != ?", Recipient.self().id)
.run()
}
/**
* Should only be used for debugging! A very destructive action that clears all known profile keys and credentials.
*/
fun debugClearProfileKeys() {
writableDatabase
.update(TABLE_NAME)
.values(
PROFILE_KEY to null,
PROFILE_KEY_CREDENTIAL to null
)
.where("$ID != ?", Recipient.self().id)
.run()
}