Skip to content

Commit

Permalink
Fix crash when trying to create new group story.
Browse files Browse the repository at this point in the history
Adds INNER JOIN to threads table to allow access to date in ORDER BY
  • Loading branch information
alex-signal authored and greyson-signal committed Jan 27, 2023
1 parent 27e1bc0 commit df695f7
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,7 @@ class GroupTable(context: Context?, databaseHelper: SignalDatabase?) : DatabaseT
val query = getGroupQueryWhereStatement(groupQuery.searchQuery, groupQuery.includeInactive, !groupQuery.includeV1, !groupQuery.includeMms)
val sql = """
$JOINED_GROUP_SELECT
INNER JOIN ${ThreadTable.TABLE_NAME} ON ${ThreadTable.TABLE_NAME}.${ThreadTable.RECIPIENT_ID} = $TABLE_NAME.$RECIPIENT_ID
WHERE ${query.where}
GROUP BY $TABLE_NAME.$GROUP_ID
ORDER BY ${ThreadTable.TABLE_NAME}.${ThreadTable.DATE} DESC
Expand Down

0 comments on commit df695f7

Please sign in to comment.