Browse Source

logz

push-params
Evan Feenstra 5 years ago
parent
commit
4457e5817a
  1. 4
      api/controllers/contacts.ts
  2. 2
      api/crypto/rsa.ts
  3. 1
      api/helpers.ts
  4. 4
      dist/api/controllers/contacts.js
  5. 2
      dist/api/controllers/contacts.js.map
  6. 1
      dist/api/helpers.js
  7. 2
      dist/api/helpers.js.map
  8. 2
      dist/api/utils/socket.js.map

4
api/controllers/contacts.ts

@ -208,7 +208,7 @@ export const receiveContactKey = async (payload) => {
const owner = await models.Contact.findOne({ where: { isOwner: true }})
const sender = await models.Contact.findOne({ where: { publicKey: sender_pub_key, status: constants.contact_statuses.confirmed }})
console.log("FOUND SENDER",sender&&sender.dataValue)
if (sender_contact_key && sender) {
const objToUpdate:{[k:string]:any} = {contactKey: sender_contact_key}
if(sender_alias) objToUpdate.alias = sender_alias
@ -219,6 +219,8 @@ export const receiveContactKey = async (payload) => {
type: 'contact',
response: jsonUtils.contactToJson(sender)
})
} else {
console.log("DID NOT FIND SENDER")
}
helpers.sendContactKeys({

2
api/crypto/rsa.ts

@ -13,7 +13,7 @@ export function encrypt(key, txt){
arr.forEach((_,i)=>{
const f = crypto.publicEncrypt({
key:pubc,
padding:crypto.constants.RSA_PKCS1_PADDING,
padding:crypto.constants.RSA_PKCS1_PADDING, // RSA_PKCS1_OAEP_PADDING
}, buf.subarray(i*MAX_CHUNK_SIZE,i*MAX_CHUNK_SIZE+MAX_CHUNK_SIZE))
finalBuf = Buffer.concat([finalBuf,f])
})

1
api/helpers.ts

@ -163,6 +163,7 @@ export async function parseReceiveParams(payload) {
const owner = await models.Contact.findOne({ where: { isOwner: true } })
if (isConversation) {
sender = await findOrCreateContactByPubkey(sender_pub_key)
console.log("CREATED CONTACT AUTOMATICALLY",sender&&sender.id)
chat = await findOrCreateChatByUUID(
chat_uuid, [parseInt(owner.id), parseInt(sender.id)]
)

4
dist/api/controllers/contacts.js

@ -184,6 +184,7 @@ exports.receiveContactKey = (payload) => __awaiter(void 0, void 0, void 0, funct
}
const owner = yield models_1.models.Contact.findOne({ where: { isOwner: true } });
const sender = yield models_1.models.Contact.findOne({ where: { publicKey: sender_pub_key, status: constants.contact_statuses.confirmed } });
console.log("FOUND SENDER", sender && sender.dataValue);
if (sender_contact_key && sender) {
const objToUpdate = { contactKey: sender_contact_key };
if (sender_alias)
@ -196,6 +197,9 @@ exports.receiveContactKey = (payload) => __awaiter(void 0, void 0, void 0, funct
response: jsonUtils.contactToJson(sender)
});
}
else {
console.log("DID NOT FIND SENDER");
}
helpers.sendContactKeys({
contactPubKey: sender_pub_key,
sender: owner,

2
dist/api/controllers/contacts.js.map

File diff suppressed because one or more lines are too long

1
dist/api/helpers.js

@ -175,6 +175,7 @@ function parseReceiveParams(payload) {
const owner = yield models_1.models.Contact.findOne({ where: { isOwner: true } });
if (isConversation) {
sender = yield findOrCreateContactByPubkey(sender_pub_key);
console.log("CREATED CONTACT AUTOMATICALLY", sender && sender.id);
chat = yield findOrCreateChatByUUID(chat_uuid, [parseInt(owner.id), parseInt(sender.id)]);
if (sender.fromGroup) { // if a private msg received, update the contact
yield sender.update({ fromGroup: false });

2
dist/api/helpers.js.map

File diff suppressed because one or more lines are too long

2
dist/api/utils/socket.js.map

@ -1 +1 @@
{"version":3,"file":"socket.js","sourceRoot":"","sources":["../../../api/utils/socket.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAgC;AAChC,iCAAgC;AAEhC,kCAAkC;AAClC,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AAEtC,IAAI,EAAO,CAAA;AACX,gBAAgB;AAEhB,SAAgB,OAAO,CAAC,MAAM;IAC5B,+DAA+D;IAE/D,EAAE,GAAG,QAAQ,CAAC,MAAM,EAAE;QACpB,sBAAsB,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;YACnC,MAAM,OAAO,GAAG;gBACZ,8BAA8B,EAAE,sDAAsD;gBACtF,6BAA6B,EAAE,GAAG,CAAC,OAAO,CAAC,MAAM;gBAC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