Skip to content

Commit

Permalink
Added phone verification event
Browse files Browse the repository at this point in the history
  • Loading branch information
pipakin committed Feb 28, 2017
1 parent ef20edc commit 1b3a139
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,3 +168,20 @@ export function sendNonReplyMessage(to, msg, communicationType) {

return Promise.resolve(result);
}

export function verifyContact(contact, communicationType) {
const result = {promises: []};
logger.debug("Attempting to verify contact", {contact, communicationType});

emitter.emit("verify-contact", {contact, communicationType, result});

if(result.promise) {
return result.promise;
}

if(result.promises.length) {
return Promise.all(result.promises);
}

return Promise.resolve(result);
}

0 comments on commit 1b3a139

Please sign in to comment.