Added a missing filter to a db query
This commit is contained in:
parent
4419d31077
commit
8f2e09d125
|
@ -158,6 +158,7 @@ internal extension SessionUtil {
|
||||||
/// If the contact's `hidden` flag doesn't match the visibility of their conversation then create/delete the
|
/// If the contact's `hidden` flag doesn't match the visibility of their conversation then create/delete the
|
||||||
/// associated contact conversation accordingly
|
/// associated contact conversation accordingly
|
||||||
let threadInfo: PriorityVisibilityInfo? = try? SessionThread
|
let threadInfo: PriorityVisibilityInfo? = try? SessionThread
|
||||||
|
.filter(id: sessionId)
|
||||||
.select(.id, .variant, .pinnedPriority, .shouldBeVisible)
|
.select(.id, .variant, .pinnedPriority, .shouldBeVisible)
|
||||||
.asRequest(of: PriorityVisibilityInfo.self)
|
.asRequest(of: PriorityVisibilityInfo.self)
|
||||||
.fetchOne(db)
|
.fetchOne(db)
|
||||||
|
@ -166,12 +167,12 @@ internal extension SessionUtil {
|
||||||
|
|
||||||
switch (updatedShouldBeVisible, threadExists) {
|
switch (updatedShouldBeVisible, threadExists) {
|
||||||
case (false, true):
|
case (false, true):
|
||||||
SessionUtil.kickFromConversationUIIfNeeded(removedThreadIds: [contact.id])
|
SessionUtil.kickFromConversationUIIfNeeded(removedThreadIds: [sessionId])
|
||||||
|
|
||||||
try SessionThread
|
try SessionThread
|
||||||
.deleteOrLeave(
|
.deleteOrLeave(
|
||||||
db,
|
db,
|
||||||
threadId: contact.id,
|
threadId: sessionId,
|
||||||
threadVariant: .contact,
|
threadVariant: .contact,
|
||||||
groupLeaveType: .forced,
|
groupLeaveType: .forced,
|
||||||
calledFromConfigHandling: true
|
calledFromConfigHandling: true
|
||||||
|
@ -179,7 +180,7 @@ internal extension SessionUtil {
|
||||||
|
|
||||||
case (true, false):
|
case (true, false):
|
||||||
try SessionThread(
|
try SessionThread(
|
||||||
id: contact.id,
|
id: sessionId,
|
||||||
variant: .contact,
|
variant: .contact,
|
||||||
creationDateTimestamp: data.created,
|
creationDateTimestamp: data.created,
|
||||||
shouldBeVisible: true,
|
shouldBeVisible: true,
|
||||||
|
@ -197,7 +198,7 @@ internal extension SessionUtil {
|
||||||
].compactMap { $0 }
|
].compactMap { $0 }
|
||||||
|
|
||||||
try SessionThread
|
try SessionThread
|
||||||
.filter(id: contact.id)
|
.filter(id: sessionId)
|
||||||
.updateAll( // Handling a config update so don't use `updateAllAndConfig`
|
.updateAll( // Handling a config update so don't use `updateAllAndConfig`
|
||||||
db,
|
db,
|
||||||
changes
|
changes
|
||||||
|
|
Loading…
Reference in New Issue