Browse Source

fix casing

hosting-provider
Evan Feenstra 5 years ago
parent
commit
172b4fd465
  1. 8
      api/controllers/contacts.ts
  2. 5
      api/helpers.ts
  3. 2
      api/network/send.ts
  4. 7
      dist/api/controllers/contacts.js
  5. 2
      dist/api/controllers/contacts.js.map
  6. 5
      dist/api/helpers.js
  7. 2
      dist/api/helpers.js.map
  8. 2
      dist/api/network/send.js
  9. 2
      dist/api/network/send.js.map

8
api/controllers/contacts.ts

@ -194,17 +194,13 @@ const receiveConfirmContactKey = async (payload) => {
const sender_pub_key = dat.sender.pub_key
const sender_contact_key = dat.sender.contact_key
const sender_alias = dat.sender.alias || 'Unknown'
const sender_photo_url = dat.sender.photoUrl
if(sender_photo_url){
// download and store photo locally
}
const sender_photo_url = dat.sender.photo_url
const sender = await models.Contact.findOne({ where: { publicKey: sender_pub_key, status: constants.contact_statuses.confirmed }})
if (sender_contact_key && sender) {
const objToUpdate:{[k:string]:any} = {contactKey: sender_contact_key}
if(sender_alias) objToUpdate.alias = sender_alias
if(sender_photo_url) objToUpdate.photo_url = sender_photo_url
if(sender_photo_url) objToUpdate.photoUrl = sender_photo_url
await sender.update(objToUpdate)
socket.sendJson({

5
api/helpers.ts

@ -135,6 +135,7 @@ async function parseReceiveParams(payload) {
const dat = payload.content || payload
const sender_pub_key = dat.sender.pub_key
const sender_alias = dat.sender.alias
const sender_photo_url = dat.sender.photo_url
const chat_uuid = dat.chat.uuid
const chat_type = dat.chat.type
const chat_members: { [k: string]: any } = dat.chat.members || {}
@ -176,7 +177,7 @@ async function parseReceiveParams(payload) {
}
chat = await models.Chat.findOne({ where: { uuid: chat_uuid } })
}
return { owner, sender, chat, sender_pub_key, sender_alias, isTribeOwner, chat_uuid, amount, content, mediaToken, mediaKey, mediaType, originalMuid, chat_type, msg_id, chat_members, chat_name, chat_host, chat_key, remote_content, msg_uuid, date_string, reply_uuid, skip_payment_processing, purchaser_id }
return { owner, sender, chat, sender_pub_key, sender_alias, isTribeOwner, chat_uuid, amount, content, mediaToken, mediaKey, mediaType, originalMuid, chat_type, msg_id, chat_members, chat_name, chat_host, chat_key, remote_content, msg_uuid, date_string, reply_uuid, skip_payment_processing, purchaser_id, sender_photo_url }
}
export {
@ -203,7 +204,7 @@ function newkeyexchangemsg(type, sender){
// pub_key: sender.publicKey,
contact_key: sender.contactKey,
...sender.alias && {alias: sender.alias},
...includePhotoUrl && {photoUrl: sender.photoUrl}
...includePhotoUrl && {photo_url: sender.photoUrl}
}
}
}

2
api/network/send.ts

@ -132,7 +132,7 @@ export function newmsg(type, chat, sender, message){
sender: {
pub_key: sender.publicKey,
...includeAlias && {alias: sender.alias},
...includePhotoUrl && {photoUrl: sender.photoUrl},
...includePhotoUrl && {photo_url: sender.photoUrl},
// ...sender.contactKey && {contact_key: sender.contactKey}
}
}

7
dist/api/controllers/contacts.js

@ -178,17 +178,14 @@ const receiveConfirmContactKey = (payload) => __awaiter(void 0, void 0, void 0,
const sender_pub_key = dat.sender.pub_key;
const sender_contact_key = dat.sender.contact_key;
const sender_alias = dat.sender.alias || 'Unknown';
const sender_photo_url = dat.sender.photoUrl;
if (sender_photo_url) {
// download and store photo locally
}
const sender_photo_url = dat.sender.photo_url;
const sender = yield models_1.models.Contact.findOne({ where: { publicKey: sender_pub_key, status: constants.contact_statuses.confirmed } });
if (sender_contact_key && sender) {
const objToUpdate = { contactKey: sender_contact_key };
if (sender_alias)
objToUpdate.alias = sender_alias;
if (sender_photo_url)
objToUpdate.photo_url = sender_photo_url;
objToUpdate.photoUrl = sender_photo_url;
yield sender.update(objToUpdate);
socket.sendJson({
type: 'contact',

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

File diff suppressed because one or more lines are too long

5
dist/api/helpers.js

@ -151,6 +151,7 @@ function parseReceiveParams(payload) {
const dat = payload.content || payload;
const sender_pub_key = dat.sender.pub_key;
const sender_alias = dat.sender.alias;
const sender_photo_url = dat.sender.photo_url;
const chat_uuid = dat.chat.uuid;
const chat_type = dat.chat.type;
const chat_members = dat.chat.members || {};
@ -190,7 +191,7 @@ function parseReceiveParams(payload) {
}
chat = yield models_1.models.Chat.findOne({ where: { uuid: chat_uuid } });
}
return { owner, sender, chat, sender_pub_key, sender_alias, isTribeOwner, chat_uuid, amount, content, mediaToken, mediaKey, mediaType, originalMuid, chat_type, msg_id, chat_members, chat_name, chat_host, chat_key, remote_content, msg_uuid, date_string, reply_uuid, skip_payment_processing, purchaser_id };
return { owner, sender, chat, sender_pub_key, sender_alias, isTribeOwner, chat_uuid, amount, content, mediaToken, mediaKey, mediaType, originalMuid, chat_type, msg_id, chat_members, chat_name, chat_host, chat_key, remote_content, msg_uuid, date_string, reply_uuid, skip_payment_processing, purchaser_id, sender_photo_url };
});
}
exports.parseReceiveParams = parseReceiveParams;
@ -207,7 +208,7 @@ function newkeyexchangemsg(type, sender) {
type: type,
sender: Object.assign(Object.assign({
// pub_key: sender.publicKey,
contact_key: sender.contactKey }, sender.alias && { alias: sender.alias }), includePhotoUrl && { photoUrl: sender.photoUrl })
contact_key: sender.contactKey }, sender.alias && { alias: sender.alias }), includePhotoUrl && { photo_url: sender.photoUrl })
};
}
//# sourceMappingURL=helpers.js.map

2
dist/api/helpers.js.map

File diff suppressed because one or more lines are too long

2
dist/api/network/send.js

@ -132,7 +132,7 @@ function newmsg(type, chat, sender, message) {
type: type,
chat: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ uuid: chat.uuid }, chat.name && { name: chat.name }), (chat.type || chat.type === 0) && { type: chat.type }), chat.members && { members: chat.members }), (includeGroupKey && chat.groupKey) && { groupKey: chat.groupKey }), (includeGroupKey && chat.host) && { host: chat.host }),
message: message,
sender: Object.assign(Object.assign({ pub_key: sender.publicKey }, includeAlias && { alias: sender.alias }), includePhotoUrl && { photoUrl: sender.photoUrl })
sender: Object.assign(Object.assign({ pub_key: sender.publicKey }, includeAlias && { alias: sender.alias }), includePhotoUrl && { photo_url: sender.photoUrl })
};
}
exports.newmsg = newmsg;

2
dist/api/network/send.js.map

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save