Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
ViberEnabledConnector.prototype.postMessage = function(message, cb) {
var self = this,
addr = message.address,
user = addr.user;
var realUserId = decodeURIComponent(addr.user.id)
var profile = new UserProfile(realUserId, addr.user.name, '', '', '');
if (message.type === 'typing') {
// since Viber doesn't support "typing" notifications via API
// this.viberBot.sendMessage(profile, [new VTextMessage('...', null, null, new Date(), '')]).then(function(x) { cb()}, function(y) {cb()})
cb()
} else {
var viberMessages = [self.convertToViberMessage(message)];
this.viberBot.sendMessage(profile, viberMessages).then(function(x) { cb() }, function(y) { cb() })
}
}