@ -288,6 +288,52 @@ internal extension SessionUtil {
)
}
}
static func remove ( _ db : Database , volatileContactIds : [ String ] ) throws {
try SessionUtil . performAndPushChange (
db ,
for : . convoInfoVolatile ,
publicKey : getUserHexEncodedPublicKey ( db )
) { conf in
volatileContactIds . forEach { contactId in
var cSessionId : [ CChar ] = contactId . cArray
// D o n ' t c a r e i f t h e d a t a d o e s n ' t e x i s t
convo_info_volatile_erase_1to1 ( conf , & cSessionId )
}
}
}
static func remove ( _ db : Database , volatileLegacyGroupIds : [ String ] ) throws {
try SessionUtil . performAndPushChange (
db ,
for : . convoInfoVolatile ,
publicKey : getUserHexEncodedPublicKey ( db )
) { conf in
volatileLegacyGroupIds . forEach { legacyGroupId in
var cLegacyGroupId : [ CChar ] = legacyGroupId . cArray
// D o n ' t c a r e i f t h e d a t a d o e s n ' t e x i s t
convo_info_volatile_erase_legacy_group ( conf , & cLegacyGroupId )
}
}
}
static func remove ( _ db : Database , volatileCommunityInfo : [ OpenGroupUrlInfo ] ) throws {
try SessionUtil . performAndPushChange (
db ,
for : . convoInfoVolatile ,
publicKey : getUserHexEncodedPublicKey ( db )
) { conf in
volatileCommunityInfo . forEach { urlInfo in
var cBaseUrl : [ CChar ] = urlInfo . server . cArray
var cRoom : [ CChar ] = urlInfo . roomToken . cArray
// D o n ' t c a r e i f t h e d a t a d o e s n ' t e x i s t
convo_info_volatile_erase_community ( conf , & cBaseUrl , & cRoom )
}
}
}
}
// MARK: - E x t e r n a l O u t g o i n g C h a n g e s