2019-05-25 20:40:06 +00:00
|
|
|
#--depends-on config
|
|
|
|
|
2018-10-03 12:22:37 +00:00
|
|
|
from src import ModuleManager, utils
|
2016-03-29 11:56:58 +00:00
|
|
|
|
2019-06-28 22:16:05 +00:00
|
|
|
@utils.export("serverset", utils.BoolSetting("accept-invites",
|
|
|
|
"Set whether I accept invites on this server"))
|
2018-09-27 11:08:07 +00:00
|
|
|
class Module(ModuleManager.BaseModule):
|
2018-10-03 12:22:37 +00:00
|
|
|
@utils.hook("received.invite")
|
2016-03-29 11:56:58 +00:00
|
|
|
def on_invite(self, event):
|
2018-09-03 10:47:11 +00:00
|
|
|
if event["server"].is_own_nickname(event["target_user"].nickname):
|
|
|
|
if event["server"].get_setting("accept-invites", True):
|
|
|
|
event["server"].send_join(event["target_channel"])
|
2018-09-09 09:17:22 +00:00
|
|
|
|