Browse Source

merge master

loopout2
Evan Feenstra 4 years ago
parent
commit
f17b88ea61
  1. 4
      dist/src/hub.js
  2. 2
      dist/src/hub.js.map
  3. 4
      dist/src/network/receive.js
  4. 2
      dist/src/network/receive.js.map
  5. 4
      src/hub.ts
  6. 4
      src/network/receive.ts

4
dist/src/hub.js

@ -187,7 +187,7 @@ const createInviteInHub = (params, onSuccess, onFailure) => {
}); });
}; };
exports.createInviteInHub = createInviteInHub; exports.createInviteInHub = createInviteInHub;
const sendNotification = (chat, name, type) => __awaiter(void 0, void 0, void 0, function* () { const sendNotification = (chat, name, type, amount) => __awaiter(void 0, void 0, void 0, function* () {
let message = `You have a new message from ${name}`; let message = `You have a new message from ${name}`;
if (type === 'invite') { if (type === 'invite') {
message = `Your invite to ${name} is ready`; message = `Your invite to ${name} is ready`;
@ -199,7 +199,7 @@ const sendNotification = (chat, name, type) => __awaiter(void 0, void 0, void 0,
message = `The admin has declined your request to join "${name}"`; message = `The admin has declined your request to join "${name}"`;
} }
if (type === 'keysend') { if (type === 'keysend') {
message = `You have received a keysend payment`; message = `You have received a payment of ${amount} sats`;
} }
if (type === 'message' && chat.type == constants_1.default.chat_types.group && chat.name && chat.name.length) { if (type === 'message' && chat.type == constants_1.default.chat_types.group && chat.name && chat.name.length) {
message += ` on ${chat.name}`; message += ` on ${chat.name}`;

2
dist/src/hub.js.map

File diff suppressed because one or more lines are too long

4
dist/src/network/receive.js

@ -312,10 +312,10 @@ function parseKeysendInvoice(i) {
const value = i && i.value && parseInt(i.value); const value = i && i.value && parseInt(i.value);
if (!data || (data && data.startsWith('{}'))) { if (!data || (data && data.startsWith('{}'))) {
socket.sendJson({ socket.sendJson({
type: 'direct_payment', type: 'keysend',
response: { amount: value || 0 } response: { amount: value || 0 }
}); });
hub_1.sendNotification(-1, '', 'keysend'); hub_1.sendNotification(-1, '', 'keysend', value || 0);
saveAnonymousKeysend(i); saveAnonymousKeysend(i);
return; return;
} }

2
dist/src/network/receive.js.map

File diff suppressed because one or more lines are too long

4
src/hub.ts

@ -190,7 +190,7 @@ const createInviteInHub = (params, onSuccess, onFailure) => {
type NotificationType = 'group' | 'badge' | 'invite' | 'message' | 'reject' | 'keysend' type NotificationType = 'group' | 'badge' | 'invite' | 'message' | 'reject' | 'keysend'
const sendNotification = async (chat, name, type:NotificationType) => { const sendNotification = async (chat, name, type:NotificationType, amount?:number) => {
let message = `You have a new message from ${name}` let message = `You have a new message from ${name}`
if(type==='invite'){ if(type==='invite'){
@ -203,7 +203,7 @@ const sendNotification = async (chat, name, type:NotificationType) => {
message = `The admin has declined your request to join "${name}"` message = `The admin has declined your request to join "${name}"`
} }
if(type==='keysend') { if(type==='keysend') {
message = `You have received a keysend payment` message = `You have received a payment of ${amount} sats`
} }
if(type==='message' && chat.type==constants.chat_types.group && chat.name && chat.name.length){ if(type==='message' && chat.type==constants.chat_types.group && chat.name && chat.name.length){

4
src/network/receive.ts

@ -283,10 +283,10 @@ export async function parseKeysendInvoice(i){
const value = i && i.value && parseInt(i.value) const value = i && i.value && parseInt(i.value)
if(!data || (data&&data.startsWith('{}'))) { if(!data || (data&&data.startsWith('{}'))) {
socket.sendJson({ socket.sendJson({
type:'direct_payment', type:'keysend',
response: {amount:value||0} response: {amount:value||0}
}) })
sendNotification(-1, '', 'keysend') sendNotification(-1, '', 'keysend', value||0)
saveAnonymousKeysend(i) saveAnonymousKeysend(i)
return return
} }

Loading…
Cancel
Save