old_contents: class InviteJoinPlugin(object):
      # A command to quickly check whether a user has permissions to access
      # these commands.
      def join_channel(self, cardinal, nick, channel):
          if nick == cardinal.nickname:
              cardinal.join(channel);
      join_channel.on_invite = True
  
  def setup():
      return InviteJoinPlugin()
  
new_contents: class InviteJoinPlugin(object):
      def __init__(self, cardinal):
          cardinal.event_manager.register_callback("irc.invite", self.join_channel)
  
      def join_channel(self, cardinal, user, channel):
          cardinal.join(channel);
  
  def setup(cardinal):
      return InviteJoinPlugin(cardinal)
  
subject: Implement new events into join_on_invite plugin