| 1706 | }; |
| 1707 | |
| 1708 | const cleanKeys = async recipientId => { |
| 1709 | if (!recipientId || !getDB()) return; |
| 1710 | return await getDB().transaction(async trx => { |
| 1711 | const account = await Account().findOne({ |
| 1712 | where: { recipientId }, |
| 1713 | raw: true, |
| 1714 | transaction: trx |
| 1715 | }); |
| 1716 | if (!account) return []; |
| 1717 | await Prekeyrecord().destroy({ |
| 1718 | where: { accountId: account.id }, |
| 1719 | transaction: trx |
| 1720 | }); |
| 1721 | await Signedprekeyrecord().destroy({ |
| 1722 | where: { accountId: account.id }, |
| 1723 | transaction: trx |
| 1724 | }); |
| 1725 | await Sessionrecord().destroy({ |
| 1726 | where: { accountId: account.id }, |
| 1727 | transaction: trx |
| 1728 | }); |
| 1729 | await Identitykeyrecord().destroy({ |
| 1730 | where: { accountId: account.id }, |
| 1731 | transaction: trx |
| 1732 | }); |
| 1733 | }); |
| 1734 | }; |
| 1735 | |
| 1736 | const clearAndFormatDateEmails = emailObjOrArray => { |
| 1737 | let tempArr = []; |
nothing calls this directly
no test coverage detected