Respond to CR.

This commit is contained in:
Matthew Chen 2019-07-18 17:36:06 -03:00
parent d351bbd290
commit 7cceec9325
2 changed files with 8 additions and 9 deletions

View File

@ -208,7 +208,7 @@ NSUInteger TSCallCurrentSchemaVersion = 1;
[self anyUpdateCallWithTransaction:transaction
block:^(TSCall *call) {
self.callType = callType;
call.callType = callType;
}];
}

View File

@ -622,8 +622,10 @@ struct GRDBInteractionFinderAdapter: InteractionFinderAdapter {
SELECT \(interactionColumn: .uniqueId)
FROM \(InteractionRecord.databaseTableName)
WHERE \(interactionColumn: .recordType) = ?
AND ( \(interactionColumn: .callType) = ?
OR \(interactionColumn: .callType) = ? )
AND (
\(interactionColumn: .callType) = ?
OR \(interactionColumn: .callType) = ?
)
"""
let statementArguments: StatementArguments = [
SDSRecordType.call.rawValue,
@ -632,12 +634,9 @@ struct GRDBInteractionFinderAdapter: InteractionFinderAdapter {
]
var result = [String]()
do {
let cursor = try String.fetchCursor(transaction.database,
sql: sql,
arguments: statementArguments)
while let uniqueId = try cursor.next() {
result.append(uniqueId)
}
result = try String.fetchAll(transaction.database,
sql: sql,
arguments: statementArguments)
} catch {
owsFailDebug("error: \(error)")
}