From 9769d85d768765337a758e47419b994224153703 Mon Sep 17 00:00:00 2001 From: Daniel Lugo Date: Sat, 25 Jan 2020 15:05:49 -0400 Subject: [PATCH] avoid dep injection --- services/gunDB/contact-api/actions.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/services/gunDB/contact-api/actions.js b/services/gunDB/contact-api/actions.js index 1bb3d347..e8c42a51 100644 --- a/services/gunDB/contact-api/actions.js +++ b/services/gunDB/contact-api/actions.js @@ -4,6 +4,7 @@ const uuidv1 = require('uuid/v1') const LightningServices = require('../../../utils/lightningServices') +const { getUser } = require('../Mediator') const ErrorCode = require('./errorCode') const Getters = require('./getters') @@ -625,11 +626,7 @@ const sendMessage = async (recipientPublicKey, body, user, SEA) => { ) } - const outgoingID = await Utils.recipientToOutgoingID( - recipientPublicKey, - user, - SEA - ) + const outgoingID = await Utils.recipientToOutgoingID(recipientPublicKey) if (outgoingID === null) { throw new Error( @@ -668,10 +665,9 @@ const sendMessage = async (recipientPublicKey, body, user, SEA) => { * @param {string} recipientPub * @param {string} msgID * @param {UserGUNNode} user - * @param {ISEA} SEA * @returns {Promise} */ -const deleteMessage = async (recipientPub, msgID, user, SEA) => { +const deleteMessage = async (recipientPub, msgID, user) => { if (!user.is) { throw new Error(ErrorCode.NOT_AUTH) } @@ -700,7 +696,7 @@ const deleteMessage = async (recipientPub, msgID, user, SEA) => { ) } - const outgoingID = await Utils.recipientToOutgoingID(recipientPub, user, SEA) + const outgoingID = await Utils.recipientToOutgoingID(recipientPub) if (outgoingID === null) { throw new Error(`Could not fetch an outgoing id for user: ${recipientPub}`)