|
@ -244,6 +244,17 @@ function initTribesSubscriptions() { |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
exports.initTribesSubscriptions = initTribesSubscriptions; |
|
|
exports.initTribesSubscriptions = initTribesSubscriptions; |
|
|
|
|
|
function parsePayload(data) { |
|
|
|
|
|
const li = data.lastIndexOf('}'); |
|
|
|
|
|
const msg = data.substring(0, li + 1); |
|
|
|
|
|
try { |
|
|
|
|
|
const payload = JSON.parse(msg); |
|
|
|
|
|
return payload; |
|
|
|
|
|
} |
|
|
|
|
|
catch (e) { |
|
|
|
|
|
throw e; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
// VERIFY PUBKEY OF SENDER from sig
|
|
|
// VERIFY PUBKEY OF SENDER from sig
|
|
|
function parseAndVerifyPayload(data) { |
|
|
function parseAndVerifyPayload(data) { |
|
|
return __awaiter(this, void 0, void 0, function* () { |
|
|
return __awaiter(this, void 0, void 0, function* () { |
|
@ -305,8 +316,9 @@ function parseKeysendInvoice(i) { |
|
|
if (data) { |
|
|
if (data) { |
|
|
console.log("HEY GOT A KEYSENEEDDDDD!!!!!", data); |
|
|
console.log("HEY GOT A KEYSENEEDDDDD!!!!!", data); |
|
|
try { |
|
|
try { |
|
|
const payload = JSON.parse(data); |
|
|
const payload = parsePayload(data); |
|
|
if (payload.type === constants_1.default.message_types.keysend) { |
|
|
if (payload.type === constants_1.default.message_types.keysend) { |
|
|
|
|
|
console.log("HEY ISSSS A TPY 28", payload); |
|
|
isAnonymous = true; |
|
|
isAnonymous = true; |
|
|
memo = payload.message.content; |
|
|
memo = payload.message.content; |
|
|
} |
|
|
} |
|
|