Search in sources :

Example 1 with IdentityKeyMismatchList

use of org.thoughtcrime.securesms.database.documents.IdentityKeyMismatchList in project Signal-Android by WhisperSystems.

the class MessagingDatabase method setMismatchedIdentity.

public void setMismatchedIdentity(long messageId, final long recipientId, final IdentityKey identityKey) {
    List<IdentityKeyMismatch> items = new ArrayList<IdentityKeyMismatch>() {

        {
            add(new IdentityKeyMismatch(recipientId, identityKey));
        }
    };
    IdentityKeyMismatchList document = new IdentityKeyMismatchList(items);
    SQLiteDatabase database = databaseHelper.getWritableDatabase();
    database.beginTransaction();
    try {
        setDocument(database, messageId, MISMATCHED_IDENTITIES, document);
        database.setTransactionSuccessful();
    } catch (IOException ioe) {
        Log.w(TAG, ioe);
    } finally {
        database.endTransaction();
    }
}
Also used : IdentityKeyMismatchList(org.thoughtcrime.securesms.database.documents.IdentityKeyMismatchList) SQLiteDatabase(android.database.sqlite.SQLiteDatabase) ArrayList(java.util.ArrayList) IdentityKeyMismatch(org.thoughtcrime.securesms.database.documents.IdentityKeyMismatch) IOException(java.io.IOException)

Aggregations

SQLiteDatabase (android.database.sqlite.SQLiteDatabase)1 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 IdentityKeyMismatch (org.thoughtcrime.securesms.database.documents.IdentityKeyMismatch)1 IdentityKeyMismatchList (org.thoughtcrime.securesms.database.documents.IdentityKeyMismatchList)1