.. _fbf.plugs.core.underauth: underauth ~~~~~~~~~ .. automodule:: fbf.plugs.core.underauth :show-inheritance: :members: :undoc-members: CODE ---- :: # fbf/plugs/core/underauth.py # # """ handle non-ident connection on undernet. """ .. _fbf.plugs.core.underauth_copyright_: copyright ------------ :: __copyright__ = 'this file is in the public domain' __author__ = 'aafshar@gmail.com' .. _fbf.plugs.core.underauth_fbf_imports: fbf imports -------------- :: from fbf.lib.callbacks import callbacks .. _fbf.plugs.core.underauth_pre_underauth_cb_precondition: pre_underauth_cb precondition --------------------------------- :: def pre_underauth_cb(bot, ievent): """ check if undernet auth in necessary. """ args = ievent.arguments try: return (args[0] == 'AUTH' and args[-3] == '/QUOTE' and args[-2] == 'PASS') except Exception as ex: return False .. _fbf.plugs.core.underauth_underauth_cb_callback: underauth_cb callback ------------------------ :: def underauth_cb(bot, ievent): """ Send the raw command to the server. """ bot._raw(' '.join(ievent.arguments[-2:])) callbacks.add('NOTICE', underauth_cb, pre_underauth_cb)