jacob614

hexchat znc.in/server-time-iso fix

Dec 4th, 2015
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.72 KB | None | 0 0
  1. import hexchat
  2.  
  3. __module_name__ = "znc server time fix"
  4. __module_version__ = "1.0"
  5. __module_description__ = "Removes the znc.in/server-time-iso capability once it is no longer needed"
  6.  
  7.  
  8. removed = {}
  9. def bufferended(word, word_eol, userdata):
  10.     server = hexchat.get_info("server")
  11.     if server not in removed:
  12.         #hexchat.prnt("removing znc.in/server-time-iso capability")
  13.         hexchat.command("CAP REQ -znc.in/server-time-iso")
  14.         removed[server] = True
  15.  
  16. def quit(word, word_eol, userdata):
  17.     # Would use hexchat.get_info("server"), but that returns None
  18.     removed.clear()
  19.  
  20. hexchat.hook_server("329", bufferended) # Seems to be sent after buffextras finishes, can't remember what it is
  21. hexchat.hook_print("Disconnected", quit)
Advertisement
Add Comment
Please, Sign In to add comment