You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

51 lines
1.7 KiB

  1. --
  2. -- <user> has quit (Leaving...)
  3. -- otr disconnect in buffer "&bitlbee
  4. -- <user> has joined &bitlbee
  5. -- otr reconnect in buffer "&bitlbee
  6. -- init
  7. local w = weechat
  8. -- todo: read variablelist from weechat buffer
  9. local user1 = "exampleuser"
  10. -- weechat.register(Name, Author, Version, Lizenz, Beschreibung, Shutdown_Funktion, Zeichensatz)
  11. w.register("OTRMeise", "markus", "17.0", "WTFPL", "OTR Hooks für user mit lausigen xmpp client", "", "")
  12. w.print("", "OTRMeise passt jetzt auf!")
  13. -- perform otr disconnect user1
  14. function otr_disconnect (data, signal, signal_data)
  15. local nick = w.info_get("irc_nick_from_host", signal_data)
  16. if (nick == user1) then
  17. local buffer = w.info_get("irc_buffer", "osuv,&bitlbee")
  18. w.command(buffer, "otr disconnect " .. user1)
  19. w.print("", "OTRMeise: otr disconnect " .. user1)
  20. elseif (nick == user2) then
  21. local buffer = w.info_get("irc_buffer", "osuv,&bitlbee")
  22. w.command(buffer, "otr disconnect " .. user2)
  23. w.print("", "OTRMeise: otr disconnect " .. user2)
  24. end
  25. return w.WEECHAT_RC_OK
  26. end -- otr_disconnect
  27. -- perform otr reconnect user
  28. function otr_reconnect (data, signal, signal_data)
  29. local nick = w.info_get("irc_nick_from_host", signal_data)
  30. if (nick == user1) then
  31. local buffer = w.info_get("irc_buffer", "osuv,&bitlbee")
  32. w.command(buffer, "otr connect " .. user1)
  33. w.print("", "OTRMeise: otr connect " .. user1)
  34. elseif (nick == user2) then
  35. local buffer = w.info_get("irc_buffer", "osuv,&bitlbee")
  36. w.command("", "OTRMeise: otr connect " .. user2)
  37. w.print("", "OTRMeise: otr connect " .. user2)
  38. end
  39. return w.WEECHAT_RC_OK
  40. end -- otr_disconnect
  41. w.hook_signal("*,irc_in2_quit", "otr_disconnect", "")
  42. w.hook_signal("*,irc_in2_join", "otr_reconnect", "")