Skip to content

Instantly share code, notes, and snippets.

@imsickofmaps
Created March 11, 2014 14:40
Show Gist options
  • Save imsickofmaps/9487147 to your computer and use it in GitHub Desktop.
Save imsickofmaps/9487147 to your computer and use it in GitHub Desktop.
function SilentEndState(name, text, next, handlers) {
// State that mimicks the USSD behaviour when a USSD session ends
// it fast forwards to the start of the InteractionMachine.
// We need to do this because SMS/Twitter doesn't have the Session capabities
// that provide us this functionality when using USSD.
var self = this;
handlers = handlers || {};
if(handlers.on_enter === undefined) {
handlers.on_enter = function() {
self.input_event('', function() {});
};
}
self.send_reply = function(){
return false;
};
EndState.call(self, name, text, next, handlers);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment