Created
March 11, 2014 14:40
-
-
Save imsickofmaps/9487147 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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